Cellular and compact devices come to be extra and extra common in our culture. Every of us faces with them each and every working day. Undoubtedly every of us has mobile telephone, hand-held computer systems or other hello-tech devices.
All of these devices have unique mobile platforms. There are these recognized platforms as Windows MobileM, Apple iphone, BlackBerry, Symbian OS, Android, Maemo, OpenMoko and so forth. All of them have unique background and advantages and failings.
Introduction
These platforms as Windows Cellular, BlackBerry, Apple iphone are «closed» plenty of and minimal by both their very own devices (BlackBerry, Apple iphone) or progress complexity. Amongst other problems of previously mentioned talked about platforms there is minimal API. Even Java system for mobile devices has some failings these as terrific variety of limitations very unique APIs device dependent code. Symbian and Windows Cellular platforms are greater from this position as considerably as they support broader selection of devices and their APIs give extra options.
Widespread trouble listed here is also that there are a large amount of platforms. Chatting about OpenSource and Cross-Platform methods we should really say that they are still creating at the instant and are not common still.
In this write-up we’ll pay out our notice to the Windows Cellular system.
Microsoft Company introduced its to start with system for inbuilt devices at the conclude of the 90th. In 2002 Windows CE.Net system appeared. And at that time Pocket Pc primarily based on Windows CE 3. system and increased ended up introduced. Even more progress of wi-fi communication systems managed to incorporate phone and own computer system. Therefore Pocket Pc 2002 Mobile phone Edition appeared which supported the expectations of GSM, GPRS, Bluetooth and wi-fi HS community entry. In the similar time yet another device strategy was creating that was considerably similar to the previously mentioned talked about but was nearer to the phone then to own computer system. This device was named SmartPhone 2002. Basic change among Smartphone and Pocket Pc is that Pocket Pc has contact screen although Smartphone has only command buttons. They also experienced unique application scopes and supported unique expectations and systems.
Windows Cellular system extra belongs to smartphones, communicators and compact own devices. Windows CE and Windows Embedded platforms are commonly employed in unique industrial products.
Now we have Windows Cellular five and Windows Cellular 6 generations and Windows Cellular 7 will be introduced quickly. Present day devices primarily based on Windows Cellular Pocket Pc have 500-600 MHz processors and 64-128 MB RAM that is not minor for these devices.
1. Development Applications
There are a handful of models of progress of apps for Windows Cellular:
Win32 API
MFC
.Net Compact Framework.
Microsoft Co provides developers all required resources for progress of apps for PDA, Pocket Pc and Smartphone.
Below are some advices about unique code style picking out.
Use Native Code for acquiring the burst overall performance, immediate operate with hardware, and also for minimization of procedure useful resource requirements.
Use Managed Code for progress of GUI-oriented apps which principal requirements are progress and marketplace deployment conditions. Managed Code is also excellent for the simple operate with net-companies.
Use Server-Side Code for operate with unique devices by a single code base, and also if wide steady communication channel with a device is present.
Underneath are the opinions of present progress resources for PDAs, Pocket PCs and Smartphones.
eMbedded Visual C++ 4.
Microsoft eMbedded Visual C++ 4. progress environment is meant to build apps for devices with Windows CE .Net 4.two functioning procedure and also (with deal of updates SP3) for PDA and Smartphones on the Windows Cellular 2003 Next Edition system. The progress environment eMbedded Visual C++ 4. is excellent for generation of indigenous code for mobile and inbuilt devices with Windows CE .Net 4.two OS. It will allow developer to carry out Just-In-Time Debugging for diagnostics of unhandled exceptions, Connect-to the procedure for the prolonged debugging of procedures, and also interaction with an emulator.
Visual Studio .Net and SDP capabilities
SDP (Good Unit Programming) capabilities of the built-in environment of progress Visual Studio .Net 2003 (2005, 2008) allow to build apps, that works by using options of Microsoft .Net Compact Framework system. Therefore a developer can build the distributed mobile information-processing techniques, workings equally in situations with relationship and without having long lasting relationship. Broad class library of .Net Compact Framework system helps make application progress considerably faster than with standard progress resources.
Visual Studio .Net allows build apps for the Pocket Pc 2002 devices and (with right SDKs) Pocket Pc 2003, 2005 and Smartphone 2003, 2005, implementing the similar resources as people employed for the progress of apps for desktop PCs. Library .Net Compact Framework is mounted collectively with Visual Studio .Net. This library is specifically produced for devices with the minimal means. Builders can also use new languages C# and Visual Basic .Net for apps for mobile and inbuilt devices. They are excellent in workings with net-companies and ADO.Net systems.
Regulate components of ASP .Net Cellular Controls lengthen SDP capabilities and .Net Compact Framework system. They give chances to use options of .Net Compact Framework and Visual Studio .Net for progress of mobile net-apps because of to the information supply to different mobile devices by suggests of ASP.Net technological know-how. This technique will allow to build single mobile net-application in the Visual Studio .Net environment, that will routinely carry out information rendering for displaying on different devices: mobile phones, smartphones, PDA, Pocket Pc. The built-in progress environment helps make it probable to build mobile net-apps only by dragging command components on types.
ASP.Net Process sets no components on a shopper device. For adaptation of formatting beneath concrete browsers server logic is employed. It generates details in the formats of Wireless Markup Language (WML), HTML, and Compact HTML (cHTML).
Microsoft SQL Server
Microsoft SQL Server Compact Edition (SQL Server CE) is a compact DBMS for quick progress of apps that lengthen options of operate with organization information because of to the mobile devices applying. SQL Server CE is a tool facilitating progress of mobile apps because of to support of SQL syntax and utilization of application and API interface model that is compatible with SQL Server.
SQL Server CE provides the basic established of relational database capabilities, in certain optimized query handler support of transactions and heterogeneous varieties of information – with unpretentious requirements to the procedure means. Remote entry to the information and replication by confluence provide trustworthy supply of details from the SQL Server bases, probability of autonomous operate with by details and subsequent synchronization with the server. SQL Server CE is excellent for the techniques with mobile devices and wi-fi networks.
SQL Server CE DBMS is produced for integration with .Net Compact Framework by suggests of Visual Studio .Net. It simplifies progress of apps for operate with databases on mobile and created devices. New information supplier of SQL Server CE for code administration in the Widespread Language Runtime environment aids to produce distensible apps with options of autonomous operate with details in situations without having long lasting relationship.
Microsoft .Net SqlClient provides API for operate of equally .Net Framework and .Net Compact Framework apps. For the typical Windows techniques SqlClient Microsoft with SQL Server are employed, and SqlServerCe for Microsoft SQL Server Compact Edition databases for Compact Framework.
Identify room of SqlClient is in equally versions. So we can interact:
Utilizing .Net Compact Framework SqlClient to have an entry to SQL Server from device on Desktop.
Utilizing .Net Compact Framework SqlServerCe to have an entry to SQL Server Compact Edition directly on a device.
Function with databases on a device is similar to the operate on Desktop. To entry to SQLServer on Desktop procedure SQL works by using TCP/IP relationship as a result in this case it is probable not to have SQL Server Compact Edition mounted on a device.
All of the talked about models are implemented on the desktop techniques. So the expertise of their application can be carried for progress of the programs for Windows Cellular. Utilizing Win32 API we fast get compact code, and also can use it for progress of drivers and procedure element. Utilizing MFC we have extensions of API capabilities, and also designer for progress of interface. And applying Compact Framework we have at our disposal perfectly produced interface, automatic garbage collection, support of XML and other options. Also there is even extra truncated version — Micro Framework, the place there are significantly less SDK capabilities.
Soon after SDK for MS Visual Studio set up new configurations of assembling look as perfectly as new capabilities for assembling beneath these platforms. Accommodate also includes Emularor for software progress and testing without having bodily relationship among device and computer system.
As considerably as quite a few devices that are primarily based on Windows Cellular have ARM processor it is also probable to compile units applying other compilers: AVR32, ARM (RealView), GNUARM, IAR Devices.
2. Building Windows Cellular Applications for Windows Cellular devices applying MS Visual Studio .Net
Visual Studio progress environment collectively with Compact Framework help to produce apps applying a extensive graphic interface, databases, archiving and encrypting resources, USB, Serial, Bluetooth, and also wi-fi community connections and telephony. All of these is offered by SDK as perfectly as libraries and heading information from Platform Builder.
two.1 Consumer Interface
Due to the presence of excellent designer in VS and SDK we can very easily produce GUI for mobile apps just the similar as for Desktop apps. The only change is in sets of graphic components for Desktop techniques and for Windows Cellular. There is also change among components of Smartphone and Pocket Pc versions brought on by that Pocket Pc has a contact screen and SmartPhone has not. As a result progress of interface for SmartPhone is extra elaborate. One particular should really just take it into account when creating software for equally platforms.
Below we should really also point out that software created for Pocket Pc will not commence on the SmartPhone system although the opposite circumstance is probable – till the instant when some distinctive Smartphone perform is called.
It is normally that quite a few graphic components as perfectly as the vast majority of capabilities from full-sizing Framework ended up taken absent from Windows Cellular SDK to lower the sizing of the SDK on the device facet. Only the most needful components ended up still left. But the productivity and volumes of memory are expanding so the variety of perform bundled in SDK gets to be increased. So the change among Compact Framework 1. and 2. is tremendous. Model 1. was very minimal.
In standard the progress of GUI with ?ompact Framework on ?# is similar to the progress of the typical Win32 application on C#.
It is also probable to produce a graphic interface applying assembling of the 3D rendering-engines. They are these as GAPI (Video game API), OPENGL ES (Embedded Process), OPENVG (Vector Graphics), and other jobs. Undoubtedly it is alternatively labor intense procedure as considerably as it is very crucial to generate an optimal code since of the fairly minimal productivity of mobile devices.
two.2 Communications
To date mobile devices have a wide selection of communicational options. They have an entry to the wi-fi higher-speed community applying 802.11 WiFi Link common. They also use IrDa, Bluetooth, and USB host/shopper features. While the utilization of Irda is slowly having significantly less protocols and expectations of Bluetooth, WiFi, Edge, GSM, and also USB are employed quit frequently.
Microsoft Company provides these APIs:
ActiveSync API provides features for operate with companies of synchronization, file filters, and so forth.
Bluetooth API provides features for wi-fi entry to mobile and peripheral devices.
Link Supervisor API serves for the automation of relationship procedure, community relationship administration. Gadgets are applying Link Supervisor to establish relationship and also to tell about the meant relationship (for example World-wide-web).
Object Trade (OBEX) API provides features for operate with productive, compact binary protocol just suitable for devices with the minimal options.
Remote API (RAPI) provides capabilities for administration and distant simply call of approaches on the device facet. These capabilities are obtainable: entry to the sign-up, information, databases and unique configurations of device from the Desktop-procedure. The most crucial alternative is Remote Process Connect with when we only simply call the method «CeRapiInvoke()» on the Desktop facet, transmit the name of DLL on the device facet and the name of perform in this DLL and then just simply call this method.
Pocket Outlook Object Model API provides capabilities for operate with the objects of Pocket Outlook. It provides interfaces for synchronization and entry to the objects: Endeavor, Calendar, Contacts.
Telephony API (TAPI) features:
Assisted API
Extended API
Mobile phone API
SIM Supervisor API
Quick Messages Services (SMS) API
Telephony Services Service provider (TSP) API
Wireless Application Protocol (WAP) API.
Also mobile devices have probability to operate with Serial (USB) ports. There are a handful of COM-ports in quite a few devices. Typically the to start with 3-5 of them are reserved for IrDa, Bluetooth, SerialPort and other individuals. Other ports are obtainable to for user. Some devices have USB-Host features in other words they are USB On-The-Go (OTG) devices which can provide equally as USB Consumer and USB Host. For this objective device should really have required Hardware and Software program (Unit Driver).
Unit Driver is a driver which is an intermediate layer among the driver of HOST and degree of apps. These driver provides «Stream Interface Driver» and ought to include these capabilities as:
XXX_Init
XXX_Open up
XXX_Shut
XXX_Publish
XXX_Examine
XXX_IOControl
Below “XXX” is replaced with «prefix» (for example «COM», «DSK»).
This prefix registers in the registry when a driver registers in the procedure. Much more specific details about Unit Driver Interface can be obtained from MSDN.
Also a developer can use these APIs not concerning communicational types:
Unit Configuration API
File and Application Management API
Video game API
Residence Screen API
HTML Regulate API
MIDI API
Shell API
Speech Recognizer API
Vibrate API
Voice Recorder Regulate API.
two.3 P/Invoke and Native Interop
As considerably as Compact Framework includes basic capabilities and approaches from full
Framework we have these features as:
XML Serialization
Cryptography
Safety
Reflection
Interop Providers et al.
Undoubtedly Platform Invoke phone calls are obtainable. For this objective – as perfectly as in full Framework – we use capabilities and attributes from namespace Process.Runtime.InteropServices and DllImport attribute for description of capabilities which will be called from non-managed code.
However the features of these approaches is minimal. So Marshal class has PtrToStructure, GetComInterfaceForObject, Copy() and Examine() capabilities but, for example, there is no these perform as GetDelegateForFunctionPointer() in it. So it is not possible to make Marshaling just with Delegate. The GetFunctionPointerForDelegate perform is obtainable only. If we want to transmit a pointer to the perform from Managed code we should really get its FunctionPointer and only after that transmit it to the unmanaged code for subsequent simply call of it from there. Also we can not transmit some objects since Compact Framework can not depend SizeOf() for some objects. As a result routinely we have to transmit information of Blitable varieties only and arrays of these varieties (Int, byte, char, but not bool), and transmit and receive courses and buildings by suggests of IntPtr. Undoubtedly it is discussed by aspiration to improve the overall performance. It is therefore recommended to use major varieties for Marshaling and «GCHandle» class for storing an item in the procedure memory and to make this memory «visible» for unmanaged code
Undoubtedly the overall performance of P/Invoke phone calls from C# application in C++ DLL is almost 2 times significantly less than the overall performance of method phone calls among C++ DLLs. However the overall performance of devices grows and it gets to be probable to use these phone calls.
two.4 Debugging
MS Visual Studio permits to make debugging of apps beneath
Windows Cellular just the similar as for Desktop apps. We have Emulator, Unit Emulator Supervisor and other to features these as Breakpoints, Threads, Watches panel and so forth.
However to make Debug applying Native and Managed code at the same time is not possible. As a result it is probable to commence both C++ jobs or Managed types. It is also so for «Attach to process». There is a probability of attaching to the procedures on the device facet (or emulator facet). ActiveSync is needed to provide communication among a device and the procedure, it is mounted with SDK. An emulator also can be related to the computer system by suggests of ActiveSync. We obtain almost full emulation of Windows Cellular devices. Below are equally SmartPhone and Pocket Pc (or Pocket Pc Mobile phone Edition) emulators. However only one particular Windows Cellular device can be related to the computer system at one particular time instant. As a result Debug on two devices at the same time which for example interact in some way is alternatively tricky. Undoubtedly we speak only about Debug of apps produced by us but not about apps and companies of the procedure. For these debugging we need the full created of the procedure established by suggests of Platform Builder (in the very last versions of Platform Builder it’s bundled in Visual Studio). We can also build our very own SDK for Visual Studio and Windows CE system.
An emulator also permits to emulate relationship with the GSM community and GPS support. It helps make probable to test and produce significant spectrum of apps without having having a bodily device in hands.
Chatting about Debug with IDA we should really point out that version 5.1 by now has the probability to carry out Debug by suggests of this interactive disassembler with the use of their plugin which is mounted on a device.
With SDK overall look these alternative as «Deploy» appears in Visual Studio environment. Now there is «Deploy» item in task context menu in addition to “Build”, “Clean”, “Debug”. Soon after you pick out this item DLL or EXE file created by present configuration is transmitted to the device. Also new column appears in Configuration Supervisor the place not only «Build» in some configuration alternative is obtainable but also «Deploy». Deployment of .Net jobs transmits not only the device but also people builds that are depended on it (Dependencies).
3. Deployment and set up
Development of apps for Windows Cellular supposes also their assembling and generation of set up deal. For this objective there is these strategy as ?abinet (.taxi) file in Windows Cellular. It is a typical archive but it is a set up deal also (a kind of MSI deal). It is assembled by suggests of Taxi Wizard (cabwiz.exe) from MS VisualStudio (or from a command line). This utility makes processor dependent «.cab» file. WinCEApplicationManager transmits and starts Taxi on a device, so user can put in the application applying instructions appearing on device screen. It is also probable to build the task of MSI Set up which features Taxi file by suggests of Visual Studio. This created deal will be started on user computer system and then transmit ?AB set up on a device to carry on set up procedure.
There is distinctive Uninstall Supervisor on the device facet. One particular should really connect configuration INI-file to Taxi file. This INI file features settings to take care of set up procedure these as path, shortcut name to build, minimal OS version to put in the application and other individuals composed in distinctive syntax. It is also probable to contain your very own DLL into Taxi-file to widen set up options. This DLL includes these capabilities as «Installer_AfterInstall», «Installer_BeforeInstall», «Installer_AfterUnInstall», «Installer_BeforeUnInstall», code in these capabilities will be executed on the device facet in the certain times of set up or uninstallation procedure.
When creating Taxi set up it is probable to connect information, unique means, created units, insert details to the registry. They are designated as «Project Output. That is why there is no need to reset just about anything after Taxi-file generation: it will accumulate all bundled jobs and information and assemble in an archive.
4. Safety Model for Windows Cellular 5 and Windows Cellular 6
Gadgets primarily based on Windows Cellular receive, send out and review perhaps crucial details which should really be shielded from unsafe apps. To shield device the starting of unfamiliar apps is disabled, the entry to some API is limited and some registry elements altering is forbidden. Units can be marked as Trusted and Untrusted and procedure works by using this details to avert starting of unauthorized apps and limit their entry to the procedure. Also the entry to the procedure by suggests of RAPI (Remote API) by ActiveSync can be limited. Safety Certificates Safety Rights are employed for the executable units (EXE, DLL) and for Taxi-information.
Defense Against Threats and Hazards
The followings options enable to shield devices:
Rigid password security.
PIN code security.
Gadgets corrupt deleted details to avert entry to it (WM 6).
Gadgets corrupt deleted details on memory playing cards to avert entry to it (WM 6).
Storages encryption and Innovative Encryption Conventional for SSL (WM 6).
Have certificates utilization.
Detecting a device by using Bluetooth can be shielded (WM 6 Smartphone).
two layer procedure of application starting (One particular-tier and Two-tier entry).
No support of macros, therefore viruses can make considerably hurt.
The commence of apps is primarily based on Permissions. Windows Cellular devices use these models:
Privileged
Typical
Blocked
Privileged apps have the widest entry. They can entry any API, generate in the shielded locations of registry and have the full entry to the procedure.
Most apps have Typical model. They do not have entry to the dependable API and do not have the full command of the procedure.
Application can not be started at all if it has “Blocked” position. It suggests that it’s not signed with the right certificate or user forbade the commence by the right warning of the procedure.
Analogical circumstance is with Taxi-information. The executable units with Typical position can commence Privileged DLL but then they will operate as Typical. However Privileged executable units can not commence the units having Typical position.
Written by Eugene Kordin, Apriorit specialist.
Find out extra about progress procedure of Apriorit listed here.