Mobile-Development

WP8Dev– How to identify the sensors supported on your Windows Phone

August 12, 2013 C#.NET, Codes, KnowledgeBase, Microsoft, Microsoft SDKs, Mobile-Development, VisualStudio, VS2012, Windows, Windows Phone, Windows Phone 8, Windows Phone 8.0 SDK, Windows Phone Development, Windows Phone SDK, Windows Phone Store, XAML No comments

This post will give you an  overview on how to identify the sensors supported on your Windows Phone. As a developer when you are developing for Windows Phone – and your application would need to interact with certain sensors in windows phone to achieve a certain functionality, you would need to verify whether the sensors are supported in  targeted devices.

Windows Phone 8 platform has support for the following sensors

  • Motion sensor  
  • Accelerometer
  • Compass
  • Gyroscope

You can access these API’s through the below namespace:

Microsoft.Devices.Sensors

You can check for any of the sensor support through “IsSupported” boolean property of the class

  • Motion sensor   [ Microsoft.Devices.Sensors.Motion ]
  • Accelerometer  [ Microsoft.Devices.Sensors.Accelerometer ]
  • Compass [ Microsoft.Devices.Sensors.Compass ]
  • Gyroscope  [ Microsoft.Devices.Sensors.Gyroscope ]

Here is the sample code block:

  public static string GetSensors()
        {
               StringBuilder sensorsList = new StringBuilder();

                if (Microsoft.Devices.Sensors.Gyroscope.IsSupported)
                {
                    sensorsList.Append("Gyroscope, ");
                }

                if (Microsoft.Devices.Sensors.Compass.IsSupported)
                {
                    sensorsList.Append("Compass, ");
                }

                if (Microsoft.Devices.Sensors.Accelerometer.IsSupported)
                {
                    sensorsList.Append("Accelerometer, ");
                }

                if (Microsoft.Devices.Sensors.Motion.IsSupported)
                {
                    sensorsList.Append("Motion,");
                }

            return sensorsList.ToString();
        }

Note: Only Accelerometer is supported in Windows Phone 8 emulator. To test remaining capabilities, you would need to deploy the application on a real Windows Phone device.

Sending Mobile Push notification using C#/.NET (iOS, Android, Windows Phone 8, Windows 8 and Blackberry)

August 9, 2013 .NET, ANDROID, Blackberry, Extensions, iOS, iPhone, KnowledgeBase, Microsoft, Microsoft SDKs, Mobile, Mobile Services, Mobile-Development, Nokia, Third-Party-Libraries and Frameworks, VisualStudio, VS2010, VS2012, Windows, Windows 8 apps development, Windows Phone, Windows Phone 8, Windows Phone 8.0 SDK, Windows Phone Development, Windows Phone SDK, Windows Phone Store, Windows SDK, Windows Store, Windows Store Development 2 comments

This is an update blog to my earlier blog about Sending Apple iOS Push notifications using C#.

With that blog – I  introduced you to  how to send push notification using Open Source library APNSharp, by the developer John Redth.  Redth announced that library is already deprecated.

Redth came up with  with another open source project called as PushSharp:,published under apache software foundation license.

PushSharp is a server-side library for sending Push Notifications to iOS (iPhone/iPad APNS), Android (C2DM and GCM – Google Cloud Message), Windows Phone, Windows 8, Amazon, Blackberry, and (soon) FirefoxOS devices!. Single library serves the purpose of sending push notifications to multiple platforms. Pretty decent isn’t it?

Here is the basic  architecture:

image

Features of PUsHSHARP

  • Supports sending push notifications for many platforms:
    • Apple (APNS – iPhone, iPad, Mountain Lion)
    • Android (GCM/C2DM – Phones/Tablets)
    • Chrome (GCM)
    • Amazon (ADM – Amazon Device Messaging)
    • Windows Phone 7 / 7.5 / 8 (including FlipTile, CycleTile, and IconicTile Templates!)
    • Windows 8
    • Blackberry (BIS and BES via PAP)
    • Firefox OS (Coming soon)
  • Fluent API for constructing Notifications for each platform
  • Auto Scaling of notification channels (more workers/connections are added as demand increases, and scaled down as it decreases)

Implementation using PushSharp is straight forward

Here’s some sample code: shared by Redth

//Create our push services broker
var push = new PushBroker();

//Registering the Apple Service and sending an iOS Notification
var appleCert = File.ReadAllBytes("ApnsSandboxCert.p12"));
push.RegisterAppleService(new ApplePushChannelSettings(appleCert, "pwd"));
push.QueueNotification(new AppleNotification()
                           .ForDeviceToken("DEVICE TOKEN HERE")
                           .WithAlert("Hello World!")
                           .WithBadge(7)
                           .WithSound("sound.caf"));


//Registering the GCM Service and sending an Android Notification
push.RegisterGcmService(new GcmPushChannelSettings("theauthorizationtokenhere"));
//Fluent construction of an Android GCM Notification
//IMPORTANT: For Android you MUST use your own RegistrationId here that gets generated within your Android app itself!
push.QueueNotification(new GcmNotification().ForDeviceRegistrationId("DEVICE REGISTRATION ID HERE")
                      .WithJson("{"alert":"Hello World!","badge":7,"sound":"sound.caf"}"));

You can get the Push Sharp for your .NET projects from below mentioned links:

Binaries from NuGet: https://www.nuget.org/packages/PushSharp 

To install PushSharp, run the following command in the Package Manager Console

PM> Install-Package PushSharp

Source Code from GitHub: https://github.com/Redth/PushSharp

Documentation and Implementation Guides available at wiki page: https://github.com/Redth/PushSharp/wiki 

Quick links to implementation guides

You can read my previous blogs here:

Sending Apple iOS Push notifications using C#

Apple Push Notifications Service API & C#

Dear Windows Phone users – “Easy Banking IN” is no more.. Rest in Peace..

May 30, 2013 Announcements, Microsoft, Mobile-Development, Windows, Windows Phone, Windows Phone 7, Windows Phone 7.8, Windows Phone 8, Windows Phone Development, Windows Phone SDK No comments

Few months back all of a sudden I came across an Idea, there is no mobile banking reference application in Windows Phone market place. So I thought of putting it together and my idea came alive in one day of work and I published to the marketplace.

“Easy Banking IN” was well received by users and users were happy that they are getting an app that would help them in their mobile internet banking needs. Time to time I made so much of improvements as per user feedback.

image

Marketplace link: http://www.windowsphone.com/en-in/store/app/easy-banking-in/6d36eef8-e022-4264-8b3b-bc7978e37999

Till now Easy Banking IN:

1. Was top 5-6th free App in “Banking and Personal Finance Section”

2. More than 24,000 downloads since Sept 2012

3. User reviews were averaged at 4.0/5.0  and 100+ reviews

All of a sudden few weeks back it has been removed from Windows Phone store. I have received a disappointing note from Microsoft.

From: Windows Phone Marketplace Report App
Sent: 21-05-2013 02:21
To: nithinmohantk@hotmail.com
Subject: NOTIFICATION: Windows Phone Application(s) Removed – Easy Banking IN

Dear Developer,

The application(s) listed below have been removed from the Windows Phone Store because your application(s) are not affiliated with the original banking institution and it was determined that the application(s) posed a security risk to Windows Phone users in violation of the Application Requirements for Windows Phone Store. You will not be able to republish the application(s) listed below.

Application(s) Removed

Easy Banking IN

Windows Phone Store Team

Reason “Windows Phone Team” mentioned was they feel the application is dangerous and I have no affiliation from any of the banks – hence “Easy Banking IN” is prohibited from Windows Phone store. 

  • For building a mobile banking sites database – why would somebody needs an affiliation from Banks?
  • In this internet and smart phone age you will lot other application – similar to application which only helps the user in their daily mobile banking needs.
  • I tried to explain the Windows Phone Legal team that,  it is only a mobile internet banking sites reference application. Why do you consider it as a threat? No answer to that.
  • Windows Phone Team says – any application listed under ‘Banking and Finance Category’ requires an affiliation from bank. Crazy policy right – they are just beating around the bush. If you look at iOS and Android application store – you will see similar application been listed with out any issues.
  • Again this legal and affiliation is a biased one only for “Easy Banking IN” and I could see lot other 3rd party applications listed in Windows Phone store without any affiliation. 

Final is I decided to scrap my application, due to the fact that Microsoft’s careless legal team is not ready to accept – the points I tried to explain.  No use at all, I can’t fight with them. Seems some one has reported to Microsoft legal that this application is dangerous and legal team has blindly believed it.

Sincere thanks to all the users of “Easy Banking IN”, and really sorry for disappointing you all by scrapping the “Easy Banking IN” project.   Thank you Microsoft team for the great  Inspiration.

These are the communication I received from Windows Phone app team:

and the final reply:

Hello Nithin,

Once again, the reason for removal of the app is because it is a banking related app that is not affiliated with a banking institution.  This means the only scenario that this app would be permitted is if you have an affiliation with a bank.  You are of course permitted to create and submit other non-banking related apps.

Thank you,

Windows Phone Store Team

From: Windows Phone Marketplace Report App [mailto:reportap@microsoft.com]
Sent: 23 May 2013 10:07 PM
To: Nithin Mohan T K
Subject: RE: NOTIFICATION: Windows Phone Application(s) Removed – Easy Banking IN

Hello Nithin,

We have previously described the reason why your application was removed from the Windows Phone Store.  Non-affiliated banking related applications are prohibited.  This policy is applied to every app on the Store, and any information, documentation, or affiliation related to other apps and developers is strictly confidential.  We do not share private information regarding developer accounts, thus you would not see this information posted publicly.  The APA you signed when you created your developer account cites, among other things: “Microsoft reserves the right to remove any Application or In-App Product from availability on the Windows Phone Store for any reason…”  Your application was removed strictly because it was prohibited by Store policy.

Thank you,

Windows Phone Store Team

 

From: Windows Phone Marketplace Report App [mailto:reportap@microsoft.com]
Sent: 22 May 2013 01:21 AM
To: nithinmohantk@hotmail.com; Windows Phone Marketplace Report App
Subject: RE: NOTIFICATION: Windows Phone Application(s) Removed – Easy Banking IN

Hello Nithin,

We’ve recently updated our policy regarding banking applications and other applications that process and/or handle in-app payments.  This policy applies to every application on the Windows Phone Store, and is not targeted specifically towards you as a developer or your application.  Banking related applications are required to provide verifiable documentation that they are affiliated with a banking institution.  Unless you can provide us with an affiliated status, “Easy Banking IN” is prohibited on the Windows Phone Store.

Thank you,

Windows Phone Store Team

From: Windows Phone Marketplace Report App [mailto:reportap@microsoft.com]
Sent: 21 May 2013 08:29 PM
To: Nithin Mohan T K
Subject: RE: NOTIFICATION: Windows Phone Application(s) Removed – Easy Banking IN

Hello Nithin,

Microsoft removed “Easy Banking IN” from the Windows Phone Store because your application is not affiliated with the original banking institution. Your application can be republished if you can provide proof of approval from the banking institution.

Thank you,

Windows Phone Store Team

From: Nithin Mohan T K [mailto:nithinmohantk@hotmail.com]
Sent: Monday, May 20, 2013 6:50 PM
To: Windows Phone Marketplace Report App
Subject: RE: NOTIFICATION: Windows Phone Application(s) Removed – Easy Banking IN

Dear Microsoft,
It is absolutely unnecessary and without specific reason you have removed this application. Application has never violated any security aspects of Windows phone. It had a very good user feedback and a user base. If required I can provide full source code to review.
Kindly please do not do this to my app which is having a good user base. It doesn’t posses any threat to security. Users has been given option to open in built in browser control or in browser itself. It neither injects any scripts.
Based on what factors you have removed app without any discussion with me.
Please respond ASAP…
Thanks & Regards
Niithin Mohan


User Feedbacks

EasyBankingIN_Feedback001EasyBankingIN_Feedback002EasyBankingIN_Feedback003EasyBankingIN_Feedback004EasyBankingIN_Feedback005EasyBankingIN_Feedback006EasyBankingIN_Feedback007EasyBankingIN_Feedback008EasyBankingIN_Feedback009EasyBankingIN_Feedback010EasyBankingIN_Feedback011EasyBankingIN_Feedback012

Windows Phone devices for Testing– available FREE Online- by Nokia Developer program

April 2, 2013 KnowledgeBase, Microsoft, Microsoft SDKs, Mobile-Development, Nokia, Nokia Developer, Windows, Windows Phone, Windows Phone 7.8, Windows Phone 8, Windows Phone 8.0 SDK, Windows Phone Development, Windows Phone SDK No comments

We all are looking for multiple Windows Phone devices to test our applications. Here is the good news, Nokia came up with a solution for all Nokia Developer program members – “Nokia Developer Remote Drive Access(RDA)” program, through which you can remotely allocate and use a Windows Phone devices for testing purposes. Interesting right?.

It is indeed FREE for all Nokia Developer members.

[Image Courtesy: NOKIA]

The Nokia Developer Remote Device Access (RDA) service is available to all Nokia Developer members (if you don’t have an account, you can create an account for free). You can access the service by using their Nokia Developer logins and passwords.

Each user automatically receives a specific amount of device-usage time per day. The current limit is 8 hours/day.

Here is the link to access Remote Device Access(RDA)

image

For more details and how to use visit the MSDN blog:

http://blogs.msdn.com/b/myamama/archive/2013/04/02/free-windows-phone-8-devices-for-testing.aspx

Multilingual App Toolkit for Visual Studio 2012–for Windows Phone and Windows 8 apps

March 9, 2013 .NET, Community, KnowledgeBase, Microsoft, Microsoft SDKs, Mobile-Development, MSDN, VisualStudio, VS2012, Windows, Windows 8, Windows 8 apps development, Windows Phone, Windows Phone 7.5, Windows Phone 7.8, Windows Phone 8, Windows Phone Development, Windows Phone SDK, Windows SDK, Windows Store, Windows Store Development No comments

Multilingual App toolkit for Visual Studio 2012 helps the windows Phone and Windows store app developers to integrate Multi lingual/localization capability in your applications.

This extension for Visual Studio 2012 helps you localize your Windows Store and Windows Phone apps with translation support, translation file management, and editor tools.

Download Multilingual App Toolkit for Visual Studio 2012

read the Blog from windows Phone team for more details: tips for localizing windows phone apps

See some related videos here:

Microsoft Media Platform – Player Framework for Windows 8 and Windows Phone 8 updated to version 1.1

March 5, 2013 .NET, .NET Framework, Codeplex, Community, IIS Smooth Streaming, Microsoft, Microsoft SDKs, MSDN, OpenSource, Streaming Media, VisualStudio, VS2012, Windows, Windows Phone, Windows Phone 8, Windows Phone 8.0 SDK, Windows Phone Development, Windows Phone SDK, Windows Phone Store, Windows SDK, Windows Store No comments

Microsoft Media platform team has recently updated the “Media Player Framework” for Windows 8 and Windows Phone 8 to version 1.1, which includes few enhancements and fixes.

“Media Player Framework” helps you in building media applications for Windows 8 and Windows Phone 8.  The player framework contains an open source framework available for Silverlight, HTML5 and XBox media applications, Windows Phone and Windows applications.  It allows application developers to progressively download and play normal media contents from different download sources and other smooth streaming sources.

Download the latest framework from Codeplex.com:  http://playerframework.codeplex.com

Note: This framework is not for Windows Phone 7.x version applications, as it is based on Windows 8 application API’s – which are common for Windows 8 and Windows Phone 8 versions.