This is a mirror of official site: http://jasper-net.blogspot.com/

Windows Phone 7 Development for Android Developers

| Tuesday, February 15, 2011
Much like mobile applications for the Android platform, Microsoft® Windows® Phone 7 (WP7) applications are written in a managed language—Java for Android and C# for Windows Phone 7—with accompanying libraries. Many of the differences between Java and Visual C#® are style related. The two modern languages share a common ancestry with the C/C++ languages and bear a strong resemblance to one another.

There are certainly differences between the .NET®/Windows Phone 7 and Java/Android APIs, but since the languages are similar you should be able to save much of the logic you have built in your existing application when porting your current apps over to Windows Phone 7. In fact you'll find it extremely easy to get started, as shown in the article, Windows Phone 7 for Java Developers.

Platform Differences
Before digging into the specific tools and processes for converting and/or creating applications for Windows Phone 7, let's begin with the terminology and technological differences between Windows Phone 7 and Android. The first big difference for Windows Phone 7 is that applications are created as managed .NET assemblies written in C#. The platform supports two types of applications—Silverlight® and XNA® games.

Most applications for Windows Phone 7 will be created in Silverlight, which provides typical form-based user interaction through common controls, such as Labels, Text Boxes, Lists, etc. The Android Layout and accompanying Activity is known as a Page in Silverlight.

The other type of application supported on Windows Phone 7 is XNA, which allows developers to create both 2D and 3D games. This is the equivalent of an Android SurfaceView and GLSurfaceView for 2D and 3D respectively. Unlike Android, which targets OpenGL for games, XNA games target Direct3D, which makes it easier to port PC and Xbox 360 games over to the phone.

Pages and Navigation
Silverlight Pages are created in XML files, similar to Android Layouts. The XML defining a Page is created in XAML (eXtensible Application Markup Language). XAML is similar to an Android Layout, but it allows for a wider range of features. XAML allows the developer to perform operations within the Page including Animations, Data Binding and more, eliminating the need for coding these functions.

The Android Layout is decoupled from the Activity used to perform the operation. As a result, you need to hand write the code needed to attach it to the user interface (UI) elements within the appropriate Activity. The C# code for a given Page is tied to the Page and is simply known as the code behind, so there is no need to hand write the UI attachment code. The platform automatically creates the necessary "wiring" for the objects and events for the Page and UI. This prevents the clutter typically occurring in the Task onCreate method where you attach to the UI and the various necessary handlers are created.

Read more: internet.com

Posted via email from Jasper-net

0 comments: