Wednesday, November 24, 2010

Setting the background image for an app

For a simple Windows Phone app in the MainPage.xaml file add this line right after the opening to the Grid definition:

        <Grid.Background>
            <ImageBrush ImageSource="your Background file here.png"/>
        </Grid.Background>

Note: The background.png file is not for the app it is for the Tile when your app gets pinned to the Start Screen, and it should be 173X173. 

Is Sprint releasing Windows Phone 7 phones?

According to the Sprint Customer rep I talked to this morning, Sprint already has a Windows Phone 7 on the market.  when I had a chance to look it up online, I found they had a Windows Phone, just not a Windows 7 Phone, it was Windows Mobile 6.1, it was the HTC Touch Pro 2.

http://shop.sprint.com/NASApp/onlinestore/en/Action/DisplayPhones?phoneSKU=PPCT7380SP

A chat with a sprint.com person, said check back next week.  I just did a Google search and found this: HTC 7 Pro, Sprint's Windows Phone 7: Hands On | News & Opinion | PCMag.com

Looks like it's coming soon, don't know about everything working in landscape mode though.  The phone in question is set up to work well in landscape mode when in the open position, see the article for more details.

Last I heard it was in their lab and we should expect it second quarter 2011!

Windows Phone 7 app build and deploys but does not run

  • I could not get the app to run on the phone or in the emulator
    • It built and deployed with no errors
    • Cause: I changed the project name, and the startup App was now blank
    • Solution: Make sure to change the Startup Object on the Properties page of the Application

Thursday, November 18, 2010

Always retest in Trial mode

I released my first paid application to the Marketplace!

I decided to download it in trial version to see it running, the first thing I noticed was the trial version did not run well, as the trial version does not work with the default settings, oh well back to the drawing board, and back through the whole process to get it back into the Marketplace...

Monday, November 8, 2010

Debugging without the Debugger

I had a problem, my app worked well in the debugger, when I submitted it to the Marketplace it failed as it would not run on the phone.  I then tried to deploy it to the phone emulator, and it did not run there either.

I then figured I should rebuild the App piece by piece and check each step to see if it deployed and ran on the emulator.  I then found the method (function) that caused the trouble.

I put a trial mode in my app, and tested by faking a trial mode with a settings object saved in IsolatedStorageSettings.  My problem was I was storing the setting in Isolated Storage with a guard clause checking for the debugger (not deployed), when I did the test in the code I did not include the debugger guard clause.  So when running in the Debugger everything worked, when deployed it crashed on trying to get the isTrial setting.



IsTrial blog entry by a Microsoft Phone "evangelist", Jeff's 31 days of Windows phone is an excellent introduction to writing apps for the Windows Phone.

http://www.jeffblankenburg.com/post/31-Days-of-Windows-Phone-7c-Day-23-Providing-Trial-Versions-of-Your-App.aspx

Thursday, November 4, 2010

Regenerating a .XAP file

XAP files are used to submit applications to the Windows Phone Marketplace.

Story
I was trying to submit an app to the marketplace and kept on getting the same error, no matter how many times I rebuilt the solution and deployed the solution.

The XAP file is located in the <project>\bin\debug directory.

The timestamp on the file was not changing....

I do not know why, the documentation may have been pushing me towards it.  I opened Expression Builder and rebuilt the project (under the tools menu), and this rebuilt the XAP file.

I haven't spent much time using Expression Builder yet, I need to visit it when I make my app perform well under both orientations.