Content Validation 5.5.2 WP7

One of the most common reason for rejection for Windows Phone 7 (Wp7) apps, is support for dark and light themes.  Most developers work in the dark theme, then not realizing that the text can’t be read when the phone is switched to light theme. This is picked up by Microsoft Testers, and reported as a Content Violation 5.5.2

Requirements
Application content, such as text and visual
elements, must be visible and legible regardless of
the phone theme. For example, if the phone
theme changes from black background to white
background, the text and visual elements of your
application must be visible or legible.

Comments: STEPS TO REPRODUCE
1. Navigate to the Settings page in the app list.
2. Tap theme and change Background to ‘Light’.
3. Launch your application.
4. Verify that the text and visual elements of the application are visible and legible.
RESULT
The application UI text is not legible when viewed in the ‘Light’ theme.

 

Here, is a solution I have come up with for “Panorama” style apps, by creating two backgrounds, one mostly black, one mostly white, and then calling the following function on MainPage_Loaded

/// <summary>
/// Detect theme, and apply background accordingly
/// </summary>
private void DisplayState()
{
Color lightThemeBackground = Color.FromArgb(255, 255, 255, 255);
SolidColorBrush backgroundBrush =
Application.Current.Resources[“PhoneBackgroundBrush”] as SolidColorBrush;
// Assume dark theme
BitmapImage bitmapImage = new BitmapImage(new Uri(“PanoramaBackground.png”, UriKind.Relative));
if (backgroundBrush.Color == lightThemeBackground)
{
// you are in the light theme
bitmapImage = new BitmapImage(new Uri(“LightPanoramaBackground.png”, UriKind.Relative));
}
ImageBrush imageBrush = new ImageBrush();
imageBrush.ImageSource = bitmapImage;
this.panorama.Background = imageBrush;
}

 

Categories: Uncategorized

KB2463332 – Warning: SQL server inaccessible during installation

The Microsoft Windows Update KB2463332 makes your SQL server 2005 inaccessible during installation

If, you’ve got a situation where your database needs to be online 100% of the time, then take care when installing this update, and make sure you’ve got a backup in place.

The error message reported from SQL server during installation is:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

– It works fine once the installation is complete.

Categories: Uncategorized

Export Bing Results to CSV

Ever since Google withdrew it’s search API, a way to automate search engine queries has fallen on Bing, and it’s obliged with the bing search API. You’ll need a Bing search API key before you can use this, but the process is automatic and free.

Unlike the old Google search API, the search result set is limited to 50 results per query, however, the query can be re-run with different offsets, and the result set concatenated.

A live demo of this can be seen at http://bing.freetextuk.com – Which returns a CSV of 300 results for any Bing query. The search box is pre-filled with a sample search to find link directories in spain (ending in .es).

 

Categories: Uncategorized

Serve .torrent files from IIS7

Categories: Uncategorized

How to cancel any outstanding javascript on a page

Categories: Uncategorized

(PlayBook) Code signing request failed because this file has been previously signed

If you’re working on developing for BlackBerry PlayBook TabletOS, using webworks, you’ll find the usual fun & games when trying to sign the BAR file.

Here’s a few “Gotcha’s” that I got this morning:

[INFO] Parsing command line options
[INFO] Parsing bbwp.properties
[INFO] Validating WebWorks archive
[INFO] Parsing config.xml
[INFO] Populating application source
[INFO] Compiling WebWorks application
[INFO] Packaging the bar file
[INFO] Bar packaging complete
[INFO] Starting signing tool
Error: Code signing request failed because this file has been previously signed.

[ERROR] Signing failed

The solution to this error is to increment the buildId, as follows:

C:\Program Files\Research In Motion\BlackBerry WebWorks SDK for TabletOS 2.2.0.5\bbwp>

bbwp c:\bbwp\build\APP.zip -g -gcsk pwd -gp12 pwd2 -o c:\bbwp\build -buildId 2

Another nice error was this:

[INFO] Parsing command line options

[ERROR] Cannot sign application – failed to find signing keys

This basically meant that your p12 file needs to be in this folder

C:\Program Files\Research In Motion\BlackBerry WebWorks SDK for TabletOS 2.2.0.5\bbwp\bin

and named “sigtool.p12

 

 

Categories: Uncategorized

Basic HTTP Authentication over XMLHttpRequest (AJAX)

Here is a simple way to perform basic HTTP Authentication with a XMLHttpRequest – Ajax request – from your webpage.

       var url = 'http://someurl.com';
	xml = new XMLHttpRequest();
	xml.open("GET", url, false, "username", "password");
	xml.onreadystatechange = function() {
	   if (xml.readyState != 4)  { return; }
	   if (xml.status != 200)  {
		 alert("error");
		 return;
	   } 
	   alert(xml.responseText);	   
	 };
	 xml.send(null);

You don’t have to do the Base64 encoding yourself, unlike some examples online. – Do note that “url” needs to be on the same domain as your script.

Categories: Uncategorized

Install a COD file on a Blackberry

Categories: Top, Uncategorized

Make iPhone App available for iPad

Categories: Uncategorized

Porting a Palm Pre WebOs App to Touchpad

Categories: Uncategorized