|
||||||||||||||||||||||||||||||||||||||||
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 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 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. Another important area where the two platforms differ is navigation. In Android you switch from one task to another by creating an Intent. The equivalent within Windows Phone 7 is Navigation, which allows you to move between Pages. Similar to an Android Intent, you can pass data to the Page to which you are navigating. A Page within Windows Phone 7 has some properties similar to an ASP.net Page as you actually use a QueryString that allows you to pass information to the next Page. Converting Layouts to Pages A Windows Phone 7 Page provides similar layout capabilities and controls to Android Layout. The following table illustrates the layout options available and the Android Equivalent.
As you can see, the Windows Phone 7 provides essentially the same types of layout capabilities. The following table shows the list of basic controls and the Android Equivalent.
You should notice that Windows Phone 7 does have a 1-1 match for the Basic Controls and the Layout types. Some of the specialized layouts and controls appear not to exist. The reason for this lies within the power of XAML, which provides the ability to very easily embed controls one within another. It is possible, for example, to add a ListBox with CheckBoxes next to each item without the need to write any code. This means that you do not need all of the complex built-in controls; those can be created and customized within your app.
|
||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||
Mobile Code Samples
22 new code samples cover nearly all the new features for Windows Phone 7.5 (Mango) including the most requested and hotly anticipated areas - camera, media, sockets, sensors, SL/XNA integration, Tile backgrounds and background agents.Click here to download

-
WP 7.5 Overview for Developers
On Demand


This young developer was inspired by his big brother. Find out how he learned to program and why you wont be seeing skydiving Sasquatches anytime soon...
Read More








