Windows Phone: Sharing Content

If you writing an app and want to add some social sharing capabilities like posting link to Facebook or twitter. Your initial approach may be to go to and check out each of their api’s or to go to codeplex and search for a C# api someone’s written that makes the integration simpler. But right from that start Windows Phone has had a much simpler way of doing things.

The ShareLinkTask provides a simple way to post messages to any social network the user has registered on their phone. You don’t need to do anything with authorising your app with facebook etc which not only makes things easier for you, but your users are also pleased as they don’t have to worry about what you may be doing with their passwords.

It also only takes 4 lines of code. Simply create an instance of the ShareLinkTask, set the tile and message and call the show function:

ShareLinkTask shareLinkTask = new ShareLinkTask(); 
shareLinkTask.LinkUri = new Uri("http://www.himynameistim.com");  
shareLinkTask.Message = "Check out this great blog"; 
shareLinkTask.Show(); 

As well as the ShareLinkTask there is also a ShareStatusTask and ShareMediaTask that can be used if you just want to post a status update or post and image.

ShareStatusTask shareStatusTask = new ShareStatusTask();

shareStatusTask.Status = "I'm developing a Windows Phone application!";

shareStatusTask.Show();

           ShareMediaTask shareMediaTask = new ShareMediaTask();
           shareMediaTask.FilePath = path;
           shareMediaTask.Show();
       

Social media isn’t the only way of sharing content on a phone though, there is also email and sms. Both of these are just as easy to do as social media though:

For email use the EmailComposeTask

EmailComposeTask emailComposeTask = new EmailComposeTask(); 
emailComposeTask.Subject = "Awesome website"; 
emailComposeTask.Body = "Foo bla bla"; 
emailComposeTask.Show(); 

And for SMS use the SmsComposeTask

SmsComposeTask smsComposeTask = new SmsComposeTask();

smsComposeTask.To = "2065550123";
smsComposeTask.Body = "Try this new application. It's great!";

smsComposeTask.Show();

For more information have a look at the MSDN documentation:

Share Link Task – http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394009(v=vs.105).aspx

Share Status Task – http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394027(v=vs.105).aspx

Share Media Task – http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207027(v=vs.105).aspx

Email Componse Task – http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394003(v=vs.105).aspx

SMS Compose Task – http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394005(v=vs.105).aspx

Advertisements

Windows Phone: Rate My App

If you want your app to succeed one thing you need is reviews. More importantly you need good reviews!

Stats show that if an app has a rating of 4 stars or above it will do significantly better than an app with less. The higher the number of reviews, the more believable that rating is.

One issue you may have though is how to get reviews. Sadly most users don’t rate apps unless they really like it or hate it. The Windows Phone OS also does nothing to prompt people to rate apps, so if you want to build up reviews then your going to need to do the prompting yourself.

The code to direct someone to the review page in the store for your app is quite simple. But even better is the fact Nokia have produced sample code that does the whole process!

App_Ratings_Guide_WP

Once you’ve integrated the code on the 5th launch of your app the user will see a prompt asking them to rate your app. If they choose not to then they will be prompted to send you feedback via email.

If they didn’t rate your app then on the 10th launch they will be prompted again.

Now getting good reviews is slightly harder, for that your actually going to have to build a good app that people like.

You can download the Rate My App code from Nokia here.

Training Buddy

Training Buddy is an app that I wrote for Windows Phone 7, intended for anyone who likes Running, Cycling or Walking and would like to keep a log of their workouts.

The app will monitor the route you take along with various stats like speed, pace and how many calories you are burning. During the activity you can set up audio alerts to let you know how your doing and afterwards it will store a log of all the activities you have done for review later on.

For more information on the app visit www.trainingbuddyapp.com or view the app in the Zune Marketplace.