Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Android and Windows Phone 7: Part 1 – setting up the environment

DZone's Guide to

Android and Windows Phone 7: Part 1 – setting up the environment

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

I recently got to work with an Android device, so I decided to start working with Android development tools, to see how far I can get with development for this platform. And since I am working with Windows Phone 7 development as well, I decided to write a series of articles that would compare the development experience from the very beginning. The purpose of the series isn’t to show how a platform is better than other, since each of them has its own niche, but rather show the differences in the process.

Logically, every development process starts by setting up the development environment. For Windows Phone 7, you would need this:

•    .NET Framework 4.0
•    Visual Studio 2010 (Express at least)
•    XNA Game Studio 4.0
•    Silverlight Tools for Windows Phone 7

When you install the current build of development tools, you will also get Microsoft Expression Blend for Windows Phone, which isn’t a required tool but can in some cases simplify the UI design for a WP7 application. This entire set of tools comes in a single installer package that will automatically set up and configure the development tools.

On the other side, when starting with Android development, you will need the following set:

•    Java Development Kit (JDK)
•    Android SDK
•    Eclipse IDE

Both development kits come with device emulators, so you don’t have to worry about having an actual device at the starter development stages. Of course, later on when you advance with development for the mobile platform of choice, you will need hardware to test your applications on.

While Windows Phone 7 development tools are installed automatically, Android development tools will require you to do some manual configuration. Not that it's very complicated, butit might take a little more time to do this.

Of course, the JDK is installed without much problems – all you have to do is download the installer and launch it on the development system.

After that, you need to download the Android SDK, extract it on your local hard drive and set the correct PATH environment variable, that will point to the SDK location.

You are able to set up the Android development environment for various versions of Android OS, therefore targeting different devices, in case there is a need as such for this.

Since Windows Phone 7 is in its first release as a platform, there is obviously no need to target different OS versions. And since the architecture of the new OS is completely new, it is not compatible with previous version of Windows Mobile.

Chances are you will also want to work from an IDE when developing Android apps. The supported integrated development environment for Android is Eclipse and it takes a bit to configure it. You will need to add the Android repository to make it ready:

Then you will have to actually install the development tools available at the location you specified:

Once done, there will be the Android project option available right in the IDE:

Android development tools are based on a single project type – basically, the developer has to set his application infrastructure by himself. At the same time, Windows Phone 7 offers several presets, for example – for data-driven applications and games, each of them using a different subset of tools available in the .NET Framework:

As I mentioned before, both SDKs are bundled with device emulators:

One distinct feature of the Android emulator is the fact that you can customize it on your own – you can build a device with various parameters to test your application in different environments. This is done through the Virtual Device Manager, bundled with the SDK:

At this point, Windows Phone 7 emulator doesn't have such functionality, but it might be developed at a later stage. Performance-wise, the tools consume pretty much the same amount of computing resources, the emulator taking the biggest toll both on CPU load and RAM usage.

In this article I outlined pretty much every step you need to take to start developing applications for each of the mobile platforms right away.Of course there are some more customization options, but for the basic set - this is the way to go.

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}