Nokia recently introduced the Nokia X family of smartphones, which provides users access to the world of Android. The good news for C# developers is that using Xamarin you can start writing apps for this platform from day 1. If you’re new to building Android apps in C#, do check out my blog post on “How I built an Android app in C# & Visual Studio in less than 24hrs” that I wrote few months back.
Setting things up
The core Nokia X platform is built on Android Open Source Project v4.1.2, which supports API level 16. That means you’ll be targeting API 16(4.1.2) for your app development. You’ll also need to install Nokia X specific packages in the Android SDK Manager.
Configure Nokia X specific packages
Start Android SDK Manager from Visual Studio.
- Select Tools > Manage Add-on Sites…
- Open User Defined Sites tab and click the New… button
- Enter the following URL to the Add Add-on Site URL dialog:
http://tools.nokia.com/nokia-x/repository/addon.xml - Click OK
Install Nokia X specific packages and API level 16
Be sure to install Nokia X System Image under Android 4.1.2(API 16)
You’ll also need to install the following extras:
- Nokia X Device Definitions
- Nokia X services
- Nokia X USB Driver
- Intel x86 Emulator Accelerator(HAXM) (optional)
Configure Nokia X emulator
Open Android Emulator Manager from Visual Studio and create a new emulator with the following configuration:
- Give your emulator a name say Nokia-X
- Select the Device Nokia X (480 x 800; hdpi)
- Select Intel Atom (x86), if you have HAXM installed and Intel VT-X enabled (gives you a faster emulator)
- Be sure to select Nokia X Services under Target
- Have an SD card with a desired size
- Select Use Host GPU as emulation options
Kick Start the Emulator
Hello World
Writing your first app on Nokia X using Xamarin is as simple as creating a regular Android app in Visual Studio.
File > New Project > Visual C# > Android > Android Application
In your project properties, be sure to compile your Android app with Version 16 or lower.
That’s it. Go Run your first app!
I had a simple code to Toast Notify with a custom message on a button click. When I ran it, I saw the message appearing on the top left corner instead of the usual Android toast. Looks like few things have changed here. Refer Nokia X Design Guidelines for changes that you must be aware of.
Nokia X Components
Nokia has shipped Xamarin components for their Nokia X SDK. Don’t forget to check them out at the component store.
Mike Bluestein has a nice post on Nokia HERE Maps component – Use Nokia X HERE Maps with Xamarin.Android.
– Cheers!
Good One!
Even after installing usb driver. VS is unable to detect my device. From where can I find Nokia-X usb driver for Android debugging.
Did you try changing the USB Computer Configuration to PTP mode instead of MTP?