Mobile Zone is brought to you in partnership with:

Den is a DZone Zone Leader and has posted 460 posts at DZone. You can read more from them at their website. View Full User Profile

Why switching from Android to Windows Phone 7 won't be a problem

01.31.2011
| 11374 views |
  • submit to reddit

Mobile development is an interesting task and today if an app is available on one platform, chances are it will soon be available for other platforms as well. This is driven by the fact that the percentage of devices on the market is pretty much split among 4 major players: Apple with iPhone, Google with Android, Microsoft with Windows Phone and RIM with Blackberry. Developers want to reach out to as many users as possible with the same product. In this article, I am going to particularly focus on switching from Android to Windows Phone 7 and why this process isn't going to be hard. Everything mentioned here comes from my own experience, so feel free to add reasons.

Syntax (Java -> C#)

One of the initial barriers (although not the biggest) is the language syntax. Android is based on Java and Windows Phone 7 mainly relies on C# (although VB.NET and F# are also available) - both languages carry pretty much the same syntactic weight - similar data types and similar ways to handle objects, therefore you won't spend much time trying to figure out how to end a statement or link an object to a method. Believe it or not, this point alone saves you hours if not a couple of days worth of work to get yourself used to a new environment. Of course, the frameworks at their core are different - you will be working with many completely different classes and methods (besides, sometimes the hungarian notation from Java migth seem unusual in C# where camel case is used for default naming).

XML for UI

Android allows developers to build the UI in a declarative manner via XML. The visual designer in Eclipse will reflect the changes in the linked XML file, but you won't be able to directly manipulate objects on the screen. At least not to the extent you can do that in Visual Studio or Expression Blend. When developing Silverlight-based applications for Windows Phone 7, you will also use an XML-based structure to edit the UI - XAML (eXtensible Application Markup Language). In my opinion, XAML in a Silverlight project is easier to maintain because you don't have the constant linking to R.java that can mess up proper internal references. It is also easier to implement control styles and property binding (especially to collections).

Easier access to some controls

I already mentioned that general data binding and templating is easier. Add to that the fact that it is easier to manage control behavior via event handlers and it takes less hassle to set complex controls and control groups up. A good example here would be the map control. In an Android application, to set a pin or to execute a zoom a developer has to instantiate a MapController and manage the map itself via overlays. On Windows Phone 7, you are solely working with the control without additional linked instances.

Easier configuration

Since Windows Phone 7 is a single OS version for now you don't have to deal with custom (read: updated) builds, therefore the overall environment configuration is a bit easier. There is a single emulator that has a pre-defined set of features and capabilities (can only be edited to some limited extent) so you don't have to worry about your application getting in some issues because you didn't expect a specific device behavior. Also, it is a bit easier to manage internal package references since you don't have to directly deal with the AndroidManifest.xml file to reference libraries.

IntelliSense

This point is very subjective, but the performance of the suggestion engine in Eclipse is pretty poor compared to Visual Studio. IntelliSense can speed up development a lot and sometimes it's easier to start typing a class name and simply accept what's suggested. To this moment, Eclipse doesn't suggest class names (however, it looks at associated methods and properties) unless those are referenced directly from a namespace. At the end of the day, it doesn't really matter to me as long as I know what class I want, but it's a nice bonus to have.

These are just some of the points and I will try to update this list as I am working more with both platforms.

Comments

Naiden Gochev replied on Mon, 2011/01/31 - 11:00am

The OS is a crap and noone will use it. it is like a total joke that I can do the same UI and features by myself as android shell for a month. So why should anyone will do ANY software for OS which NO ONE uses ? And even if we can say that there are bilions of users ( which are missing still ) C# is overcomplicated crap with so match junk left from old versions that no one uses that a java guy will find C# ... a lot like C++ but in different way.

Den D. replied on Mon, 2011/01/31 - 12:37pm

That's a biased opinion. My question is - did you hold an actual device in your hand? Did you develop anything for Windows Phone 7? If the answer to at least one of these question is no then your reply has zero value. A typical stereotype of "FOSS-supporters" is that Windows and everything Microsoft-like is evil. The thing is - I never see any decent arguments from most of those people.

If C# is over-complicated, then I guess software development is not something you should be doing. Otherwise, you would know that C# and Java have so much in common that some people don't need to pick up a different book to learn the basics about either of these languages.

Please come back with actual facts and not vague statements the next time you post.

Naiden Gochev replied on Tue, 2011/02/01 - 2:55am

I dont have a windows phone 7 but yes I've tried Expression Blend and Visual Studio for Windows Phone 7 development it looks nice it looks easy if you want to make a moving ball it is great but if you want to do something else which has nothing to do with animations and graphics only.... ahhhhh not simple case.
Let me explain Google have a lot of nice great components which are integrated with there services like MapView for google maps a great nice browser view a easy way to record audio and play audio. On other hand Microsoft have .. "bing" or windows live search which noone uses and the map is also not so familiar so let me say I want to make a simple application which triggers your gps location, parses XML with bus stops in the city you are calculates and triggers a search algorithm for the route how you can go from X to Y using N-busses displays the routing on your map,also I want to handles walking and buses this is not provided by google API but you can make it vry easy... can you really make it with windows phone ? and if you can really who will do it .. it will take hell of a time and Expression Blend with its moving balls will not help. This application using Android took 3-4 hours ( http://market.android.com/publish/images/PQAAAK4cEjbzEqqLITFcnHcg-W4jhcsL5vT417yUv6wyQFtU4nSIc843HI279eCbeRpeuxN6Kv8WabTiW6U_BOmlSE8AzfqVaecNjMNtaYZnePs4AWRye_ndAjvR.png ) . Visual Studio and C# great features will also not help you a lot (maybe only for the xml parsing) so the question here is SERVICES and google have the best SERVICES integrated on Android phones this is the missing bit for Windows Phone also features it is stupid to make a chat application for windows phone and to display links as links because when you click them a browser will be opened and because there is no multitasking your chat will stop.. so even total lame applications are not doable in windows phone because they just dont work as they should because the platform is crap.
So even with "better" language as C# ( I dont think it is better )
-Even with better tolls as visual studio ( I beleive eclipse is better but yes it is laggy )
-Even with great authoring tools like Expression Blends ( yes I agree IT IS GREAT better then --everything from adobe and from anyone else )


Even with easier configuration and XML UI ( it is like that everywhere)
the things that metters are:
-Users (how many potential users do we have)
-Platform(how good and open is the platform what it supports Andriod wins here with a lot even vs iOS)
-Services ( android windows here again even against IOS)


P.S. yes I am a C# hater but I know why I hate it :) and I have many many reasons. Its nothing to do with Microsoft I LOVEE microsoft and I LOOVEEE WINDOWS the best platform for games :D

Den D. replied on Tue, 2011/02/01 - 8:54pm

I can see that you didn't actually develop anything for Windows Phone 7 because the actual development process goes far beyond graphics - business applications, social network clients and what not (for a complete list, please visit this page). What you're talking about GPS is easily accomplished on Windows Phone 7 with the Map control (yes, the map is provided by Bing). In fact, I honestly see no difference in the type of the map I am using - I used both the Android MapVieew and Microsoft Bing Map control. Both work fine for my needs and I never ran into issues with those.

It's one thing when you develop for one platform and it's another thing when you try to claim that one of them is inferior but you never did work in-depth with it. I see no problem integrating complex services on Windows Phone 7 and you already see from my example above (social networks) that many of those work great on the new platform.

Now to clarify - what chat application are you talking about?

I really don't understand your antipathy towards C#. If syntax is such a big deal, take a look here and let me know what you think about the differences.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.