locked
Mobile Application Development RRS feed

  • Question

  • Hi friends,

    A lot of people are interested to know about developing applications like games for mobiles. We will be starting the basics. A lot of theory is involved, before the actual practical fun starts.

    We will be developing applications using .net CF (Compact Framework). We will also need Windows Mobile 5.0 Smartphone SDK, Windows Mobile 5.0 PocketPC SDK, Active Sync 4.2 and Windows Device Emulator. I will provide the links for downloading all of these in my next thread.

    Needless to say, this is an open discussion and learning process. Any comments, suggestions are most welcome and highly appreciated.

    Let the fun begin!!!

    Friday, May 11, 2007 3:16 AM

Answers

  • Ill download them tonight Smile

    And waiting for the tutorials to start Smile
    Friday, May 11, 2007 7:56 AM
  • Thankz for so many links..can you give some more details here also... because so many links are hard to digest...
    Friday, May 11, 2007 11:32 AM
  • Here is the first tutorial. Its a Hands On Lab for Platform security fundamentals, with the code in .html files.
    Please download it from :
    http://download.yousendit.com/C0CDE5E5298D2085

    This link will expire within 7 days.

    Friday, May 11, 2007 1:23 PM
  • Thanks adnan.
    Friday, May 11, 2007 4:21 PM
  • Lets look at the basics of developing mobile applications. So let us bore ourselve with the important theory.

     

    Compact Framework Essentials

     

    Summary: This document is targeted at a developer who is starting to build applications for Windows Mobile, and provides an introduction to the .Net Compact Framework and how that can be used to Windows Mobile programming.

     

    .Net Compact Framework Overview

    The Microsoft .Net Compact Framework is a development platform that allows developers to build managed applications for Windows Mobile. The current version of the .Net Compact Framework (CF) is version 2.0 which targets Windows Mobile 5.0 and ships as a part of Visual Studio 2005. While managed code development on Windows Mobile has been possible for last four years (See Variations in .Net Compact Framework Versions), with CF 2.0 and VS 2005, it has become easier than ever. You can find more details on what’s new on programming with .Net Compact Framework 2.0 at What’s New in the .Net Compact Framework 2.0.

     

    Microsoft has invested heavily in making sure that the .Net CF looks and behaves in a way very similar to the full .Net Framework available on Windows XP and Windows Server product families. For example, both the frameworks are powered by the familiar CLR components: Managed Code Execution, JIT Compilation, Garbage Collection, etc., and support the Common Language Specification. The other big commonality is in development tools. The de-facto tool used for writing CF applications is Visual Studio 2005. Introduction to Development Tools for Windows Mobile-based Devices gives lots of details on using different tools for the various development activities for Windows Mobile programming. A summary is available at Device Capabilities and Required Development Tools. Since all development actually happens on a PC and your application gets deployed to a Windows Mobile device connected to that PC, getting the connection between the dev environment and the device is important. Connecting Smart Devices to Development Computers gives details on the same.

     

    More details on similarities are available at Similarities with the .Net Framework.

     

    While there are great similarities in the programming model and core architecture, there are several differences too. CF 2.0 has a surface area that is less than 30% of the surface area of the full framework, which means that the amount of functionality available is slightly less than 1/3rd. This is expected as the platform on which CF runs is constrained in terms of power, memory, CPU, storage, etc. The good news is that the footprint is as less 8% of the full framework, giving great bang for buck. A detailed list on specific differences is available at Differences with the .Net Framework. Some more differences, specific to CF 2.0 are given at Differences from Desktop in .Net Compact Framework.

     

    Like managed applications on the full framework, CF applications run inside an application domain which in turn is created by a CLR host – an application written in native code. (details on Application Domains) Given the fact that memory is extremely limited, the CF is designed to be highly efficient with resource usage. Among other several optimizations, when memory is scarce, CF aggressively releases internal data structures that are not required by currently running code. So CF apps are able to run in very low memory situations also. You can read more about resource management in CF at Memory Management. So a CF app can run with minimal overheads and give all the benefits of managed code even on the constrained environment of a WM Device.

    User Interface

    The wide variety of display and input options in Windows Mobile devices can make writing good UI quite a challenge. Fortunately, Windows Mobile has a number of APIs that make it easier for you to adapt your application according to the device. The MSDN Webcast on User Interface Techniques for Windows Mobile Devices provides details on how to build Windows Mobile applications that make "write once, display anywhere" a reality using Microsoft Visual Studio 2005 and the Microsoft .NET Compact Framework 2.0. Also check out the MSDN Webcast on Creating a Windows Mobile Line of Business (LOB) Application (Part 06 of 13): The User Interface.

    Connectivity and Communication

    The communication options available on a Windows Mobile device are often more than that on a desktop PC / Server. Some of the important ones are:

     

    1.     Bluetooth: Out-of-the-box, there is native support for Bluetooth on Windows Mobile. For managed code, there is a Shared-Source class-library available at Windows Embedded Source Tools for Bluetooth Technology.

     

    2.     CellCore: A set of wireless, connection-oriented services which include:

    ·         Radio Interface Layer (RIL)

    ·         Short Message Service (SMS)

    ·         Enhanced Messaging Service (EMS)

    ·         Wireless Application Protocol (WAP)

     

    While managed APIs are not available for some of these stacks, the most common thing you would want to do is send and receive SMS messages. This is not difficult to do with the CF. For details, check out Receiving SMS Messages Inside a Managed Application and Sending SMSs from your Microsoft .Net Compact Framework based Applications.  This becomes even simpler with the new managed Messaging and State & Notification Broker APIs that ship with Windows Mobile 5.0. For details, check out the MSDN Webcast: New Managed Messaging, State, and Notification APIs in Windows Mobile. Also check out the documentation for the Microsoft.WindowsMobile.Status namespace.

     

    You can make phone calls using the Microsoft.WindowsMobile.Telephony namespace.

     

    3.     Infra-Red Communications: CF 2.0 provides several IrDA classes – check out Infrared Connections for details. Also see How to: Make an Infrared File Transfer.

     

    More details on the extensive networking capabilities provided by the.Net Compact Framework provides can be found at Networking and Connectivity.

    Working with Data

    You can store data on Windows Mobile using SQL Everywhere (formerly called SQL Mobile and SQL CE) – a low footprint, compact relational database engine built on the SQL technology, which is available on the following platforms:

     

    • Windows Desktop/Server: Windows Vista, Windows XP and Windows Server 2003
    • Windows Mobile:  Windows Mobile 5.0, Pocket PC 2003
    • Windows CE: Windows CE 5.0, Windows CE 4.2

     More details on platform support are available at SQL Server 2005 Mobile Edition System Requirements.

     

    You can work with SQL Everywhere using the familiar tools that ship with SQL Server 2005, including replication and SSIS integration. The various features are described at SQL Server Mobile Features. To understand how to use SQL Server Everywhere, check out the MSDN Webcast: Creating a Windows Mobile Line of Business (LOB) Application (Part 04 of 13): Dealing with Data.

     

    The biggest issue that developers face in working with data is how to synchronize it with a back-end system. There are a number of options you can choose from. The MSDN Webcast: Synchronizing Windows Mobile Data Using SQL Server 2005 Everywhere Edition and ActiveSync discusses the data-synch issue in great detail.

     

    For accessing data, there are several choices - there is a managed Data Provider for SQL Everywhere, which is exposed thru the System.Data.SqlServerCe namespace. This provides the familiar Connection, Command, Reader, Adapter, Dataset, Resultset, etc classes that are available in ADO.net 2.0 on the desktop. Besides, there is the SQLCeEngine class that allows you to do things like creating new databases, change various settings, carry our database shrinking, repairing, etc. Data Access is discussed in great detail in the MSDN Webcast: Creating a Windows Mobile Line of Business (LOB) Application (Part 07 of 13): Adding Data-Driven Functionality to the Application

     

    The MSDN Webcast Choosing the Best Data Management and Synchronization Solution for Your Mobile Application discusses the issue of selecting the local data management solution and determining how best to synchronize that data with the back-end, and also talks about data access choices.

    Personal Information Management

    Hand-held devices typically carry a lot of personal information, and to help in working with personal information, there is extensive support in Windows Mobile. The main way of exposing PIM functionality is thru the Pocket Outlook Object Model (POOM). This is a subset of the Outlook capabilities available on the desktop PC, with support for Exchange Server integration. More details are available on Pocket Outlook Object Model.

     

    The functionality provided by the POOM is very useful and the lack of an managed object model led to a lot of developers writing their own managed wrappers around the POOM. With Windows Mobile 5.0, Microsoft has released a managed API for POOM. You can now access the POOM functionality thru the Microsoft.WindowsMobile.PocketOutlook and the Microsoft.WindowsMobile.PocketOutlook.MessageInterception namespaces that ship with the Windows Mobile 5.0 SDK. Fast and Simple Mobile Access to Pocket Outlook Data gives a good overview of the managed POOM.

    Graphics, Audio and Gaming

    Windows Mobile used to have a dedicated API for Gaming, called the Gaming API (GAPI) which is now deprecated. Instead, Game Development today is done using the DirectDraw and Direct3D Mobile APIs.

     

    Compact Framework has great support for graphics, audio and Gaming. In fact, Microsoft’s Game Development platform – XNA – is based on a custom build of .Net CF 2.0 CLR on the XBox 360. There is a series of Gaming articles on the MSDN website starting with Games Programming with Cheese – Part One which discusses how to build games using managed code.

     

    Mobile Direct3d Programming gives detailed guidance on how to use compact framework for calling the DirectX APIs.

    Native Interoperability

    The Windows Mobile platform is huge, and the Compact Framework only exposes a subset of it. You would often find that you need functionality for which there is no existing managed API. The solution is to call the native / unmanaged code providing the functionality.

     

    Native interop in previous versions of .Net Compact Framework was not easy, for example, COM interop was entirely missing, and developers had to write an unmanaged DLL around a COM component and then P/Invoke into the DLL. Compact Framework 2.0 has added enormous support for calling native code, including direct COM interop and improvements on PI.

     

    Details on Native Interop are available at Interoperability in the .Net Compact Framework. Also check out Step by Step: Incorporating COM Objects into your .Net Compact Framework 2.0 Application and Using COM Interop in .Net Compact Framework 2.0.

    Performance

    Windows Mobile is a constrained environment and performance is a big issue, especially if you are writing managed code. A number of resources are available to guide you on getting the best performance from Windows Mobile. Start with the Performance and Diagnosis section in the .Net Framework Developer’s Guide. Also read:

     

    1. How To: Improve Performance
    2. .NET CF 2.0 Performance Counters
    3. .Net Compact Framework 2.0 Performance and Working Set FAQ
    4. Examining Execution Speed of JITed Code with CF 2.0
    5. Scott Holden’s blog entries on CF Performance:
    6. Mark Zintel’s blog entries
    7. Steven Pratschner’s blog entries

     

    Saturday, May 12, 2007 4:13 AM
  • WOW, !!! Huge resources. Thanks for it m8. Will take time to read them all Smile one at a time is the best strategy here.
    Saturday, May 12, 2007 5:21 AM
  • Lots of theory.. Harshil is right, will take time in this.. but will surely do it...
    Saturday, May 12, 2007 9:48 AM
  • Most welcome guys. Well i wanted you to build your own app, and learn how we are doing it at the same time. No problem, please take your time. I will make the next post after some time. If you need any help from my side, please let me know....
    Saturday, May 12, 2007 1:12 PM
  • I think it will take time for us to try out something and digest the things all at once Smile

    I will download the resources that you mentioned , so that i can be ready at the time the webcasts about the mobile programming starts. May be during the webcasts, learning will become more easier and a good foundation is a must to advance further Smile.
    Saturday, May 12, 2007 4:48 PM
  • thank u adnan...
    Sunday, May 13, 2007 9:40 AM
  • cool and helpful resources adnan....
    Sunday, May 13, 2007 8:24 PM
  • ver nice info adnan
    Monday, May 14, 2007 5:44 AM
  • If all of you have digested the enormous info from the last post, and have tried your hands on making a embedded application, i would like to provide another tutorial and some more material. So just wanted to ask everybody if they are ready.
    Thursday, May 17, 2007 8:49 PM
  • I guess it will take time for newbies like me to get familiar with it, but you can continue with the next tutorial. We will ask doubts if we have any.
    Friday, May 18, 2007 5:46 AM
  • Windows Mobile – Game Development

     

    Summary: This document is targeted at a developer who is using Windows Mobile to develop applications, and provides an introduction to the game development capabilities of the Windows Mobile platform.

     

    Game Development Overview

    Consider that the number of smart hand-held devices sold every year worldwide is around 5 times the number of PCs sold. Also consider that unlike a PC, these devices are used by consumers almost all the time – at office, at work, while traveling, even while lounging around.  Now consider when people play games – not while they are working (some of us would disagree! J), but while they are doing all these other things.  All put together, it is fairly obvious that a consumer is far more likely to play a game if it is given to him on a mobile device as compared to a regular PC. This makes games running on mobile devices a very compelling market. Even more interesting is the fact that unlike the PC / Console based gaming market, this market is very young with no clear winners yet.

     

    Game Development for a mobile device is therefore a very lucrative career.  It is also intellectually challenging.  Here’s why: The ability of a platform for game development essentially depends on the following factors:

     

    1)     CPU, Memory and Storage: The usual limiting factors for any application are even more sensitive for serious game programming because games tend to be intensive on each of these three parameters, and since the user expects a near real-time response, the performance needs to be high too.

     

    2)     Graphics Capability: Displaying complex 2-D and 3-D shapes and animating them in near real-time requires a high graphics capability, and even more important, a programming model that is simple and powerful.

     

    3)     Multi-Media Capability: Sound, Videos synchronizing with the Graphics are essential for a good gaming experience and the serious game developer looks for a strong multi-media platform to achieve this.

     

    Now all of these are constrained in a mobile device, which makes game programming on mobile devices a lot more challenging and fun.  Windows Mobile with its focus on the smart hand-held mobile device is a key platform for mobile gaming, and provides a lot of assistance to the developer in building powerful games.  This assistance comes in the form of a powerful and simple programming model for 2D and 3D graphics, sound and multimedia.  Even better, all of this is available thru a managed API besides the regular C++ APIs, so you can program Windows Mobile games using the .Net Compact Framework.

     

    Gaming on Windows Mobile

    Games are typically graphics intensive. A rich game requires fast updates to the screen, which in turn requires fast access to the screen memory.  However, in the earlier days of Windows Mobile development, when the term “Windows Mobile” was unheard of and programmers dealt with Pocket PC, there was no device-independent way of getting speedy access to the hardware.  All you could do was to program using the GDI, which allowed a developer to do basic 2-D graphics – draw lines, rectangles, ellipses, curves, text, etc., but did not provide for direct access to the frame buffer.  This meant that advanced animation techniques like page flipping or back buffer drawing were not possible, which led to slower games, even on devices which had advanced enough graphics cards.

     

    It is not that one could not program against the hardware directly – one could – but it required understanding the specific hardware and programming directly against the driver.  Now this is difficult - forget about advanced things like lighting and vertexes, even basic stuff like RGB pixels and whether there is a color screen or not is hard to find out.  So there were not too many fast action-packed games being developed for Pocket PC in those days.

     

    Then in April 2000, Microsoft came up with the Gaming API (GAPI) – a set of functions that provide direct read/write access to the video frame buffer.  As a programmer, one now had access to all the low-level stuff in a uniform way across all devices, with the OEM doing the heavy lifting on the tricky part of providing access to the screen memory.  Not just that, GAPI also gave direct access to key presses, making sure that they are routed directly to the Game and not to the Shell.

     

    All of a sudden developers had access to all the low level stuff they could ask for.  There was only one problem – this was too low level.  Imagine having to do all the graphics in terms of writing to a buffer.  This was hard, and what most programmers did was to first write it to bitmap using traditional GDI and then copy it to the video frame buffer.  What was really required was a model which allowed low level access to hardware but also provided high-level graphics primitives.  This was not to happen for the next five years.

     

    While GAPI was a somewhat broken gaming solution for Windows Mobile, the solution that Microsoft created for game programming on traditional PC was far more complete – this was called DirectX.  DirectX had started off much like GAPI, but unlike GAPI, providing high level APIs for various graphics work had been a design goal from the very beginning.  Over the years, DirectX on Windows evolved to provide support for 2D and 3D graphics, sound and multi-media while still providing low-level access to underlying hardware.  Very soon DirectX became the platform targeted by every game on the Windows PC.

     

    In 2005 when Microsoft came up with Windows Mobile 5, based on the Windows CE 5 kernel, the decision was taken to finally retire GAPI and bring DirectX to Windows Mobile in all its glory.  And this came with a managed wrapper so that one could use DirectX from managed applications as well.  So today, when we think about Game development on Windows Mobile, we think about DirectX programming.

     

    Windows Mobile Direct X Support

    DirectX on Windows Mobile comes in the form of the following APIs:

     

    1)     Direct3D Mobile: Meant for rich 3-d graphics. This is available in native API as well as a managed API (Microsoft.WindowsMobile.DirectX and Microsoft.WindowsMobile.DirectX.Direct3D)

     

    2)     Microsoft DirectDraw: Meant for high-speed 2D graphics. Also includes support for digital video.  Only available in native API

     

    3)     Microsoft DirectShow: Meant for managing and accessing cameras.  Controls picture / video capture and playback.  Only available in native API

     

    GAPI has been deprecated since the introduction of DirectX on Windows Mobile, and it is recommended that all Game programming on Windows Mobile be done using DirectX only.

     

    Further Reading

     

    Game Programming on Windows Mobile:

    ·         MSDN Webcast: Windows Mobile as a Gaming Platform

    ·         Introduction to Game Development on Mobile Devices Webcast Series

    ·         Writing Mobile Games using the Microsoft .Net Compact Framework

    ·         Game Programming with Cheese

    ·         Pocket Bots: Writing a Battle Game for Smartphones

    ·         StarLight: Writing a Space-Shooter Game for Smartphones

     

    Managed GAPI Programming:

    ·         Dancing Rectangles: Using GAPI to Create a Managed Graphics Library

    ·         Gaming with the .Net Compact Framework

    ·         Gaming with the .Net Compact Framework: A Simple Example

     

    Managed DirectX Programming:

    ·         Craig Andrea’s Managed DirectX Tutorials

    ·         Tim Miller’s Blog

    Friday, May 18, 2007 11:04 AM
  • Please check the examples. You will get a good idea about developing games, and how to use directx for embedded devices.
    Friday, May 18, 2007 11:05 AM

All replies

  • Ill download them tonight Smile

    And waiting for the tutorials to start Smile
    Friday, May 11, 2007 7:56 AM
  • Thankz for so many links..can you give some more details here also... because so many links are hard to digest...
    Friday, May 11, 2007 11:32 AM
  • Here is the first tutorial. Its a Hands On Lab for Platform security fundamentals, with the code in .html files.
    Please download it from :
    http://download.yousendit.com/C0CDE5E5298D2085

    This link will expire within 7 days.

    Friday, May 11, 2007 1:23 PM
  • Thanks adnan.
    Friday, May 11, 2007 4:21 PM
  • Lets look at the basics of developing mobile applications. So let us bore ourselve with the important theory.

     

    Compact Framework Essentials

     

    Summary: This document is targeted at a developer who is starting to build applications for Windows Mobile, and provides an introduction to the .Net Compact Framework and how that can be used to Windows Mobile programming.

     

    .Net Compact Framework Overview

    The Microsoft .Net Compact Framework is a development platform that allows developers to build managed applications for Windows Mobile. The current version of the .Net Compact Framework (CF) is version 2.0 which targets Windows Mobile 5.0 and ships as a part of Visual Studio 2005. While managed code development on Windows Mobile has been possible for last four years (See Variations in .Net Compact Framework Versions), with CF 2.0 and VS 2005, it has become easier than ever. You can find more details on what’s new on programming with .Net Compact Framework 2.0 at What’s New in the .Net Compact Framework 2.0.

     

    Microsoft has invested heavily in making sure that the .Net CF looks and behaves in a way very similar to the full .Net Framework available on Windows XP and Windows Server product families. For example, both the frameworks are powered by the familiar CLR components: Managed Code Execution, JIT Compilation, Garbage Collection, etc., and support the Common Language Specification. The other big commonality is in development tools. The de-facto tool used for writing CF applications is Visual Studio 2005. Introduction to Development Tools for Windows Mobile-based Devices gives lots of details on using different tools for the various development activities for Windows Mobile programming. A summary is available at Device Capabilities and Required Development Tools. Since all development actually happens on a PC and your application gets deployed to a Windows Mobile device connected to that PC, getting the connection between the dev environment and the device is important. Connecting Smart Devices to Development Computers gives details on the same.

     

    More details on similarities are available at Similarities with the .Net Framework.

     

    While there are great similarities in the programming model and core architecture, there are several differences too. CF 2.0 has a surface area that is less than 30% of the surface area of the full framework, which means that the amount of functionality available is slightly less than 1/3rd. This is expected as the platform on which CF runs is constrained in terms of power, memory, CPU, storage, etc. The good news is that the footprint is as less 8% of the full framework, giving great bang for buck. A detailed list on specific differences is available at Differences with the .Net Framework. Some more differences, specific to CF 2.0 are given at Differences from Desktop in .Net Compact Framework.

     

    Like managed applications on the full framework, CF applications run inside an application domain which in turn is created by a CLR host – an application written in native code. (details on Application Domains) Given the fact that memory is extremely limited, the CF is designed to be highly efficient with resource usage. Among other several optimizations, when memory is scarce, CF aggressively releases internal data structures that are not required by currently running code. So CF apps are able to run in very low memory situations also. You can read more about resource management in CF at Memory Management. So a CF app can run with minimal overheads and give all the benefits of managed code even on the constrained environment of a WM Device.

    User Interface

    The wide variety of display and input options in Windows Mobile devices can make writing good UI quite a challenge. Fortunately, Windows Mobile has a number of APIs that make it easier for you to adapt your application according to the device. The MSDN Webcast on User Interface Techniques for Windows Mobile Devices provides details on how to build Windows Mobile applications that make "write once, display anywhere" a reality using Microsoft Visual Studio 2005 and the Microsoft .NET Compact Framework 2.0. Also check out the MSDN Webcast on Creating a Windows Mobile Line of Business (LOB) Application (Part 06 of 13): The User Interface.

    Connectivity and Communication

    The communication options available on a Windows Mobile device are often more than that on a desktop PC / Server. Some of the important ones are:

     

    1.     Bluetooth: Out-of-the-box, there is native support for Bluetooth on Windows Mobile. For managed code, there is a Shared-Source class-library available at Windows Embedded Source Tools for Bluetooth Technology.

     

    2.     CellCore: A set of wireless, connection-oriented services which include:

    ·         Radio Interface Layer (RIL)

    ·         Short Message Service (SMS)

    ·         Enhanced Messaging Service (EMS)

    ·         Wireless Application Protocol (WAP)

     

    While managed APIs are not available for some of these stacks, the most common thing you would want to do is send and receive SMS messages. This is not difficult to do with the CF. For details, check out Receiving SMS Messages Inside a Managed Application and Sending SMSs from your Microsoft .Net Compact Framework based Applications.  This becomes even simpler with the new managed Messaging and State & Notification Broker APIs that ship with Windows Mobile 5.0. For details, check out the MSDN Webcast: New Managed Messaging, State, and Notification APIs in Windows Mobile. Also check out the documentation for the Microsoft.WindowsMobile.Status namespace.

     

    You can make phone calls using the Microsoft.WindowsMobile.Telephony namespace.

     

    3.     Infra-Red Communications: CF 2.0 provides several IrDA classes – check out Infrared Connections for details. Also see How to: Make an Infrared File Transfer.

     

    More details on the extensive networking capabilities provided by the.Net Compact Framework provides can be found at Networking and Connectivity.

    Working with Data

    You can store data on Windows Mobile using SQL Everywhere (formerly called SQL Mobile and SQL CE) – a low footprint, compact relational database engine built on the SQL technology, which is available on the following platforms:

     

    • Windows Desktop/Server: Windows Vista, Windows XP and Windows Server 2003
    • Windows Mobile:  Windows Mobile 5.0, Pocket PC 2003
    • Windows CE: Windows CE 5.0, Windows CE 4.2

     More details on platform support are available at SQL Server 2005 Mobile Edition System Requirements.

     

    You can work with SQL Everywhere using the familiar tools that ship with SQL Server 2005, including replication and SSIS integration. The various features are described at SQL Server Mobile Features. To understand how to use SQL Server Everywhere, check out the MSDN Webcast: Creating a Windows Mobile Line of Business (LOB) Application (Part 04 of 13): Dealing with Data.

     

    The biggest issue that developers face in working with data is how to synchronize it with a back-end system. There are a number of options you can choose from. The MSDN Webcast: Synchronizing Windows Mobile Data Using SQL Server 2005 Everywhere Edition and ActiveSync discusses the data-synch issue in great detail.

     

    For accessing data, there are several choices - there is a managed Data Provider for SQL Everywhere, which is exposed thru the System.Data.SqlServerCe namespace. This provides the familiar Connection, Command, Reader, Adapter, Dataset, Resultset, etc classes that are available in ADO.net 2.0 on the desktop. Besides, there is the SQLCeEngine class that allows you to do things like creating new databases, change various settings, carry our database shrinking, repairing, etc. Data Access is discussed in great detail in the MSDN Webcast: Creating a Windows Mobile Line of Business (LOB) Application (Part 07 of 13): Adding Data-Driven Functionality to the Application

     

    The MSDN Webcast Choosing the Best Data Management and Synchronization Solution for Your Mobile Application discusses the issue of selecting the local data management solution and determining how best to synchronize that data with the back-end, and also talks about data access choices.

    Personal Information Management

    Hand-held devices typically carry a lot of personal information, and to help in working with personal information, there is extensive support in Windows Mobile. The main way of exposing PIM functionality is thru the Pocket Outlook Object Model (POOM). This is a subset of the Outlook capabilities available on the desktop PC, with support for Exchange Server integration. More details are available on Pocket Outlook Object Model.

     

    The functionality provided by the POOM is very useful and the lack of an managed object model led to a lot of developers writing their own managed wrappers around the POOM. With Windows Mobile 5.0, Microsoft has released a managed API for POOM. You can now access the POOM functionality thru the Microsoft.WindowsMobile.PocketOutlook and the Microsoft.WindowsMobile.PocketOutlook.MessageInterception namespaces that ship with the Windows Mobile 5.0 SDK. Fast and Simple Mobile Access to Pocket Outlook Data gives a good overview of the managed POOM.

    Graphics, Audio and Gaming

    Windows Mobile used to have a dedicated API for Gaming, called the Gaming API (GAPI) which is now deprecated. Instead, Game Development today is done using the DirectDraw and Direct3D Mobile APIs.

     

    Compact Framework has great support for graphics, audio and Gaming. In fact, Microsoft’s Game Development platform – XNA – is based on a custom build of .Net CF 2.0 CLR on the XBox 360. There is a series of Gaming articles on the MSDN website starting with Games Programming with Cheese – Part One which discusses how to build games using managed code.

     

    Mobile Direct3d Programming gives detailed guidance on how to use compact framework for calling the DirectX APIs.

    Native Interoperability

    The Windows Mobile platform is huge, and the Compact Framework only exposes a subset of it. You would often find that you need functionality for which there is no existing managed API. The solution is to call the native / unmanaged code providing the functionality.

     

    Native interop in previous versions of .Net Compact Framework was not easy, for example, COM interop was entirely missing, and developers had to write an unmanaged DLL around a COM component and then P/Invoke into the DLL. Compact Framework 2.0 has added enormous support for calling native code, including direct COM interop and improvements on PI.

     

    Details on Native Interop are available at Interoperability in the .Net Compact Framework. Also check out Step by Step: Incorporating COM Objects into your .Net Compact Framework 2.0 Application and Using COM Interop in .Net Compact Framework 2.0.

    Performance

    Windows Mobile is a constrained environment and performance is a big issue, especially if you are writing managed code. A number of resources are available to guide you on getting the best performance from Windows Mobile. Start with the Performance and Diagnosis section in the .Net Framework Developer’s Guide. Also read:

     

    1. How To: Improve Performance
    2. .NET CF 2.0 Performance Counters
    3. .Net Compact Framework 2.0 Performance and Working Set FAQ
    4. Examining Execution Speed of JITed Code with CF 2.0
    5. Scott Holden’s blog entries on CF Performance:
    6. Mark Zintel’s blog entries
    7. Steven Pratschner’s blog entries

     

    Saturday, May 12, 2007 4:13 AM
  • WOW, !!! Huge resources. Thanks for it m8. Will take time to read them all Smile one at a time is the best strategy here.
    Saturday, May 12, 2007 5:21 AM
  • Lots of theory.. Harshil is right, will take time in this.. but will surely do it...
    Saturday, May 12, 2007 9:48 AM
  • Most welcome guys. Well i wanted you to build your own app, and learn how we are doing it at the same time. No problem, please take your time. I will make the next post after some time. If you need any help from my side, please let me know....
    Saturday, May 12, 2007 1:12 PM
  • I think it will take time for us to try out something and digest the things all at once Smile

    I will download the resources that you mentioned , so that i can be ready at the time the webcasts about the mobile programming starts. May be during the webcasts, learning will become more easier and a good foundation is a must to advance further Smile.
    Saturday, May 12, 2007 4:48 PM
  • thank u adnan...
    Sunday, May 13, 2007 9:40 AM
  • cool and helpful resources adnan....
    Sunday, May 13, 2007 8:24 PM
  • ver nice info adnan
    Monday, May 14, 2007 5:44 AM
  • If all of you have digested the enormous info from the last post, and have tried your hands on making a embedded application, i would like to provide another tutorial and some more material. So just wanted to ask everybody if they are ready.
    Thursday, May 17, 2007 8:49 PM
  • I guess it will take time for newbies like me to get familiar with it, but you can continue with the next tutorial. We will ask doubts if we have any.
    Friday, May 18, 2007 5:46 AM
  • Windows Mobile – Game Development

     

    Summary: This document is targeted at a developer who is using Windows Mobile to develop applications, and provides an introduction to the game development capabilities of the Windows Mobile platform.

     

    Game Development Overview

    Consider that the number of smart hand-held devices sold every year worldwide is around 5 times the number of PCs sold. Also consider that unlike a PC, these devices are used by consumers almost all the time – at office, at work, while traveling, even while lounging around.  Now consider when people play games – not while they are working (some of us would disagree! J), but while they are doing all these other things.  All put together, it is fairly obvious that a consumer is far more likely to play a game if it is given to him on a mobile device as compared to a regular PC. This makes games running on mobile devices a very compelling market. Even more interesting is the fact that unlike the PC / Console based gaming market, this market is very young with no clear winners yet.

     

    Game Development for a mobile device is therefore a very lucrative career.  It is also intellectually challenging.  Here’s why: The ability of a platform for game development essentially depends on the following factors:

     

    1)     CPU, Memory and Storage: The usual limiting factors for any application are even more sensitive for serious game programming because games tend to be intensive on each of these three parameters, and since the user expects a near real-time response, the performance needs to be high too.

     

    2)     Graphics Capability: Displaying complex 2-D and 3-D shapes and animating them in near real-time requires a high graphics capability, and even more important, a programming model that is simple and powerful.

     

    3)     Multi-Media Capability: Sound, Videos synchronizing with the Graphics are essential for a good gaming experience and the serious game developer looks for a strong multi-media platform to achieve this.

     

    Now all of these are constrained in a mobile device, which makes game programming on mobile devices a lot more challenging and fun.  Windows Mobile with its focus on the smart hand-held mobile device is a key platform for mobile gaming, and provides a lot of assistance to the developer in building powerful games.  This assistance comes in the form of a powerful and simple programming model for 2D and 3D graphics, sound and multimedia.  Even better, all of this is available thru a managed API besides the regular C++ APIs, so you can program Windows Mobile games using the .Net Compact Framework.

     

    Gaming on Windows Mobile

    Games are typically graphics intensive. A rich game requires fast updates to the screen, which in turn requires fast access to the screen memory.  However, in the earlier days of Windows Mobile development, when the term “Windows Mobile” was unheard of and programmers dealt with Pocket PC, there was no device-independent way of getting speedy access to the hardware.  All you could do was to program using the GDI, which allowed a developer to do basic 2-D graphics – draw lines, rectangles, ellipses, curves, text, etc., but did not provide for direct access to the frame buffer.  This meant that advanced animation techniques like page flipping or back buffer drawing were not possible, which led to slower games, even on devices which had advanced enough graphics cards.

     

    It is not that one could not program against the hardware directly – one could – but it required understanding the specific hardware and programming directly against the driver.  Now this is difficult - forget about advanced things like lighting and vertexes, even basic stuff like RGB pixels and whether there is a color screen or not is hard to find out.  So there were not too many fast action-packed games being developed for Pocket PC in those days.

     

    Then in April 2000, Microsoft came up with the Gaming API (GAPI) – a set of functions that provide direct read/write access to the video frame buffer.  As a programmer, one now had access to all the low-level stuff in a uniform way across all devices, with the OEM doing the heavy lifting on the tricky part of providing access to the screen memory.  Not just that, GAPI also gave direct access to key presses, making sure that they are routed directly to the Game and not to the Shell.

     

    All of a sudden developers had access to all the low level stuff they could ask for.  There was only one problem – this was too low level.  Imagine having to do all the graphics in terms of writing to a buffer.  This was hard, and what most programmers did was to first write it to bitmap using traditional GDI and then copy it to the video frame buffer.  What was really required was a model which allowed low level access to hardware but also provided high-level graphics primitives.  This was not to happen for the next five years.

     

    While GAPI was a somewhat broken gaming solution for Windows Mobile, the solution that Microsoft created for game programming on traditional PC was far more complete – this was called DirectX.  DirectX had started off much like GAPI, but unlike GAPI, providing high level APIs for various graphics work had been a design goal from the very beginning.  Over the years, DirectX on Windows evolved to provide support for 2D and 3D graphics, sound and multi-media while still providing low-level access to underlying hardware.  Very soon DirectX became the platform targeted by every game on the Windows PC.

     

    In 2005 when Microsoft came up with Windows Mobile 5, based on the Windows CE 5 kernel, the decision was taken to finally retire GAPI and bring DirectX to Windows Mobile in all its glory.  And this came with a managed wrapper so that one could use DirectX from managed applications as well.  So today, when we think about Game development on Windows Mobile, we think about DirectX programming.

     

    Windows Mobile Direct X Support

    DirectX on Windows Mobile comes in the form of the following APIs:

     

    1)     Direct3D Mobile: Meant for rich 3-d graphics. This is available in native API as well as a managed API (Microsoft.WindowsMobile.DirectX and Microsoft.WindowsMobile.DirectX.Direct3D)

     

    2)     Microsoft DirectDraw: Meant for high-speed 2D graphics. Also includes support for digital video.  Only available in native API

     

    3)     Microsoft DirectShow: Meant for managing and accessing cameras.  Controls picture / video capture and playback.  Only available in native API

     

    GAPI has been deprecated since the introduction of DirectX on Windows Mobile, and it is recommended that all Game programming on Windows Mobile be done using DirectX only.

     

    Further Reading

     

    Game Programming on Windows Mobile:

    ·         MSDN Webcast: Windows Mobile as a Gaming Platform

    ·         Introduction to Game Development on Mobile Devices Webcast Series

    ·         Writing Mobile Games using the Microsoft .Net Compact Framework

    ·         Game Programming with Cheese

    ·         Pocket Bots: Writing a Battle Game for Smartphones

    ·         StarLight: Writing a Space-Shooter Game for Smartphones

     

    Managed GAPI Programming:

    ·         Dancing Rectangles: Using GAPI to Create a Managed Graphics Library

    ·         Gaming with the .Net Compact Framework

    ·         Gaming with the .Net Compact Framework: A Simple Example

     

    Managed DirectX Programming:

    ·         Craig Andrea’s Managed DirectX Tutorials

    ·         Tim Miller’s Blog

    Friday, May 18, 2007 11:04 AM
  • Please check the examples. You will get a good idea about developing games, and how to use directx for embedded devices.
    Friday, May 18, 2007 11:05 AM
  • The links to download windows mobile 5.0 sdks are not working. Can you please provide the updated links? I need to use the 5.0 sdk (and not 6.0). I have been searching the web quite a bit, but not able to find a download link.

    Thanks!


    Haripriyan
    Wednesday, August 19, 2009 3:38 PM