Home windows Mobile application enhancement

Home windows Mobile application enhancement

Mobile and compact units turn out to be a lot more and a lot more preferred in our society. Each and every of us faces with them just about every day. Undoubtedly each individual of us has cellular cellular phone, hand-held pcs or other hello-tech units.

All of these units have distinct cellular platforms. There are this kind of acknowledged platforms as Home windows MobileM, Apple iphone, BlackBerry, Symbian OS, Android, Maemo, OpenMoko and many others. All of them have distinct record and strengths and failings.


These types of platforms as Home windows Mobile, BlackBerry, Apple iphone are «closed» adequate and minimal by either their personal units (BlackBerry, Apple iphone) or enhancement complexity. Between other difficulties of over mentioned platforms there is minimal API. Even Java platform for cellular units has some failings this kind of as wonderful variety of limits very distinct APIs gadget dependent code. Symbian and Home windows Mobile platforms are greater from this place as significantly as they help wider range of units and their APIs give a lot more possibilities.

Frequent problem listed here is also that there are a whole lot of platforms. Talking about OpenSource and Cross-Platform answers we ought to say that they are still establishing at the moment and are not common still.

In this post we’ll pay our interest to the Home windows Mobile platform.

Microsoft Organization released its initially platform for inbuilt units at the stop of the ninetieth. In 2002 Home windows CE.Web platform appeared. And at that time Pocket Laptop based mostly on Home windows CE 3. platform and better have been released. Further enhancement of wireless interaction technologies managed to blend telephone and own computer. Hence Pocket Laptop 2002 Cell phone Version appeared which supported the requirements of GSM, GPRS, Bluetooth and wireless HS community entry. In the similar time a further gadget idea was establishing that was a lot very similar to the over mentioned but was closer to the telephone then to own computer. This gadget was named SmartPhone 2002. Elementary big difference involving Smartphone and Pocket Laptop is that Pocket Laptop has contact screen whilst Smartphone has only management buttons. They also experienced distinct application scopes and supported distinct requirements and technologies.

Home windows Mobile platform a lot more belongs to smartphones, communicators and tiny own units. Home windows CE and Home windows Embedded platforms are normally employed in distinct industrial tools.

Now we have Home windows Mobile five and Home windows Mobile 6 generations and Home windows Mobile seven will be released shortly. Modern units based mostly on Home windows Mobile Pocket Laptop have five hundred-600 MHz processors and 64-128 MB RAM that is not little for this kind of units.

one. Growth Instruments

There are a number of types of enhancement of programs for Home windows Mobile:

  • Win32 API
  • MFC
  • .Web Compact Framework.

Microsoft Co offers developers all important tools for enhancement of programs for PDA, Pocket Laptop and Smartphone.

In this article are some advices about distinct code sort deciding on.

  • Use Indigenous Code for attaining the burst general performance, immediate operate with hardware, and also for minimization of process useful resource necessities.
  • Use Managed Code for enhancement of GUI-oriented programs which key necessities are enhancement and sector deployment conditions. Managed Code is also excellent for the effortless operate with internet-companies.
  • Use Server-Facet Code for operate with distinct units as a result of a single code base, and also if wide steady interaction channel with a gadget is present.

Under are the critiques of present enhancement tools for PDAs, Pocket PCs and Smartphones.

eMbedded Visible C++ four.

Microsoft eMbedded Visible C++ four. enhancement ecosystem is intended to produce programs for units with Home windows CE .Web four.two operating process and also (with deal of updates SP3) for PDA and Smartphones on the Home windows Mobile 2003 Second Version platform. The enhancement ecosystem eMbedded Visible C++ four. is excellent for generation of native code for cellular and inbuilt units with Home windows CE .Web four.two OS. It makes it possible for developer to accomplish Just-In-Time Debugging for diagnostics of unhandled exceptions, Attach-to the approach for the extended debugging of procedures, and also conversation with an emulator.

Visible Studio .Web and SDP functions

SDP (Good Unit Programming) functions of the integrated ecosystem of enhancement Visible Studio .Web 2003 (2005, 2008) allow for to produce programs, that works by using opportunities of Microsoft .Web Compact Framework platform. Hence a developer can produce the dispersed cellular facts-processing methods, workings both equally in eventualities with relationship and with no long lasting relationship. Huge course library of .Web Compact Framework platform can make application enhancement a lot more rapidly than with standard enhancement tools.

Visible Studio .Web allows produce programs for the Pocket Laptop 2002 units and (with suitable SDKs) Pocket Laptop 2003, 2005 and Smartphone 2003, 2005, applying the similar tools as those people employed for the enhancement of programs for desktop PCs. Library .Web Compact Framework is installed jointly with Visible Studio .Web. This library is specially developed for units with the minimal assets. Developers can also use new languages C# and Visible Standard .Web for programs for cellular and inbuilt units. They are excellent in workings with internet-companies and ADO.Web technologies.

Handle features of ASP .Web Mobile Controls extend SDP functions and .Web Compact Framework platform. They give options to use opportunities of .Web Compact Framework and Visible Studio .Web for enhancement of cellular internet-programs because of to the facts supply to numerous cellular units by usually means of ASP.Web technology. This tactic makes it possible for to produce single cellular internet-application in the Visible Studio .Web ecosystem, that will immediately accomplish facts rendering for displaying on numerous units: cellular phones, smartphones, PDA, Pocket Laptop. The integrated enhancement ecosystem can make it doable to produce cellular internet-programs just by dragging management features on kinds.

ASP.Web Technique sets no elements on a customer gadget. For adaptation of formatting below concrete browsers server logic is employed. It generates information in the formats of Wireless Markup Language (WML), HTML, and Compact HTML (cHTML).

Microsoft SQL Server

Microsoft SQL Server Compact Version (SQL Server CE) is a compact DBMS for quick enhancement of programs that extend opportunities of operate with company facts because of to the cellular units making use of. SQL Server CE is a software facilitating enhancement of cellular programs because of to help of SQL syntax and use of application and API interface design that is suitable with SQL Server.

SQL Server CE presents the standard established of relational database functions, in unique optimized question handler help of transactions and heterogeneous forms of facts – with unpretentious necessities to the process assets. Distant entry to the facts and replication by confluence provide reputable supply of information from the SQL Server bases, chance of autonomous operate with by information and subsequent synchronization with the server. SQL Server CE is excellent for the methods with cellular units and wireless networks.

SQL Server CE DBMS is developed for integration with .Web Compact Framework by usually means of Visible Studio .Web. It simplifies enhancement of programs for operate with databases on cellular and built units. New facts supplier of SQL Server CE for code administration in the Frequent Language Runtime ecosystem assists to produce distensible programs with opportunities of autonomous operate with information in eventualities with no long lasting relationship.

Microsoft .Web SqlClient offers API for operate of both equally .Web Framework and .Web Compact Framework programs. For the frequent Home windows methods SqlClient Microsoft with SQL Server are employed, and SqlServerCe for Microsoft SQL Server Compact Version databases for Compact Framework.

Identify space of SqlClient is in both equally variations. So we can interact:

  • Using .Web Compact Framework SqlClient to have an entry to SQL Server from gadget on Desktop.
  • Using .Web Compact Framework SqlServerCe to have an entry to SQL Server Compact Version specifically on a gadget.

Get the job done with databases on a gadget is very similar to the operate on Desktop. To entry to SQLServer on Desktop process SQL works by using TCP/IP relationship hence in this circumstance it is doable not to have SQL Server Compact Version installed on a gadget.

All of the mentioned types are executed on the desktop methods. So the encounter of their application can be carried for enhancement of the courses for Home windows Mobile. Using Win32 API we fast get compact code, and also can use it for enhancement of drivers and process component.  Using MFC we have extensions of API functions, and also designer for enhancement of interface. And making use of Compact Framework we have at our disposal perfectly developed interface, computerized rubbish assortment, help of XML and other possibilities. Also there is even a lot more truncated edition — Micro Framework, exactly where there are significantly less SDK functions.

Soon after SDK for MS Visible Studio set up new configurations of assembling look as perfectly as new functions for assembling below these platforms. Go well with also is made up of Emularor for computer software enhancement and testing with no actual physical relationship involving gadget and computer.

As significantly as numerous units that are based mostly on Home windows Mobile have ARM processor it is also doable to compile models making use of other compilers: AVR32, ARM (RealView), GNUARM, IAR Techniques.

two. Setting up Home windows Mobile Programs for Home windows Mobile units making use of MS Visible Studio .Web

Visible Studio enhancement ecosystem jointly with Compact Framework allow to produce programs making use of a wide graphic interface, databases, archiving and encrypting tools,  USB, Serial, Bluetooth, and also wireless community connections and telephony. All of these is delivered by SDK as perfectly as libraries and heading documents from Platform Builder.

two.one Consumer Interface

Because of to the existence of excellent designer in VS and SDK we can quickly produce GUI for cellular programs just the similar as for Desktop programs. The only big difference is in sets of  graphic elements for Desktop methods and for Home windows Mobile. There is also big difference involving elements of Smartphone and Pocket Laptop variations prompted by that Pocket Laptop has a contact screen and SmartPhone has not. For that reason enhancement of interface for SmartPhone is a lot more sophisticated. One ought to choose it into account when establishing computer software for both equally platforms.

In this article we ought to also point out that computer software built for Pocket Laptop won’t begin on the SmartPhone platform whilst the opposite problem is doable – till the moment when some specific Smartphone function is known as.

It is obviously that numerous graphic elements as perfectly as bulk of functions from entire-dimensions Framework have been taken away from Home windows Mobile SDK to cut down the dimensions of the SDK on the gadget side. Only the most needful features have been remaining. But the productivity and volumes of memory are raising so the variety of function bundled in SDK will become bigger. So the big difference involving Compact Framework one. and two. is massive. Variation one. was very minimal.

In common the enhancement of GUI with ?ompact Framework on ?# is very similar to the enhancement of the frequent Win32 application on C#.

It is also doable to produce a graphic interface making use of assembling of the 3D rendering-engines. They are this kind of as GAPI (Recreation API), OPENGL ES (Embedded Technique), OPENVG (Vector Graphics), and other assignments. Undoubtedly it is rather labor intense approach as significantly as it is very important to compose an optimal code since of the reasonably small  productivity of cellular units.

two.two Communications

To date cellular units have a wide range of communicational possibilities. They have an entry to the wireless substantial-velocity community making use of 802.11 WiFi Relationship normal. They also use IrDa, Bluetooth, and USB host/customer features. Whilst the use of Irda is slowly obtaining significantly less protocols and requirements of Bluetooth, WiFi, Edge, GSM, and also USB are employed stop frequently.

Microsoft Organization presents this kind of APIs:

  • ActiveSync API presents features for operate with companies of synchronization, file filters, and many others.
  • Bluetooth API presents features for wireless entry to cellular and peripheral units.
  • Relationship Supervisor API serves for the automation of relationship approach, community relationship administration. Products are making use of Relationship Supervisor to establish relationship and also to notify about the meant relationship (for illustration Internet).
  • Object Trade (OBEX) API presents features for operate with powerful, compact binary protocol just appropriate for units with the minimal opportunities.
  • Distant API (RAPI) presents functions for administration and remote get in touch with of approaches on the gadget side. These types of functions are obtainable: entry to the sign-up, documents, databases and distinct configurations of gadget from the Desktop-process. The most important alternative is Distant Treatment Get in touch with when we just get in touch with the system «CeRapiInvoke()» on the Desktop side, transmit the title of DLL on the gadget side and the title of function in this DLL and then just get in touch with this system.
  • Pocket Outlook Object Model API presents functions for operate with the objects of Pocket Outlook. It presents interfaces for synchronization and entry to the objects: Undertaking, Calendar, Contacts.
  • Telephony API (TAPI) contains:
    • Assisted API
    • Extended API
    • Cell phone API
    • SIM Supervisor API
    • Shorter Messages Provider (SMS) API
    • Telephony Provider Service provider (TSP) API
    • Wireless Application Protocol (WAP)  API.

Also cellular units have chance to operate with Serial (USB) ports. There are a number of COM-ports in numerous units. Ordinarily the initially 3-five of them are reserved for IrDa, Bluetooth, SerialPort and other people. Other ports are obtainable to for user. Some units have USB-Host features in other words they are USB On-The-Go (OTG) units which can serve both equally as USB Client and USB Host. For this reason gadget ought to have important Components and Software program (Unit Driver).

Unit Driver is a driver which is an intermediate layer involving the driver of HOST and  stage of programs. These types of driver presents «Stream Interface Driver» and will have to consist of this kind of functions as:

  • XXX_Init
  • XXX_Open up
  • XXX_Shut
  • XXX_Compose
  • XXX_Read
  • XXX_IOControl

In this article “XXX” is changed with «prefix» (for illustration «COM», «DSK»).

This prefix registers in the registry when a driver registers in the process. More specific information about Unit Driver Interface can be obtained from MSDN.

Also a developer can use this kind of APIs not relating to communicational types:

  • Unit Configuration API
  • File and Application Administration API
  • Recreation API
  • Household Monitor API
  • HTML Handle API
  • Shell API
  • Speech Recognizer API
  • Vibrate API
  • Voice Recorder Handle API.

two.3 P/Invoke and Indigenous Interop

As significantly as Compact Framework is made up of standard functions and approaches from finish

Framework we have this kind of features as:

  • XML Serialization
  • Cryptography
  • Safety
  • Reflection
  • Interop Providers et al.

Undoubtedly Platform Invoke phone calls are obtainable. For this reason – as perfectly as in finish Framework – we use functions and characteristics from namespace Technique.Runtime.InteropServices and DllImport attribute for description of functions which will be known as from non-managed code.

Nonetheless the features of these approaches is minimal. So Marshal course has PtrToStructure, GetComInterfaceForObject, Duplicate() and Read() functions but, for illustration, there is no this kind of function as GetDelegateForFunctionPointer() in it. So it is extremely hard to make Marshaling just with Delegate. The GetFunctionPointerForDelegate function is obtainable only. If we want to transmit a pointer to the function from Managed code we ought to get its FunctionPointer and only following that transmit it to the unmanaged code for subsequent get in touch with of it from there. Also we can not transmit some objects since Compact Framework can not count SizeOf() for some objects. For that reason frequently we have to transmit  facts of Blitable forms only and arrays of these forms (Int, byte, char, but not bool),  and transmit and receive  classes and constructions by usually means of IntPtr. Undoubtedly it is defined by aspiration to enhance the general performance. It is as a result recommended to use major forms for Marshaling and «GCHandle» course for storing an object in the approach memory and to make this memory «visible» for unmanaged code

Undoubtedly the general performance of P/Invoke phone calls from C# application in C++ DLL is almost twice significantly less than the general performance of system phone calls involving C++ DLLs. Nonetheless the general performance of units grows and it will become doable to use this kind of phone calls.

two.four Debugging

MS Visible Studio permits to make debugging of programs below

Home windows Mobile just the similar as for Desktop programs. We have Emulator, Unit Emulator Supervisor and other to features this kind of as Breakpoints, Threads, Watches panel and many others.

Nonetheless to make Debug making use of Indigenous and Managed code simultaneously is extremely hard. For that reason it is doable to begin either C++ assignments or Managed types. It’s also so for «Attach to process». There is a chance of attaching to the procedures on the gadget side (or emulator side). ActiveSync is required to provide interaction involving a gadget and the process, it is installed with SDK. An emulator also can be connected to the computer by usually means of ActiveSync. We receive almost finish emulation of Home windows Mobile units. In this article are both equally SmartPhone and Pocket Laptop (or Pocket Laptop Cell phone Version) emulators. Nonetheless only a person Home windows Mobile gadget can be connected to the computer at a person time moment. For that reason Debug on two units simultaneously which for illustration interact in some way is rather challenging. Undoubtedly we converse only about Debug of programs developed by us but not about programs and companies of the process. For this kind of debugging we want the finish built of the process developed by usually means of Platform Builder (in the very last variations of Platform Builder it’s bundled in Visible Studio). We can also produce our personal SDK for Visible Studio and Home windows CE platform.

An emulator also permits to emulate relationship with the GSM community and GPS help. It can make doable to take a look at and produce huge spectrum of programs with no owning a actual physical gadget in fingers.

Talking about Debug with IDA we ought to point out that edition five.one currently has the chance to accomplish Debug by usually means of this interactive disassembler with the use of their plugin which is installed on a gadget.

With SDK overall look this kind of alternative as «Deploy» appears in Visible Studio ecosystem. Now there is «Deploy» product in venture context menu additionally to “Build”, “Clean”, “Debug”. Soon after you select this product DLL or EXE file built by present configuration is transmitted to the gadget. Also new column appears in Configuration Supervisor exactly where not only «Build» in some configuration alternative is obtainable but also «Deploy». Deployment of .Web assignments transmits not only the unit but also those people builds that are depended on it (Dependencies).

3. Deployment and set up

Growth of programs for Home windows Mobile supposes also their assembling and generation of set up deal. For this reason there is this kind of idea as ?abinet (.taxi) file in Home windows Mobile. It is a frequent archive but it is a set up deal also (a sort of MSI deal). It is assembled by usually means of Cab Wizard (cabwiz.exe) from MS VisualStudio (or from a command line). This utility makes processor dependent «.cab» file. WinCEApplicationManager transmits and commences Cab on a gadget, so user can install the application making use of instructions showing on gadget screen. It is also doable to produce the venture of MSI Installation which contains Cab file by usually means of Visible Studio. This built deal will be started off on user computer and then transmit ?AB set up on a gadget to continue on set up approach.

There is specific Uninstall Supervisor on the gadget side. One ought to connect configuration INI-file to Cab file. This INI file contains settings to manage set up approach this kind of as path, shortcut title to produce, minimal OS edition to install the application and other people published in specific syntax. It is also doable to include things like your personal DLL into Cab-file to widen set up possibilities. This DLL is made up of this kind of functions as «Installer_AfterInstall», «Installer_BeforeInstall», «Installer_AfterUnInstall», «Installer_BeforeUnInstall», code in these functions will be executed on the gadget side in the certain times of set up or uninstallation approach.

When establishing Cab set up it is doable to connect documents, distinct assets, built models, increase information to the registry. They are designated as «Project Output. That’s why there is no want to reset something following Cab-file generation: it will gather all bundled assignments and documents and assemble in an archive.

four. Safety Model for Home windows Mobile five and Home windows Mobile 6

Products based mostly on Home windows Mobile obtain, ship and examine probably important information which ought to be protected from unsafe programs. To shield gadget the setting up of unidentified programs is disabled, the entry to some API is restricted and some registry parts transforming is forbidden. Units can be marked as Trustworthy and Untrusted and process works by using this information to prevent setting up of unauthorized programs and limit their entry to the process. Also the entry to the process by usually means of RAPI (Distant API) as a result of ActiveSync can be restricted. Safety Certificates Safety Legal rights are employed for the executable models (EXE, DLL) and for Cab-documents.

Safety Versus Threats and Hazards

The followings possibilities assist to shield units:

  • Rigid password protection.
  • PIN code protection.
  • Products corrupt deleted information to prevent entry to it (WM 6).
  • Products corrupt deleted information on memory playing cards to prevent entry to it (WM 6).
  • Storages encryption and State-of-the-art Encryption Common for SSL (WM 6).
  • Possess certificates use.
  • Detecting a gadget via Bluetooth can be protected (WM 6 Smartphone).
  • two layer process of application setting up (One-tier and Two-tier entry).
  • No help of macros, as a result viruses can make a lot hurt.

The begin of programs is based mostly on Permissions. Home windows Mobile units use this kind of types:

  • Privileged
  • Usual
  • Blocked

Privileged programs have the widest entry. They can entry any API, compose in the protected parts of registry and have the finish entry to the process.

Most programs have Usual design. They do not have entry to the trustworthy API and do not have the finish management of the process.

Application can not be started off at all if it has “Blocked” position. It usually means that it’s not signed with the suitable certification or user forbade the begin by the suitable warning of the process.

Analogical problem is with Cab-documents. The executable models with Usual position can begin Privileged DLL but then they will operate as Usual. Nonetheless Privileged executable models can not begin the models owning Usual position.

Prepared by Eugene Kordin, Apriorit specialist.

Study a lot more about enhancement approach of Apriorit listed here.

Comments are closed.