How to get IP address in Windows Phone 8 and Windows 8.1 app

Windows Phone 8 provides an easy way to identify the IP address of the phone from the Windows Phone App. Note that there are possibilities of having multiple network interfaces on your Windows Phone. For example, the Windows Phone Emulator has 3 network interfaces as shown in the screenshot below. The code snippet tries to retrieve the first one which is added to the List.

Windows 8

DNS is not supported by Metro applications. So to find the IP address in a Metro app import the Windows.Networking.Connectivity namespace. NetworkInformation.GetInternetConnectionProfile retrieves the connection profile associated with the internet connection currently used by the local machine. NetworkInformation.GetHostNames retrieves a list of host names. Hostname has various properties such as Canonical Name, Display Name and Raw Name, but they all seem to return the same string. Here ipadd will give the IP address of the machine (localhost). The code below lets you fetch the IP address of the local machine.    

Here’s a screen shot of the app showing the IP address in a textbox.

Get the full source code of the solution with Windows Phone 8 and Window 8.1 projects in it.

Download full project source code IP-Address.zip

Creating a free Windows 8 metro app for your WordPress blog using IdeaPress

We have already seen that how you could make a windows phone app for your website using Microsoft’s app studio. Now let us try converting a wordpress blog to windows 8 metro app. There are plenty of templates available in app studio that let you create universal apps (for both windows phone and windows 8) but the website template doesn’t let you create a desktop app. So lets use another service which is more or less free if you follow this tutorial. Here’s a link to their website.

http://www.ideapress.me/

They have a special section for Windows 8 app at http://win8.ideapress.me/. They have made the source code open to all and have put it up on github. One way is to download the zip file of the project and run it in visual studio to tweak things. This is more suitable for experienced developers.

 

However, this blog post targets those who have just started with Windows development and want to see their wordpress website on a Windows 8 app without not much real coding. Follow these steps and at the end of it you will be ready with a published (or atleast submitted for certification) app.

Step 1. Visit ideapress and create a new Windows 8 app

Go the link given below and click on Get Started to create a new project.

http://win8.ideapress.me/

 

Step 2. Install IdeaPress JSON API before going ahead with your project

Visit your wordpress site’s admin panel and add a new plugin to it. Search for ideapress json api and install it to your website

 

 

Then go to Settings>> IdeaPress JSON API Settings and check whether both the listed controllers are active. By default IP_RESPOND is inactive. You need to activate both of them to make things work.

 

 

Step 3. Jump back to IdeaPress and enter the site URL

It asks you for the Site URL in the first step. Enter the URL and move to the next step. It will then check whether the IdeaPress JSON API is installed on your website. If it isn’t installed or is inactive then you won’t be able to move to the next step.

 

 

Step 4. Enter the app details in General Info tab

The wizard asks you for app name, description, category and default language in the General Info tab. Fill in all the details and move to the next step.

 

 

Step 5. Choose what content to display in the app

This tab lists all the pages and post categories from your blog. Choose what you wish to display and what to omit.

 

 

Step 6. Configure the theme for your app

This is by far the longest step in the whole wizard. Choose the layout, theme and colors. Upload the logos, splash screen and live tile images. Move to next step when you are done customizing the look and feel of your app. The preview shows you exactly how your app looks.

 

 

Step 7. Generate the app package in the last step of the wizard

Each Windows 8 app requires a privacy policy link. Create a privacy policy page on your website and provide its link here. If you wish IdeaPress to publish the app for you then they would charge a fee of 199$. Otherwise you could generate a publish package or a visual studio solution for free. A publish package contains the APPX file that needs to be submitted to the store and the visual studio solution contains the whole project file which you could edit and publish at your own ease. So if you choose to publish the app manually then IdeaPress doesn’t charge you anything for it.

 

 

Step 8. Submit the app to the store.

Go to windows 8 dev center and submit the app for certification. Here’s a blog post explaining how you could submit an app to Windows 8 dev center.

http://www.windowsapptutorials.com/windows-8/general-windows-8/submitting-a-windows-store-app-for-certification/

That’s all you need to create a free Windows 8 metro app for your WordPress blog using IdeaPress. IdeaPress is a great way to convert your apps to Windows Phone 8 and Windows 8 apps.

Submitting a Windows Store app for certification

If you find it tricky to submit a Windows 8 app for certification, then this tutorial is for you. Bookmark it for reference while submitting an app to the Windows 8 store. You will need a publisher account before you could submit any app to the marketplace. Windows dev center’s annual fee is very less as compared to other platforms and if you already have a Windows Phone dev center account then you don’t need to pay again. Your new Windows 8 account will be linked with the Window Phone account if you are using the same email address. Here’s how you could submit an app to store.

Step 1. Associate your app with the Windows Store

In this tutorial I will be using the same app which we creating using IdeaPress for Windows 8. Have a look at this blog post to see how we created an app from our WordPress website using IdeaPress for free and generated the Visual Studio package.

Right click on the project name in solution explorer, go to Store> Associate app with the Windows Store. You will be prompted to log in the Microsoft account with which your publisher account is linked. After login the dialog box will list the project which don’t have any packages added to them from Windows Phone and Windows 8 dev center combined. You could also reserve a new app name. Reserve a new app name if it’s a new app and is not already published for Windows Phone. Here I choose to select one of the existing app names as Windows App tutorials was already published to windows phone and I wish to use the same identity for Windows 8. Choosing an existing app name will let you make your app universal as they both will share the same identity in the store.

 

 

Step 2. Create App Packages

Go to Store> Create App Packages by right clicking on the project name. You would be prompted to login and in the next step it will ask whether you want to build packages to upload to the Windows Store. Choose yes and click on Next.

 

 

Next step will ask you for output location, version number and solution configuration mappings. The default settings work well and you could now click on Create to build the APPX file.

 

 

Next it will ask you if you wish to run the App Certification Kit. It is recommended to let it run all the tests and check for any possible errors. Better invest some time now to save the frustration of your app not getting certified after submission.

 

 

Step 3. Take Screen Shots

Go to store> Take Screen shots to take screen shots of various screens of the app. These would be required during submission.

Step 4. Visit windows 8 dev center and login to your account

Go to https://appdev.microsoft.com/StorePortals/ and login to your account

Step 5. Start submission of a new app

After login choose Submit an app from your dashboard to start submitting an app for Windows 8.

 

 

The app submission screen shows various sections that needs to be completed in order to submit an app. It’s a little tedious but it can’t be helped!

 

 

Step 6. Fill in the details under app name

In this section you need to enter the name for your app. If you are using an existing name then you could use if from the list or else reserve a new name for your app. You could use an existing app name if your app already exists in the Windows 8/Windows Phone store.

 

 

Step 7. Enter the selling details

This step lets you choose the price and market for your app. Choose your preferred price from the list and select the markets to which you wish to publish the app. Here I am choosing all markets as I am sure that it won’t violate any content compliances.

 

 

Also scroll down to choose the app category and release date.

 

 

Step 8. Add the services which your app uses

If your app makes use of any services like azure mobile services or in app purchases then fill in those details. We just click on save the default settings.
Capture
Step 9. Add an age rating and rating certificates

This step lets you choose an age rating for your app. If you wish to avoid uploading any rating certificates to your app then it is safe to choose `12 and older`. Otherwise you need to add the appropriate certificates with the app.

 

 

Step 10. Add Cryptography details

This step asks for how your app uses cryptography and encryption. We don’t make uses of any encryption so we choose the appropriate options and move ahead.

 

 

Step 11. Upload the app package

Locate the APPX file in your project and choose to upload it here.

 

 

After uploading it will verify if the uploaded package has valid identity. Save it and move to the next step.

 

 

Step 12. Add app description

Add the description, features, keywords and screenshots for your app. It lets you add different details for Windows 8.1 and Window 8.

 

 

That’s all which is needed to submit an app. Now keep waiting till your app gets certified. It usually takes less than one day to get an app certified.