Thursday 13 June 2013

Windows 8 Store App development

For creating a package, you build the app with no errors and go to the menu Project ->Store ->Create App Package. Then you are prompted with a window shown below:



Here for creating a package for testing in a tablet, choose the No option and proceed and so you dont need a Windows Store Account.
But for creating a package to upload in store, choose the Yes option and login with your Store account.
After the package is created successfully, it will be created in a folder called AppPackages in ur app. double click it and you will find a file with .appxupload extension, you have to upload that file in the Store.



These links will help u a lot!!

1. Link for installing an app for testing
http://ericnelson.wordpress.com/2012/11/12/installing-an-application-on-windows-rt-for-testing-is-simple-pimple/

2. Link which helps in submission of the App to the Store, here you need a Windows Store Account.
http://blogs.msdn.com/b/uk_faculty_connection/archive/2013/06/02/how-to-publish-and-update-your-windows-8-store-app.aspx

3. Tips to get your app certified quickly
http://blogs.msdn.com/b/windowsstore/archive/2012/11/19/5-tips-to-getting-your-apps-certified-quickly.aspx

4. Linking from your App to the review page of the App in the Store (after the app is published)
http://www.sharpgis.net/post/2012/09/11/Linking-to-Your-Windows-Store-App.aspx

Tuesday 11 June 2013

Group and Run Automated Tests Using Test Categories

Useful link for Reference

Just add the same Test Category for the test cases
http://msdn.microsoft.com/en-us/library/dd286683.aspx

Thursday 2 May 2013

Windows Store App - Online Advertising in your app


1. Download the Microsoft Advertising SDK for Windows 8
2. Add references in your project

3. Add refernce in your xaml
xmlns:UI="using:Microsoft.Advertising.WinRT.UI"
4. Add the control in your xaml, make sure you give the correct ApplicationID and AdUnitID created at the pubCentre against your hotmail account. give the correct width and height.
<UI:AdControl Visibility="Visible"  Width="500" Height="65"
                    x:Name="AdCntrl"
                  IsAutoRefreshEnabled="True"   ApplicationId="d25517cb-12d4-4699-8bdc-52040c712cab"  AdUnitId="10042999"
                  />
5. Build the project and run your app. It works!!!

Windows Store App - Google Analytics

1. Download the library from http://w8ga.codeplex.com/releases/view/98265
2. Add reference to it from your app
3. Add the project DT.GoogleAnalytics.Metro in your project as in screen shot


4. Add using DT.GoogleAnalytics.Metro; in the required page in ur app
5. Add the following 2 lines to ur App.xaml, give the exact WebPropertyId - This is very important.

6. Follow the steps  from 3 to 8 in https://w8ga.codeplex.com/wikipage?title=Howto  if u wish to add the GA ref in ur App.xaml.cs 
7. if u want google analytics to work in other pages, add the code below : 

var ver = Windows.ApplicationModel.Package.Current.Id.Version;
var appVersion = ver.Major + "." + ver.Minor + "." + ver.Build + "." + ver.Revision;
//appVersion gives you the version of ur app
string pageUrl = "GAME_SS_" + appVersion.ToString() + "_" + CultureInfo.CurrentCulture.Name + "Win8";
AnalyticsHelper.TrackPageView(pageUrl);
You can give whatever string u want in pageUrl which lets u identify the page of ur app and this url will be displayed in the Google Analytics page.


Windows Store App - Audio Playback across all pages


Add the following in MainPage.xaml

<Frame x:Name="frame1" />
        <MediaElement Name="media"
              AudioCategory="BackgroundCapableMedia"
              Source="/Sounds/bgmusic_v9.mp3" Loaded="OnMediaLoaded"/>

Add the following in MainPage.xaml.cs

private void OnMediaLoaded(object sender, RoutedEventArgs e)
    {
            if (App.appVariables.GlobalAudioElement == null)
              App.appVariables.GlobalAudioElement = sender as MediaElement;
    }



Add a static variable GlobalAudioElement.
public  MediaElement GlobalAudioElement = null;



Add the code in the required pages in ur app

        /// <summary>
        /// Mute the sound and displays the unmute button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnMuteClick(object sender, RoutedEventArgs e)
        {
            App.appVariables.Mute = true;
            App.appVariables.GlobalAudioElement.Pause();
            btnMute.Visibility = Visibility.Collapsed;
            btnUnMute.Visibility = Visibility.Visible;
        }
        /// <summary>
        /// Unmute the sound and displays the mute button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnUnMuteClick(object sender, RoutedEventArgs e)
        {
            App.appVariables.Mute = false;
            App.appVariables.GlobalAudioElement.Play();
            btnMute.Visibility = Visibility.Visible;
            btnUnMute.Visibility = Visibility.Collapsed;
        }