Comparison between Windows Mobile and ophone

Source: Internet
Author: User
ArticleDirectory
    • Development tools Visual Studio and eclipse
    • Interface style comparison
    • Comparison of system core objects
    • Summary:
Comparison of Windows Mobile and ophone categories from a developer's perspective: Hot report recommender: keyan | 14 comments

Windows Mobile has gone through the first wince series, pockect PC and smartphone versions, to Microsoft's latest Windows Mobile 6.5, with its good compatibility with the desktop platform, Windows Mobile has made constant efforts in the mobile field by Microsoft, and has occupied nearly 15% of the market share in the smartphone operating system. Microsoft's. NET Compact framework for Windows Mobile has become the first choice for Microsoft platform development. Microsoft's previous. NET strategy has been implemented in mobile development in a certain sense.

As a mobile operating system based on the android open-source platform, ophone follows the development features and environment of Android, while Java is the preferred development language. What is more interesting is that Microsoft's. the biggest competitor of the net strategy in enterprise-level development is J2EE. in mobile operating systems, apart from Nokia's Symbian's high mobile phone shares in mobile operating systems, windows moible and Android are two operating systems that are expected to be three different parts of Symbian in the future. net (C #) war will continue to burn to the mobile platform.

Windows Mobile and ophone

Here we will compare the issues that the two platforms are concerned with in terms of development, rather than drawing a conclusion on who is superior or inferior, instead, developers of one platform can be familiar with the problems related to the other platform.

Development tools Visual Studio and eclipse

Windows Mobile's mainstream development tools must be Visual Studio, and Android is eclipse. Both are well-known integrated development environments and represent two different camps:. NET and Java. Based on the author's experience in mobile development, we will compare them from the following aspects.

The cost and setup of the development environment, of course, Windows Mobile can only be developed on the Windows platform, no matter whether you use pirated or genuine, XP is required, and then install vsts (ikel studio team suite ), this is usually tens of thousands. Of course you can also use the 180-day trial version and reload the system in half a year. This is also cost-effective, after installation, download the latest Windows Mobile SDK from the Microsoft official website. You 'd better install another emulator image of the Chinese version so that the windows mobile environment can be basically set up. In contrast, ophone is free of charge. You can choose windows or Linux as the operating system. Ubuntu is recommended here. Install JDK, download eclipse on the relevant platform, install ADT, and download ophone SDK from Sdn. Refer to the startup document provided by ophone.

MoveCodeVisual Studio 2008 + ActiveSync is much easier to use than eclipse + ADB, regardless of whether it is a simulator or a real device. Microsoft has excellent visual usability in the debugger, google developed the ADT plugin for eclipse. On the one hand, it may be the limitation of eclipse. On the other hand, Android development is just getting started, and there should be a lot of room for improvement in integration development debugging. In addition, the synchronization tool ActiveSync is not just a developed auxiliary software, but a real synchronization tool that automatically detects ports, sets virtual IP addresses, and synchronizes computer data, in this way, as long as the mobile phone is connected to the computer, the ActiveSync circle turns green, you can directly deploy the software on the mobile phone for debugging, and Android needs to do the above manually, which is not convenient.

Compared with simulation devices (simulators), the startup speed and performance are similar. Windows Mobile distinguishes smartphone and pocketpc, while android can set the skin parameter of emulator, different skin and models of simulators can be obtained. Compared with Microsoft's attempt to release a new version of simulator, the diversity of simulators in the Open Source alliance of Android will certainly be richer.

GUI development starts with a helloworld

1: Let's talk about Android first. When we create a new Android project using the wizard, we can see the following files in package browsing.

The files to be edited are distributed under SRC and res, including helloworld. Java and Main. XML, strings. xml.
This helloworld inherits from activity (the most important class in the android framework. We simply consider it as a UI container and directly deal with the front-end class of the user. For Windows MobileProgramActivity + view = form.

There is another R. java. This class is automatically generated by the system based on the content in the res folder. Do not modify it. let's talk about the res folder first. In this regard, WM and anroid are very similar. Res is short for resources. As the name suggests, the text and images you need in your program are as follows, layout files and other resources are placed under this folder. Now you can see that there are
Drawable-this is for storing images.
Layout-this is the layout file.
Values-string (strings. XML), color (colors. XML), array (arrays. XML)

Android helps us manage all these resources, and the role of content reclamation is obvious, making it easier to internationalize, when using the same resource, it is also convenient and saves space (Global Reference), the content in the res folder changes, R. java will re-compile and synchronize updates, so you do not need to manually update this class.

Finally, androidmanifest. xml. Every time you add an acivity, you must describe it in this file.

Take a look at the Code:

View plaincopy to clipboardprint?

  • Public class hellowolrd extends activity {
  • /** Called when the activity is first created .*/
  • @ Override
  • Public void oncreate (bundle savedinstancestate ){
  • Super. oncreate (savedinstancestate );
  • // Specify the interface layout of the activity. If this parameter is not specified, the page is left blank by default.
  • Setcontentview (R. layout. Main );
  • // This statement is used to obtain the interface control object set in layout. This ID is specified in the button
  • Android: Id = "@ + ID/button_normal"
  • Button BTN = (button) This. findviewbyid (R. Id. button_normal );
  • // Add a response function for BTN
  • BTN. setonclicklistener (New onclicklistener (){
  • Public void onclick (view arg0 ){
  • Textview TV = (textview) This. findeviewbyid (R. Id. Text );
  • TV. settext (R. Id. Hello );
  • }
  • }
  • );
  • }
  • }
  • Layout file mani. xml
  • <? XML version = "1.0" encoding = "UTF-8"?>
  • <Linearlayout xmlns: Android = "http://schemas.android.com/apk/res/android"
  • Android: Orientation = "vertical"
  • Android: layout_width = "fill_parent"
  • Android: layout_height = "fill_parent"
  • >
  • <Textview Android: Id = "@ + ID/text"
  • Android: layout_width = "fill_parent"
  • Android: layout_height = "wrap_content"
  • Android: text = "@ string/hello"
  • />
  • <Button Android: Id = "@ + ID/button_normal"
  • Android: text = "@ string/clickme"
  • Android: layout_width = "wrap_content"
  • Android: layout_height = "wrap_content"/>
  • </Linearlayout>
     
    Public class hellowolrd extends activity {
     
    /** Called when the activity is first created .*/
     
    @ Override public void oncreate (bundle savedinstancestate)
     
    {Super. oncreate (savedinstancestate );
     
    // Specify the interface layout of the activity. If this parameter is not specified, the page is left blank by default.
     
    Setcontentview (R. layout. Main );
     
    // This statement is used to obtain the interface control object set in layout. This ID is specified in the button
     
    Android: Id = "@ + ID/button_normal"
     
    Button BTN = (button) This. findviewbyid (R. Id. button_normal );
     
    // Add a response function for BTN
    BTN. setonclicklistener (New onclicklistener ()
     
    {
     
    Public void onclick (view arg0 ){
     
    Textview TV = (textview) This. findeviewbyid (R. Id. Text );
     
    TV. settext (R. Id. Hello );
     
    }});
     
    }
     
    }
     
    Layout file mani. xml
     
    <? XML version = "1.0" encoding = "UTF-8"?>
     
    <Linearlayout
     
    Xmlns: Android = "http://schemas.android.com/apk/res/android"
     
    Android: Orientation = "vertical"
     
    Android: layout_width = "fill_parent"
     
    Android: layout_height = "fill_parent">
     
    <Textview
     
    Android: Id = "@ + ID/text"
     
    Android: layout_width = "fill_parent"
     
    Android: layout_height = "wrap_content"
    Android: text = "@ string/hello"
     
    />
     
    <Button Android: Id = "@ + ID/button_normal"
     
    Android: text = "@ string/clickme"
     
    Android: layout_width = "wrap_content"
     
    Android: layout_height = "wrap_content"/>
     
    </Linearlayout>
     
    </PRE>
     
    2: Let's take a look at Windows Mobile.
     
    Create a device application project
     
    "Hello World", such

    :

    An editable design interface is displayed on the left of the screen. To design the helloworld interface, you only need to drag a button and a lable from the toolbox. Compared with Android, Microsoft's powerful integration tools make visual interfaces very simple and WYSIWYG.

    Add a response function for the button, double-click the button, and run the following code in the click event:

    View plain
    Copy to clipboard
    Print
    ?
    This. label1.text = "Hello World ";

    This. label1.text = "Hello World ";

    Click F5 to run it directly.

    Conclusion: In the hellowolrd example with the same function, Android needs to modify three files and write 18 lines of code. In Windows Mobile, you only need to drag and drop the files and write a line of code. Undoubtedly, Windows Mobile is much faster in GUI development.

    Interface style comparison

    Windows Mobile has reached the latest version 6.5, and the interface has finally changed a lot. Remember that, starting from 6.1, the basic controls have been enhanced in rendering and rendering, however, it is difficult to develop a beautiful enough interface, just like pointui, because most interfaces must be drawn by GDI, the number of basic controls provided by Microsoft is very limited, including the famous opennetcf library, which is basically not supported by styles. Therefore, custom controls become the only way to get rid of mediocre UIS.

    Here we also want to tell you about the behavior of Microsoft's zookeeper: if we want to slightly expand the button control, add a little bit of our own stuff. The result is very troublesome. The reason is: Microsoft does not use graphics Functions in GDI to draw these basic controls. In fact, Ms still uses the old method, just like the old c ++ program. net. The only way to do this is to capture winproc messages, which is unpleasant. Why does Microsoft do this? It is to prevent us from infringing the appearance patents of others.

    In contrast, Android not only provides classic controls with rich style functions, but also allows flexible expansion of basic controls. Let alone anything else, let's talk about the pop-up dialog box. If I want to add a progress bar in this dialog box ,:

    This is a basic control of ophone. If it is implemented on Windows Mobile, MessageBox cannot be extended, so you can only write one from the beginning, it is difficult to create a semi-form with transparent background. Therefore, in Windows Mobile applications, third-party application UI experience is often uneven, and MFC, ATL,. netcomactframework, techniques mixed. The reason is that Microsoft used a PC to kidnap a mobile phone ,. NET platform is used directly after it is cropped. However, the UI and PC of the mobile platform are quite different. On the other hand, it is not open enough.

    Comparison of system core objects

    1: Form and activity, View

    If you have worked on Windows desktop programming, you will be familiar with form. form is the representation of any window displayed in the application. Even a dialog is also a derivation of form. Form is also a container that can accommodate other controls inherited from the control class.

    The form concept in Windows Mobile is consistent with that on the desktop. Any interface we see is a layout included in the form.

    In Android, activity is equivalent to controler in MVC mode. It interacts with users and processes these interactions. We can call setcontentview () to set the interface layout for the activity, this design of Android truly separates the interface design from the logic function design, and abstracts the view height. It also provides highly scalable interfaces and allows you to design a richer interface experience.

    2: special intent in Android

    Intent provides a mechanism for late binding between codes of different applications. It is mainly used to start activities and services. It provides communication methods between different activities and applications in applications, which can decouple modules of applications, it also makes applications interact with each other, which is hard to achieve in Windows Mobile. forms are usually dependent and highly coupled, an application needs to call a function of another application. Unless it references the class library opened by the latter, there is almost no good way to do this.

    3: contentprovider and ado.net

    The two are designed to be similar, both to abstract the data access layer. ado.net has a very important concept: DataSet. We can fill dataset with various data sources, in fact, dataset is essentially a database in memory with data tables that support SQL queries. It supports multiple data sources, such as SQL databases, XML files, and text files.

    In contrast, contentprovider provides us with greater flexibility. content provider is used to share data of various applications. content provider is a class that executes a set of standard methods, allow other applications to store and obtain the data processed by the content provider. if we compare ado.net and contentprovider, the data access module of ado.net is program-level, and it is difficult for other applications to share the data processing process of existing applications, 2. contentprovier locates the provider through a unique contenturi, and all applications can operate on the data source by constructing contentvalues.

    Summary:

    For developers, the architecture of Windows Mobile and Android is very different, but in terms of development languages and object-oriented aspects, it is not difficult to migrate between them as long as you are familiar with them.

    for mobile OS, unlike the desktop operating system, there will be a fierce knockout competition, whether it is a single master, a three-country separation, or integration of different degrees, is a question mark. In the future mobile world, the network must be an eternal topic. different operating systems are also integrated in this aspect. The Internet is constantly embedded into mobile platforms, such as mobile search and Widget technology, with all kinds of network services, we believe that the mobile world will become more and more exciting. for developers, mastering one more technology may be an opportunity.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.