March 16, 2012  

 

imageWant to learn how to build a windows phone application (Become a WP7Dev).  Then join us for the Windows Phone Unleashed Series.  The content was created by Daniel Egan (me) and Bret Stateham.

Register for an Event Near You.

Windows Phone Unleashed is put on by the community.  It is an all day event with 3 instructor led sessions paired with Hands On Labs that when you are finished complete the Coffee Findr application. At the end of the day there is a app contest with Prizes.

You can download the finished app from the Marketplace .  From this application you will learn the following skills.  Check it out now.

  • Working with Live Tiles
  • Periodic Execution
  • Pulling Data from Rest Services
  • Deserializing Json
  • Binding data to your UI
  • Using Bing for Maps and Directions
  • Using Isolated Storage and  SQL CE on the Phone
  • Navigation
  • And much much more

We also have TWO different events this time…. We have also added a Games Development Unleashed Event.  So look for an event near you.  But register quickly… seats go fast for this FREE event.

Register for an Event Near You.

(If you have been to an Unleashed Event before. This is NEW content)

 

Agenda for both types of events

 

Line of Business Apps

Introduction to Windows Phone 7 Programming

In this session, we start with a discussion of windows phone, the architecture changes made from 6.5 to 7.0, the hardware specifications and then move into the beginnings of building a WP7 application including...

  1. Application life cycle
  2. Hardware Foundation
  3. Files associated with project template
  4. Splash screen and the importance of 1 second / 19 second loading
  5. Application Bar
  6. Panorama and Pivot controls
  7. MVVM
  8. Marketplace

Connecting to Services

In this session, we will discuss how Cloud Services help to bring power to the phone. We will be binding to a rest based services and show how to search and display the information received. In this session we will also talk about Navigation, passing information between screens, while working with List and detail information.

  1. Navigation
  2. Location
  3. JSON Deserialization
  4. Bing Maps
  5. Isolated Storage
  6. Binding Sample Data
  7. Navigation

Recording Data

In this session we will be adding to our knowledge and learn the importance of live tiles. We will show you how to set up a periodic agent and how to set up and read and write to a SQL Database on Windows Phone.

  1. Live Tiles
  2. SQL CE
  3. Background Processes and Periodic Agents
  4. Launchers and Choosers

Games Development

Introduction to XNA

XNA Game Basics

  1. What is XNA
  2. Game Development Tools
  3. XNA Game Projects
  4. XNA Game Loop
  5. Debugging Games

Working with Images, Sounds and Text

  1. Working with Textures
  2. Playing Songs and Sound Effects
  3. Drawing text with SpriteFonts

Getting User Input

  1. Getting input on the phone
  2. Using the Accelerometer
  3. Using Touch

Game State Management

Managing Game Play

  1. Keeping Score
  2. Tracking Health and Lives
  3. Adding Levels

Managing Screens

  1. Creating Multi-Screen games
  2. Loading content in the background
  3. How to pause the game

Managing State

  1. Phone Application Lifecycle
  2. Supporting Fast Application Switching
  3. Persisting and Restoring State

Silverlight and XNA Integration

  1. Introduction to Silverlight
  2. Silverlight and XNA Integration
  3. Creating a Silverlignt and XNA Game

Advanced XNA Games

Marketplace and Advertisements

  1. Understanding the Windows Phone Marketplace
  2. Submitting your Game to the Marketplace
  3. Adding Advertisements to your game

3D Games

  1. 3D Support in XNA
  2. Creating a simple 3D Game

Multi-Platform Games

  1. Building Games for Phone, PC and XBOX
  2. Other Multi-Platform options

Cloud Integration

  1. Using Windows Azure
  2. Social Gaming Toolkit

 

Remember… Daniel Egan knows Windows Phone Smile

|Categories :  |  |    Comments [0] Trackback
November 9, 2011  

They have been talking about it for a while and it has finally hit the market place.  Tango, the Video Chat application for WP7.  It will obviously work better with the new phones with front facing cameras… but it also works on my Samsung Focus… Check out the video below.

 

 

 

 

 

It of course works best over wifi, but will also work over 4G and 3G

 

image

 

Learn more at http://www.tango.me/ Like us on Facebook at http://www.facebook.com/TangoMe Follow us on Twitter at http://www.twitter.com/tangome Watch us on YouTube at http://www.youtube.com/TangoMe Need Help? Visit http://support.tango.me

|Categories :  |  |    Comments [4] Trackback
October 25, 2011  

 

When working with Isolated Storage on the phone you sometimes have difficulty “seeing” what is located in the IsoStore for your application.  Luckily we have a tool that will help you take snapshots of the Sandboxed Isolated Storage for your application.  It is a command line tool called ISETool.exe and it is located in:

(for 32 bit os) c:\Program Files\Microsoft SDKs\Windows Phone\v7.1\Tools\IsolatedStorageExplorerTool

(for 64 bit) c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Tools\IsolatedStorageExplorerTool

To run the tool, bring up a command line and change the directory to the location above.

 

image

Then run the ISTool.exe with the following parameters

◦ts – take snapshot  (rs for restore)
◦xd – emulator
◦guid – product GUID from WPAppManifest.xml
◦desktop dir – where to copy the isolated storage files

image

 

It will download the contents of your Isolated Storage for that application to the folder you specified

image

 

You can also restore to the phone or emulator by doing the reverse.

ISETool.exe rs xd 11111111-2222-3333-4444-555555555555 “C:\snapshots\IsolatedStore”

 

This can also be used for local databases as well as restoring your environment to a specific state.  Let me know if you have any questions.

 

Camera Picture by Capt Kodak flickr cc

Another great feature for Windows Phone Mango is the ability to set up reminders and alerts in your application (While it is not running).  You would be surprised how many applications want/need this. During our Windows Phone 7 Unleashed events this was a recurring topic. 

The great part is that it is really simple.

 

 

imageFor this application, we are creating a very basic interface.  A text box for the title, a text box for the reminder message and a button that says “remind me”.  In addition, there is a label to hold the parameter that is sent back from the reminder.

The first thing you want to do once you build the UI is to click on the Remind Me button to create the click event for the button and add the following code to the event.

 private void OnRemindMeClick(object sender, RoutedEventArgs e)
        {
            Reminder r = new Reminder("reminder"); 
            r.Title = txtTitle.Text; 
            r.Content = txtContent.Text; 
            r.BeginTime = DateTime.Now.AddSeconds(10); 
            r.NavigationUri = new Uri("/MainPage.xaml?reminder=" + 
txtContent.Text ,UriKind.Relative); ScheduledActionService.Add(r); }

All we need to do is :

  • create an instance of the reminder
  • Set the title and content to the text boxes text property
  • set the begin time (in this instance I am doing it in 10 seconds from now)
  • Set the NavigationUri (this is where you will return when a user clicks on a message)
  • Add the reminder to the ScheduledActionService

Notice that we are passing the txtContent.Text back to the program when the user replies.  This can be userIDs, itemIDs, etc… .  Whatever makes sense for your program.

To capture the returning data, add this to an onNavigatedTo override.

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            string param = null;
            if (NavigationContext.QueryString.TryGetValue("reminder", out param))
                Param.Text = param;

            if (ScheduledActionService.Find("reminder") != null)
                ScheduledActionService.Remove("reminder");

        }

We collect the reminder parameter from the Querystring and set it equal to our Param.txt . Notice that we are also removing the reminder from the service.  In the way ours is constructed, if the user clicked on it a second time it would try to add “reminder” a second time which is not allowed.

There you go…. easy as pie Smile

 

(Clock picture from “H is for Home on Flickr” Creative Commons)

October 18, 2011  

With the release of Windows Phone 7 Mango, you now have the ability to multitask (scheduled multitask) by using background agents.  Background agents allow you to do things when your application is not running. 

 

It is important to understand that the OS is responsible for determining when your background agent can run and is determined by a number of factors. It is also dependent on the type of Background Agent you use.

 

For both types of Agents you are constrained by the following :

Periodic Agents (PeriodicTask) are used when you want a “semi” predictable action to fire.  But they are constrained to the following. For example, you can use Periodic Agents for collecting quick GPS coordinates or updating an RSS feed.

  • 30 Minute Intervals (this time may drift)
  • Run for 25 seconds
  • Might not run on Battery Saver mode
  • Agents per device (The number of apps using agents) can be as low as 6 on some devices

Resource-intensive Agents (resourceIntensiveTask) can be used for more intensive items like downloading larger files or coping database entries to a replication server. But you must keep in mind that they have some specific constraints as well.

 

  • Duration 10 Minutes
  • External Power Required (You need to plug it in)
  • Connection through WiFi or PC
  • Battery 90% or better
  • Screen Lock on
  • No active phone call

What this means is that it MAY never run.  The best case scenario is the user will have their phone connected to their WiFi when they plug it in at night.

But …. after all of that, it is pretty easy to use.  All you need to do is

  • Add a ScheduledAgentTasks project to your solution
  • Add a reference to the agent project in your phone application project
  • Add your code to the Invoke Method in the ScheduledAgentTasks project as shown below

 protected override void OnInvoke(ScheduledTask task)
        {
            //TODO: Add code to perform your task in background
            string toastMessage = "";

            // If your application uses both PeriodicTask and ResourceIntensiveTask
            // you can branch your application code here. Otherwise, you don't need to.
            if (task is PeriodicTask)
            {
                // Execute periodic task actions here.
                toastMessage = "Periodic task running.";
            }
            else
            {
                // Execute resource-intensive task actions here.
                toastMessage = "Resource-intensive task running.";
            }

            // Launch a toast to show that the agent is running.
            // The toast will not be shown if the foreground application is running.
            ShellToast toast = new ShellToast();
            toast.Title = "Background Agent Sample";
            toast.Content = toastMessage;
            toast.Show();

            // If debugging is enabled, launch the agent again in one minute.
#if DEBUG_AGENT
  ScheduledActionService.LaunchForTest(task.Name, TimeSpan.FromSeconds(60));
#endif

            // Call NotifyComplete to let the system know the agent is done working.
            NotifyComplete();
        }

 

The one caveat is that it can sometimes be difficult to debug in an emulator.  If you have a developer phone you will have a much easier time debugging it on the device.  If you have any questions, let me know.

October 13, 2011  

If you are planning on using the new sensors that are in the Windows Phone code named Mango (Gyroscope, Compass, etc...), you need to add some code to your application to test and see if they are available.  You can use the Microsoft.Devices.Sensors namespace to find this out.

 

bool IsGyroSupported = Microsoft.Devices.Sensors.Gyroscope.IsSupported;

bool IsAccelerometerSupported = Microsoft.Devices.Sensors.Accelerometer.IsSupported;

bool IsCompassSupported = Microsoft.Devices.Sensors.Compass.IsSupported;

bool IsMotionSupported = Microsoft.Devices.Sensors.Motion.IsSupported;
 
The Motion Sensor is the API that combines all the other sensors and adds some math to
make it easier to build your application using sensors.
October 10, 2011  

When you are developing your application, you keep in mind that you may not always have a network connection. You should prepare for this simi-connected environment.  To do this, you should use the Microsoft.Phone.Net.NetworkingInformation namespace. With this you can do things like, check to see if the network is available, determine the type of network the phone is using (CDMA, GSM), or find the MO (Mobile Operator)

bool IsConnected =
Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation.IsNetworkAvailable;
  
string MobileOperator = 
Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation.CellularMobileOperator;
 
bool IsCellularDataEnabled = 
Microsoft.Phone.Net.NetworkInformation. DeviceNetworkInformation.IsCellularDataEnabled;
          
bool IsCellularDataRoamingEnabled = 
Microsoft.Phone.Net.NetworkInformation DeviceNetworkInformation.IsCellularDataRoamingEnabled;
 
bool IsWifiEnabled =
Microsoft.Phone.Net.NetworkInformation. DeviceNetworkInformation.IsWiFiEnabled;

 

The NetworkInterfaceType is another good one to put to determine what type of speeds you are going to get.

October 5, 2011  

imageWith the release of Mango, Microsoft has also release a new Web (read online non zune) version of the Marketplace.  This is a great place to discover all of the applications that are available for your Windows Phone.

In addition to allowing you to search for applications, it also lets you install the applications OTA (Over the Air).  This makes it really easy to explore and download applications.  Lets walk through the steps necessary to download apps from the new Web Marketplace.

 

  1. Navigate to http://www.windowsphone.com
  2. Click on the MarketPlace tab.
  3. Search for the application you would like to install. I am going to try 3D Paperball.  You can check out the screenshots and information on the application(including reviews)

    imageimage
  4. Click on the “Get free app” button (if it is a paid/trial app, you will see a Buy button)

    image
  5. Select the Phone you would like to send it to and hit Next
  6. If this is the first time that you are using the Web Marketplace, it will ask you to verify your phone number.  Do this and click next


    imageimage
  7. Click on the Get App link (If it is a paid app… it will confirm billing)
  8. Wait for it to be processed

    image

  9. Your app will then begin installing on your phone


    image
  10. That’s it….  Now go check out the marketplace.

If you have ever tried to debug a windows phone application that uses the Media Library, you have come across the following screen.

 

image

 

This is because the phone will not let you browse to your Media Content while you are connected to Zune……

 

On the other hand, Visual Studio will not let you debug if you are not connected to Zune….

 

So what are you supposed to do???

 

WPConnect.exe will solve your problem.  It is a tool that you can download that will allow you to debug while Zune is NOT running.

 

To get the tool, go to http://create.msdn.com and click on the Download The Tools link.

 

Download the tools

 

IMPORTANT NOTE :  This assumes you have already installed the Windows Phone Developer tools. If you have not, download and install them first.

From here, you can download the October 2010 update to the Windows Phone Developer Tools 

 

This includes (among other things) the WPConnect tool.  Once this is installed, open up a cmd prompt and navigate to

 

%ProgramFiles%\Microsoft SDKs\Windows Phone\v7.0\Tools\WPConnect     (for 32 bit os)

 

or

 

%ProgramFiles (x86)%\Microsoft SDKs\Windows Phone\v7.0\Tools\WPConnect (for 64 bit os)

 

image

 

Leave the window open, don’t run the WPConnect.exe yet.

 

Connect your phone to your computer and make sure that Zune launches and sees your phone.

 

Once Zune is launched and connected,  CLOSE the Zune software

 

Go to the command prompt and type WPConnect.exe and hit enter

 

It will read:

 

       Connecting to Device ‘Your device name here’

       Connection Established

 

 

It will now allow you to navigate to your Media so that you can test applications that work with the Media Library.

 

image

 

I hope that helps.

 

Happy Coding – Daniel Egan – DotNetDoc

The Windows Phone 7 Minute is a show to discuss the features of the Windows Phone 7.  In the show we will talk about things that are important to both Consumers and Developers.  From Live Tiles, to Push Notifications, to cut-and paste, we will talk about the things that are important to you.  If you want a particular subject covered, please drop us a line.

 

Episode I : Hubs and Panoramas

 

In this episode, we discuss the difference between a hub and a panorama and what the benefits are of each.

Enjoy