Setting up Eclipse for Windows Azure Mobile Services Development

There were no detailed instructions for this and I ran into some problems when following our tutorial for this so here are my super easy to follow instructions.  I did this on Windows 8.1 64bit OS installed in a Hyper-V VM.  These instructions are for the 64 bit environment (I did not try the 32 bit).

Install the Android SDK

From the Android SDK download choose the big button on the right (link is this Download the SDK ADT Bundle for Windows):

image

Read the license agreement and if you don’t agree then STOP, otherwise grab the 64 bit SDK and download it:

image

Unzip the package (I put it in my documents in a folder I created called Android Development):

image

and read this:

https://developer.android.com/sdk/installing/bundle.html

For convenience pin a link to Eclipse.exe on your taskbar.  It is in the Eclipse sub-folder wherever you installed the android SDK and you can navigate there using Windows Explorer, right click on it and pin it:

image

Install the JDK

What is missing is now is the JDK.  Go here and install it:

https://www.oracle.com/technetwork/java/javase/downloads/index.html

Press the big Java button:

image

Accept the license agreement if you agree and download the Windows x64 version:

image

Once you have installed the JDK there is still more to go!

Workspace and additional components

Now we need some more components.

When you start Eclipse create a workspace in your Documents folder:

image

If everything is OK, and Eclipse starts go to the Android SDK Manager by choosing Window, Android SDK Manager.

image

When the Android SDK Manager comes up, Close Eclipse then return to the SDK Manager and add ‘Google Play Services’ by checking it (under Extras) and install that and any updates that were detected for you:

image

When that finishes, go back and select Google APIs and install that too:

image

You can close the Android SDK Manager now.

Configure the Emulator

In order to use Push notifications you need to configure an emulator that has the Google APIs.  To do this open Eclipse and go to Window, Android Virtual Device Manager:

image

Select the Nexus S by Google and hit the Create AVD… button:

image

For Target ensure you select Google APIs as shown below (important note: if you don’t see that option available, then you did not follow the steps I have listed above.  You must resolve this or you cannot test Push Notifications).

image

Now you can proceed with the Data and Push tutorials for Android!

Footnotes

If you get this error when running the Push Tutorial:

E/AndroidRuntime(1701): Caused by: java.lang.NoClassDefFoundError: com.google.android.gms.gcm.GoogleCloudMessaging

You need to ensure you reference the GooglePlay Library in your project

Right Click on your project and choose properties:

Then Android, Add the google-play-services_lib as shown:

image

Hit OK.

Conclusion

There are a couple of nuances for setting up Google Play Services and the SDKs to get started, but this should help you tremendously!  Drop me a note if you found this useful and be sure to follow me @jsandersrocks and my team @WSDevSol on twitter!