The Windows Phones have arrived!

I’m pleased to announce that today we’re launching a new line of Windows® phones around the world that are available in a broad range of styles and prices. With a Windows phone, you can navigate easily with the touch of a finger and browse the Internet on a great mobile browser. You can also connect to two new services that allow you to back up and share data from your phone to the Web and buy a variety of useful applications from the Windows Marketplace for Mobile. Microsoft expects partners to deliver more than 30 new phones in more than 20 countries by the end of 2009.

pure

One Phone for Work and Play

With a Windows phone, people can rely on their phone to balance their lives, from work to home to play. Whether it’s editing a document or sharing several vacation updates through a social networking application, Windows phones help people stay connected to the people and information they care about most. Because people’s phones often match their personality and unique needs, Microsoft now offers the Windows phone Custom Theme Creator. People can create personalized themes for their Windows phone by choosing the color and design that suits their style at http://www.windowsphone.com/theme.

With a Windows phone, people will have familiar work and play experiences right from their Start button, including these:

• A new enhanced Windows Live experience with What’s New feeds and improved Windows Live photo sharing across major social networking sites (such as Twitter, Facebook, MySpace and Flickr)

• A best-in-class e-mail experience and the ability to manage multiple accounts right from their phone with Outlook Mobile and Exchange Server synchronization not to mention Hotmail

• The ability to use PowerPoint and open and edit Word and Excel documents from their phone with Microsoft Office Mobile

• The power to sync files on the phone through Windows Live Media Manager and play media files seamlessly with Windows Media Player

• A redesigned Windows Internet Explorer mobile browser with Adobe Flash Lite that brings the mobile Web browsing experience closer to what people have come to expect from their PC

Powerful Mobile Services

With the launch of these new Windows phones, Microsoft debuts new services that bring added value to people.

My Phone is a free service that helps people manage and back up the invaluable information stored on their phone and provides peace of mind and an easy restore option in the event of a lost or damaged phone. My Phone automatically synchronizes the specific types of a phone’s content the user chooses — from contacts and appointments to texts, photos and more — to a password-protected Web site. People can also publish their photos from the My Phone Web site or their phone directly to Windows Live, Facebook, MySpace and Flickr. As part of the free service, people can go online and map the last known location of their phone from when it was last synchronized. In addition, a set of more advanced “lost phone” features are being offered as a premium package that people can activate as needed. The My Phone Premium package includes the ability to immediately locate the phone’s current location on a map (in the U.S. only); remotely lock a phone and post an “if found” message to its screen; loudly ring the phone even if it is set to vibrate or silent mode; and ultimately, if needed, completely erase the phone to protect personal data from falling into the wrong hands. People using My Phone on their phone running either Windows Mobile 6.0, 6.1 or 6.5 can access the premium package free of charge until Nov. 30, 2009. After that date, seven-day access to the premium package will be available for purchase for $4.99 in the U.S.

Also launching today is Windows Marketplace for Mobile, which offers people an easy way to find and purchase high-quality mobile applications for both work and play, while creating a new opportunity for developers to reach millions of people using Windows phones worldwide. Microsoft is pleased today to introduce 246 quality mobile applications initially in Windows Marketplace for work and play, with more than 753 ISVs worldwide on board to continue building out the catalog. People will have access to not only important line-of-business applications for work, but also popular mobile applications for play such as Facebook, MySpace, Netflix, Twikini, WunderRadio and ZAGAT, as well as leading game titles including Sudoku, “Guitar Hero World Tour” and the “PAC-MAN” series, all of which can be easily purchased and installed directly on a Windows phone. All purchased applications are certified by Microsoft to run on Windows phones and are backed by a simple return policy. Over the next few months, Microsoft will continue to evolve Windows Marketplace for Mobile to bring to market a fresh take on the app store that delivers strong value for developers and a great shopping experience for people.

Choice and Availability: A Phone for Everyone

Windows phones give people the power to choose the phone that best fits their style and budget by offering phones with a full physical QWERTY keyboard, others with just a large touch screen, and some with both touch screen and keyboard.

So what’s new for Developers?

Web developers can now target Internet Explorer Mobile for their applications.  Not only does this browser provide full desktop fidelity, but it also includes the fast IE8 Javascript engine to speed up code execution, DOM manipulation and Ajax calls.  Don’t take my word for it, test it out over at http://asp.net and watch it accurately render all the Ajax controls.

Both Native and Managed code developers get to take advantage of the new Gesture API to add panning and flicking to their apps.  The built-in physics engine allows developers to add smooth, finger-friendly scrolling.

For developers that are more at home with Cascading Style Sheets, HTML, Javascript and Ajax, Windows Mobile 6.5 introduces Widgets as an alternative to C++ or .NET.  These programs take advantage of the new Internet Explorer Mobile to render Rich Internet Applications that run outside the browser but take advantage of the power of the Web.

Any changes under the Hood?

Yes, since the launch of Windows Mobile 6, we’ve been progressively enhancing the Windows CE 5 kernel that powers the Windows Mobile platform.  You should expect better application stability, much more virtual memory available to running apps, and faster execution.

Have fun with your new phones!

- Rob

The Hidden Message Queue on your Windows phone

The ability to be “offline” and “occasionally-connected” is a critical component of successful mobile apps.  Wireless data networks lack complete coverage and exhibit a level of unreliability that immediately disqualify permanently-connected apps like you might see on a corporate LAN.  For a mobile app to be successful, it must allow the user to keep working in the absence of a data network.  It must also be able to transparently sync data changes from the mobile client to the server whenever a wireless data network is detected.  The primary means of accomplishing that today is via one of Microsoft’s sync technologies that allows SQL Server Compact on the mobile client to replicate data to and from SQL Server in the data center or the cloud.  Since SQL Server Compact runs almost anywhere, your mobile client could be a Windows phone, a laptop, a desktop or even a Netbook.

Besides synchronizing the tables, rows and columns of a complete database between mobile clients and servers, the use of message queuing should be considered for many scenarios due to its high-reliability by ensuring that a critical message arrives at its destination.  Products like MSMQ, MQ Series, Tibco and JMS are used all over the world in the most mission-critical environments to ensure a high level of availability and reliability.  They’re asynchronous by nature and use store and forward mechanisms so that messages get from point A to B to C.  A typical queue message includes the Destination which tells the messge where to go, a Label which describes the message, a Body which contains the message, and a Body Length so the receiver can verify that it received everything.

So how does any of this relate to Windows phones?  A number of years ago, an MSMQ client was made available for download and installation on Windows phones.  Additionally, the .NET Compact Framework 2.0 included classes to work with MSMQ.  Unfortunately, the installation of MSMQ was far from seamless which inhibited its adoption by customers.  More recently, functionality was included in the .NET Compact Framework 3.5 that facilitated store and forward messaging using Exchange 2007 as a transport.  This is a good solution for customers running the newest version of Exchange, have an unlimited data plan for their phones, and don’t mind running line of business applications over their email infrastructure.

So what do we do for customers that have found the Windows Mobile MSMQ client too much of a hassle, don’t have Exchange 2007 or don’t want to use it as a mobile message queue server?  I think the answer has been under our noses all along.  Burned in the ROM of every Windows Mobile 6.x device is SQL Server Compact + a lightweight data sync solution called Remote Data Access (RDA).  For those of you running Windows Mobile 5, XP, Vista or 7, you can easily download these bits to your mobile client.  SQL Server Compact is you local queue, RDA is your transport and SQL Server in the cloud or data center is your message queue server.  So let’s break this down and see how it will work.

A mobile application that captures data in the field would want to drop that info in a local queue.  SQL Server Compact becomes that local queue and the message format is actually a table with the following structure:

Table name Message
MessageId Uniqueidentifier
Destination NVarchar(whatever)
Label NVarchar(whatever)
Body NVarchar(4000)
BodyLength int

This table would be created inside a MessgeQueue database in SQL Server and RDA would pull it down to SQL Server Compact.  In the Pull method you call from .NET on the client, you would add “WHERE 1=0” to the SQL statement.  This filter has the effect of pulling down an empty shell of the table without retrieving any data to the client since that’s all you want.  It also means that when you insert local data into the table and call the Push method, the data will be removed from the client at the completion of a successful sync.

So you’re probably wondering, what makes this so special and message queue-like vs. anything else?  The secret is that unlike other sync technologies, RDA can wrap the upload of data into a transaction.  As the data is being uploaded over wireless, if any of the INSERTs into SQL Server fail for whatever reason, everything gets rolled-back and the original data remains in the local SQL Server Compact queue.  This is the kind of guaranteed commit that you expect from a message queuing system.  It’s an “all or nothing” success or rollback. 

It actually gets better.  A property of both RDA and Merge Replication is called ConnectionRetryTimeout.  This feature is designed to help you with unreliable wireless coverage where you have signal one minute and then lose it the next.  Let’s say you have this timeout value set to 2 minutes and you begin your Push upload of queued data.  Everything is working fine for the first few seconds but then you lose wireless coverage from your mobile operator.  If you regain coverage before the 2 minute time-out, the upload will resume where it left off.  Since both RDA and Merge send and receive data between the SQL Server Compact and IIS in tiny blocks, you never have to worry about running out of memory and you can pick up where you left off in case of a network dropout.

So the big takeaway here is that we do in fact have a Mobile Message Queue solution hidden on our Windows phones.  We have a message format that lets us drop text/xml/whatever data into the body, a label that a server process or SQL trigger can key off of to perform an action, and a transactional upload mechanism that ensures your critical data will cross the wireless chasm and make it to the other side intact.

So what’s next?  Now that you can capture data in a local queue and safely upload it, you might be wondering how queued messages from someone else can be pushed to your device.  Don’t worry, that will be in my next post.  Also, this isn’t just an article on how to solve a big problem in the mobile space, I’m actually building the necessary client and server pieces as well.  We’re all looking for a reliable and unified way to connect mobile devices to corporate assets and this just might be the simple answer we’re looking for.

- Rob

What ever happened to RDA?

Who remembers using Remote Data Access to synchronize data between SQL Server and SQL Server Compact?  I certainly do!

Before I dove head first into the world of Merge Replication, I always used RDA to get my customers up and running quickly.  Mobilizing an organization’s workforce quickly and easily is what it’s all about so they can start reaping the benefits.  In addition to a speedy time to market, there’s no faster or more scalable mobile sync technology on the market anywhere. 

So why wouldn’t I always use RDA?  Here’s a quick list:

  1. You’re using Identity columns.
  2. You want to replicate schema changes to the client.
  3. You want change tracking on both the client and server to perform diffs of each of the tables during a sync instead of re-downloading the entire table.
  4. You want to automatically resolve conflicts that arise when 2 people update the same data.
  5. You want referential integrity constraints to be pushed down to the client database from SQL Server.
  6. You don’t want to write code to perform synchronization or filter data.

If anything on the above list applied to you, you would shift to Merge Replication because it could manage ranges of Identity columns, push down schema changes, only sync data differences, resolve conflicts and push down a database’s referential integrity constraints.  Merge requires almost no code to get started and tables and columns are filtered visually via a wizard.

So why might you choose to use RDA?  Here’s another list:

  1. Your Primary Keys use GUIDs instead of Identity columns.
  2. Users don’t overwrite each other’s data so you don’t need conflict resolution.  The rule of “Last in Wins” works for you.
  3. While you want indexes to be pushed down, you don’t care if your local SSCE database has referential integrity constraints applied.
  4. You want to wrap the changes you upload to SQL Server in a transaction so that all changes are applied or none of them are.
  5. Change tracking on the client is good enough and re-downloading updated server tables doesn’t take too long.
  6. You developers don’t mind writing some sync code.
  7. Be able to execute SQL and Stored Procedures directly against SQL Server via IIS.

If your solution meets the criteria in the list above, you’re probably a good candidate for using RDA instead of Merge.  Are there any other choices out there?

Back at MEDC 2007, we announced a new data replication technology for devices called Occasionally Connected Sync that would sit somewhere between RDA and Merge.  OCS as it used to be called was renamed Sync Services for ADO.NET and then was eventually merged into the Sync Framework. 

The Sync Framework is a developer-focused technology:

  1. Supports conflict resolution.
  2. Change tracking on the server as well as the client so that only data differences are exchanged.
  3. Peer to Peer sync in the forthcoming v2 of Sync Framework.
  4. Sync with databases other than SQL Server.
  5. Best suited for SSCE running on a desktop or laptop.

The clearest differentiation that the Sync Framework has over Merge is its provider model which allows it to sync with other ADO.NET databases like Oracle or DB2.  SQL Server supports built-in P2P Transactional replication and v2 of the Sync Framework will allow you to do this via WCF.  If you development team doesn’t mind writing lots of sync code and needs to support scenarios like synchronizing with other databases from SSCE on the desktop, then the Sync Framework might be the way to go for you.  I wouldn’t yet recommend the Sync Framework for device sync since its wire protocol is currently based on the DataSet which may cause out of memory errors on Windows phones with limited working sets.

So where does this leave RDA?

The reason I’m writing this blog post is because time and time again I run into customer sync scenarios that don’t always need the power of Merge or the extra flexibility of the Sync Framework.  Most field service applications follow the same kind of pattern:

  1. Lots of download-only lookup/reference tables that aren’t changed by the user.
  2. Tables that are pushed down to the device that tell a user where to go and what to do.
  3. Tables (sometimes empty) that are used to capture data from the user in the field that are upload-only.

These kinds of schemas don’t require conflict resolvers or server change tracking and are therefore well suited for RDA. 

What’s the big benefit of using RDA if a sync scenario meets its criteria?

  1. You won’t modify SQL Server’s schema with GUIDs and Triggers.
  2. You won’t degrade the performance of SQL Server by having it track changes and maintain extra metadata.
  3. You will have the fastest and most scalable sync solution with least amount of hardware.
  4. Time to market is shorter.

The big takeaway here is that I want you to consider your sync solution carefully before choosing a technology.  If your customer’s needs are met by RDA, then you should use it and reap the benefits of developing and deploying a simpler solution with fewer moving parts.

Remember Occam's Razor.

-Rob

Managed Gestures

Touch-ability is one of the most important new features of Windows Mobile 6.5.  As many of you know, we released Gesture APIs for C++ developers earlier this summer.  Thanks to the hard work of folks like Maarten Struys, Alex Yakhnin and Ron Buckton, we now have gesture support for the .NET Compact Framework.  You can download Maarten's code from http://www.dotnetfordevices.com/forum.html#376 and you can head on over to http://code.msdn.microsoft.com/gestureswm to download a sample solution for VS 2008 as well as a managed assembly from Ron and Alex.  I just took the sample code for a spin and the Gesture and Physics samples work like a champ!  The ability to Pan and Flick will add a new level of sophistication to the Windows Mobile 6.5 apps you’ll be building for you customers.

 

Best Regards,

Rob

Microsoft and Nokia Form Global Alliance to Design, Develop and Market Mobile Productivity Solutions

The worldwide leader in software and the world’s largest smartphone manufacturer have entered into an alliance that is set to deliver a groundbreaking, enterprise-grade solution for mobile productivity. Today, Microsoft Business Division President Stephen Elop and Nokia’s Executive Vice President for Devices Kai Öistämö announced the agreement, outlining a shared vision for the future of mobile productivity. This is the first time that either company has embarked on an alliance of this scope and nature.

Under the terms of the agreement, the two companies will begin collaborating immediately on the design, development and marketing of productivity solutions for the mobile professional, bringing Microsoft Office Mobile and Microsoft business communications, collaboration and device management software to Nokia’s Symbian devices. These solutions will be available for a broad range of Nokia smartphones starting with the company’s business-optimized range, Nokia Eseries. The two companies will also market these solutions to businesses, carriers and individuals.

Both Microsoft Corp. and Nokia possess a rare combination of enterprise experience and consumer understanding and, in addition to the collaboration on existing software and services, will use these assets to jointly design a range of new user experiences for future Nokia devices. These experiences will be identified together, and will be created by dedicated teams inside both companies to better meet the growing needs of the mobile professional.

“With more than 200 million smartphone customers globally, Nokia is the world’s largest smartphone manufacturer and a natural partner for us,” said Elop. “Today’s announcement will enable us to expand Microsoft Office Mobile to Nokia smartphone owners worldwide and allow them to collaborate on Office documents from anywhere, as part of our strategy to provide the best productivity experience across the PC, phone and browser.”

“If you are going to provide a seamless and integrated productivity experience on a mobile device, Microsoft is an ideal partner,” said Öistämö. “Together with Microsoft, we will develop new and innovative user experiences for employees of small and large businesses alike, ensuring Nokia’s smartphones are an integral part of the office and home-office environment, and addressing the significant opportunity in mobile enterprise productivity.”

This announcement builds on the existing work Nokia is doing by optimizing access to e-mail and other personal information with Exchange ActiveSync. Next year, Nokia intends to start shipping Microsoft Office Communicator Mobile on its smartphones, followed by other Office applications and related software and services in the future. These will include:

The ability to view, edit, create and share Office documents on more devices in more places with mobile-optimized versions of Microsoft Word, Microsoft PowerPoint, Microsoft Excel and Microsoft OneNote

Enterprise instant messaging and presence, and optimized conferencing and collaboration experience with Microsoft Office Communicator Mobile

Mobile access to intranet and extranet portals built on Microsoft SharePoint Server

Enterprise device management with Microsoft System Center

“Having these two major players cooperating at this level will help us continue to meet our customers’ needs and reinforces our future business mobility strategy,” said Diane Sanchez, head of Telefonica USA.

“The scope of the alliance between Microsoft and Nokia, and potential value for the enterprise and individual is significant,” said Stephen Drake, VP of Mobility & Telecom at IDC. “By bringing Microsoft’s productivity solutions to Nokia’s large customer base, the two companies should be better able to serve the needs of the growing mobile worker population, which IDC estimates to reach 1 billion worldwide in 2011.”

Enterprise Data Synchronization with Microsoft SQL Server 2008 and SQL Server Compact 3.5 Mobile Merge Replication

I’m happy to say that my latest book is now available on Amazon @ http://www.amazon.com/Enterprise-Synchronization-Microsoft-Compact-Replication/dp/0979891213/ref=sr_1_4?ie=UTF8&s=books&qid=1248893911&sr=1-4.
With the world's largest organizations rolling out tens of thousands of Windows® phones, laptops, tablets and Netbooks to empower their respective mobile workforces, the ability to create mobile line of business solutions that support large numbers of users is absolutely critical. In my fourth book on mobile infrastructure and development, I show you how to take the SQL Server data you use to run your organization and make it available to all of your mobile employees.
Step-by-step, I’ll walk you through the process of building a secure, performant, n-tier mobile synchronization architecture designed to scale to thousands of users. You'll also learn how to create occasionally-connected .NET applications designed to thrive in unreliable wireless conditions.

Book Cover

 

  • Learn how to "Mobilize" your organization by making your enterprise data available to employees carrying Windows® phones, laptops, Netbooks and tablets in the field.

  • Learn how to build an N-Tier Mobile Merge Replication infrastructure that will scale to thousands of users.

  • Learn how to create occasionally-connected .NET applications designed to thrive in unreliable wireless conditions.

  • Learn best practices in security, reliability, performance, load-balancing, reverse proxy and hardware configuration.

  • Learn how to implement this technology in real world scenarios like supply chain management, retail, sales force automation, healthcare and emergency management.

Keep in mind that the knowledge you gain from this book didn’t come from me dreaming this stuff up in an Ivory Tower.  It came from building some of the worlds largest and most complex data synchronization systems for the world’s largest companies.  In addition to the hands-on experience that went into this book, I’d also like to thank some of my colleagues for their invaluable contributions:
  • Liam Cavanagh is a Senior Lead Program Manager for Microsoft’s Sync Framework and Cloud Data Services and he wrote the forward.

  • Catherine Wyatt is the Managing Editor for Hood Canal Press who made the publishing of the book possible.

  • Darren Shaffer is the CEO of Handheld Logic and he wrote the Chapter on building the Mobile Subscriber. 

  • Michael Jimenez is a Mobility Architect at Microsoft and he wrote the Appendix that shows you how to create an ISA Server 2006 Reverse Proxy to publish your sync infrastructure to the Internet.

It’s my sincere hope that this book will encourage you to un-tether your workforce from their desktop computers and boost your organization’s agility by pushing out critical business functions to the point of activity where employees are empowered to make timely decisions and perform tasks that best serve the interests of their customers and their company.
This repudiation of the traditional “connected” software application model increases customer satisfaction, boosts worker efficiency, reduces “missed opportunities” and results in cost savings as “un-wired” employees get their jobs done wherever they happen to be.

Best Regards,
Rob
Rise of the Psuedo Smartphones

What do the following feature phones have in common?

  • LG Dare
  • LG Voyager
  • LG Versa
  • LG enV Touch
  • LG Rumour 2
  • LG Lotus
  • LG Neon
  • LG Xenon
  • LG VU
  • Samsung Alias 2
  • Samsung Gravity
  • Samsung Behold
  • Samsung Highlight
  • Samsung Memoir
  • Samsung Propel
  • Samsung Rant
  • Samsung Exclaim
  • Samsung Instinct
  • Samsung Magnet
  • Samsung Eternity
  • Samsung Impression
  • Sanyo SCP-2700
  • AT&T Quickfire
  • Pantech Matrix
  • Motorola Karma

They include features like:

  • High-Megapixel Cameras w/Zoom
  • GPS
  • Touch Screen
  • QWERTY Keyboards
  • Play Music
  • Play Videos
  • Web Browser
  • Email
  • Games
  • Apps
  • Instant Messaging
  • 3G
  • Stereo Bluetooth
  • Video Capture
  • SD Card Storage
  • Calendar
  • Contacts
  • Quad-Band GSM
  • Voice Dialing
  • Alarm
  • Calculator
  • Photo Album
  • SMS
  • MMS
  • Wi-Fi
  • Internet Tethering
  • Slide-out Keyboard
  • Turn-by-Turn Navigation
  • Push to Talk
  • Radio
  • Hi-res Graphics
  • Streaming XM/Sirius
  • Mobile TV
  • Java
  • Facebook
  • MySpace

We consider phones with advanced mobile operating systems like Windows Mobile, Blackberry, iPhone, Symbian, and WebOS to be Smartphones.  When I look at the list of features above, I think most people in world would have a hard time distinguishing between what we call Smartphones and the rising tide of super-charged feature phones.  At a 30,000 ft level, a published API and development tools that allow you to create rich applications to access databases and remote servers may be the only distinction.  Of course that would be a slight againt Java ME that's found on over a billion feature phones.  I would venture to guess that 99% of the buying public can't tell the difference and may not even care as long as the price is right.

The big takeaway is that the large chasm that used to exist between feature phones and Smartphones has diminished dramatically.  In the coming years, Smartphone OS and hardware manufacturers have no choice but to innovate in a big way in order to put some distance between themselves and the clones attacking them from below or risk becoming commoditized and irrelevant.

- Rob

MemMaker for the .NET Compact Framework

Does everyone remember the good old days of DOS when we used to spend our time making more of the 640 KB memory space available for our drivers, programs, TSRs and even Windows?  Things like QEMM, HIMEM.SYS and EMM386.EXE bring back fond memories for me.  We had this one slot and Billg said we’d never need more than 640 KB.

DOSMem

Some of us even switched to OS/2 which could give us 740 KB to our DOS sessions while providing them with preemptive multitasking.  Yes, I could run multiple DOS games in multiple windows simultaneously with no degradation.  Wow, now I had a bunch of crash-protected slots each with 740 KB of memory.

dos

 

If you fast forward to today, you’ll see that Windows CE 5.0 and Windows Mobile 6.x shares some commonalities with their forefathers from the 80’s and 90’s.  The 32-bit embedded operating system that we rely on to power our Windows phones is made up of a bunch of slots.  The mobile applications that you build run inside one of these slots and unlike DOS with its 640 KB memory space, your app gets 32 MB of virtual memory space.  But just like with DOS, you don’t get access to the whole space because other things like system DLLs are already eating into your free virtual memory. 

Many of you might not care because you build simple apps that use very little memory.  On the other hand, most of the people and organizations I work with build the largest, most memory-intensive applications ever seen on the mobile device.  Needless to say, these folks aren’t too pleased that they don’t get the whole 32 MB of virtual memory that’s coming to them.  They probably wish they a utility like QEMM or MemMaker to put things in high memory.

I recently met with a good friend of mine who wanted to share some interesting findings with me.  Keep in mind, not only do I consider this person and his colleagues to be some of the top Compact Framework developers in the world, his team members designed and developed of one of the world’s largest, most complex managed apps running on a Windows Mobile device.  Like many organizations that have built very large Windows Mobile applications, free virtual memory issues and the "DLL Crunch" have deprived this app from of all the memory it would like to have.  One of the architects on this "Dream Team" noticed that by keeping their application’s EXE empty and putting all the forms, code, resources, and data in managed DLLs, he reduced the amount of virtual memory his app uses inside its slot while at the same time taking advantage of memory outside the slot in the 1 GB shared memory area.

To help you visualize this, I’m going to show you 2 pictures of the Windows Mobile process slots running a Compact Framework application two different ways.  The virtual memory viewer you see running in the emulators below shows the 32 slots in the User space of the OS.  Everything in Red is free virtual memory, Blue is committed memory and Green is reserved.  Slot 1 is crammed full of ROM DLLs and you can’t help but notice the area of Blue at the top of every other slot.  That’s space out of everyone’s slot being used by system and other native DLLs which means nobody’s going to get their fair share of their 32 MB slot space.

On the left you’ll see a NETCF app called StandardExe.exe running in slot 14 of the operating system.  This simple managed EXE has a 2.25 MB bitmap bound to it as a resource and a single form that compiles to the same size as the bitmap inside it.  If you look at the picture on the left, you’ll see a 2.25 MB Blue area coming up from the bottom of slot 14.  This represents the space being taken up by the EXE.

StandardSM      OptimizedSM

On the right a NETCF app called OptimizedExe.exe running in slot 11 of the operating system.  This managed EXE is completely empty.  The Main function calls into a static class of a managed DLL and that’s it.  No mas.  This results in an EXE with a file size of 5 KB.  In the managed DLL we have the same 2.25 MB bitmap bound to it as well as a simple form.  This compiles into a 2.25 MB DLL called OptimizedDLL.dll.  When you look at the picture on the right, you’ll be hard-pressed to see any Blue area coming up from the bottom of slot 11.  A closer look reveals the 2.25 MB DLL is nowhere to be found either.

This is pretty cool and has the potential to unleash the largest, most powerful games and applications Windows phones have ever seen.  So the big question is, how is this happening?  Is it magic? 

Those of you who have read Steven Pratschner’s blog know that the Compact Framework memory maps your managed EXE and DLLs into the 1 GB shared memory area outside the slot your app is running which is cool.  What you may not know is that the OS automatically blocks out virtual memory at the bottom of your slot that’s the same size as your EXE.  So even though the CLR is in control of app execution and is giving you lots of love by putting your managed EXE up in the shared memory area, Windows CE takes away a valuable chunk of memory because it thinks that’s where your EXE is running.  Guess what, your app isn’t running there and it’s not native.  For those of you with giant managed EXEs, you’re losing out on a lot of virtual memory in your slot that could be put to good use.  So the first lesson here is to do what Brian did and make your EXE nothing but an empty stub used to launch your app which really lives inside managed DLLs.

Your empty EXE code should look like the following:

using System;

namespace OptimizedExe
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [MTAThread]
        static void Main()
        {
            OptimizedDLL.StartUp.Main();
        }
    }
}

Your DLL code should look like the following:

using System;
using System.Windows.Forms;

namespace OptimizedDLL
{
    public class StartUp
    {
        public static void Main()
        {
            Application.Run(new Main());
        }
    }
}

So now that you’ve learned how to instantly give your managed apps more memory by beating Windows CE at its own game, let’s talk about the curious case of your managed DLL.  If you’ve read Reed Robison’s blog discussion about Slaying the Virtual Memory Monster, you know that DLLs seem to take up everyone’s virtual memory from the top of the slot down which doesn’t sound too fair.  DLLs keep pushing their way down everyone’s slot causing something we call the “DLL Crunch” as free virtual memory get’s squeezed between the DLLs and EXEs.  I’ve got some good news for you.  Managed DLLs do not exhibit this same behavior.  In fact, not only do they not use up memory in all the other slots of your Windows phone, they don’t even push downward on the memory of your own slot.  How could this be?

Managed DLLs are not DLLs.  The CLR just treats them as files that it memory maps into the 1 GB shared memory area.  To the Compact Framework, managed EXE and DLL assemblies are just files full of IL that it maps outside your process slot.  So now you know where the 2.25 MB bitmap that we bound to OptimizedDLL.dll is.  It’s beyond the 32 MB barrier of your slot and therefore not using up your valuable memory. 

So if I follow this new pattern for NETCF development, will my slot ever have virtual memory allocated or do I get a free lunch?

While there’s no free lunch, you did get a buy one get one free discount.  The JIT compiler is running in your slot and it pulls in IL from the 1 GB space as needed to compile the current call stack.  Resources that aren’t designed to be compiled or executed will never be pulled down here.  The GC Heap is in your slot and that’s where your currently allocated Objects and instance variables are hanging out.  Your slot maintains a 64 KB Stack for every Thread your app spawns and the AppDomain Heap maintains a representation of the data structures found in your assembly’s IL.

image

So what are the big takeaways here?

You can eliminate the erroneous and wasted allocation of EXE virtual memory in your slot by following the pattern of using an empty stub managed EXE to kick off your application.  Windows CE will now only block out 5 KB of memory.

You can take better advantage of the 1 GB shared memory area by putting your entire application inside managed DLLs.  This will make your app a good neighbor by not creating the dreaded “DLL Crunch” for all the other apps on your Windows phone.  It also reduces the amount of memory that has to be allocated inside your slot.

This new pattern of managed development on the Windows Mobile platform is a true breakthrough in memory management.  Come join me at Tech Ed 2009 this May in Los Angeles for a complete deep dive on this new way of building memory-intensive games and applications.

- Rob

Windows Mobile 6.5 is getting Stylish

Check out one of the great new device themes from designer Isaac Mizrahi!

Mizrahi

On the technical side of this, we’ve updated memory allocation so that switching Today screens and backgrounds repeatedly does not cause animations to become slower, the background image to become black, or the device to become unresponsive.  This is all good!

-Rob

Technorati Tags:
Microsoft Unveils Its Developer Strategy for the Next Generation of Windows® Phones

Familiar tools, a large worldwide customer base and transparent policies will allow mobile developers to innovate and generate new revenue opportunities with Windows Mobile 6.5 and Windows Marketplace for Mobile.

Today we’re announcing new details about how developers can build and sell applications for Windows® phones through Windows Marketplace for Mobile, the recently announced application marketplace available with the Windows Mobile 6.5 operating system.

Developers who sell applications through Windows Marketplace for Mobile will receive 70 percent of the revenue from the sales of each application. In addition, they will be able to set the price for their applications in each market, maximizing their revenues based on targeted pricing strategies. Developers can also choose to distribute their applications at no cost. Up to five application submissions to Windows Marketplace for Mobile is included in the introductory annual registration fee of $99 (U.S.). Each additional submission within the annual period will cost $99 (U.S.). The registration fee is waived for student developers who want to reach Windows® phones customers, through enrollment in the Microsoft DreamSpark program.

With Windows Marketplace for Mobile available in 29 countries, developers will be able to tap into a broad international customer base. At the same time, Microsoft will continue working with developers to ensure that their applications run optimally on Windows® phones by running a rigorous certification and testing process before applications go to market. Developers will be able to see detailed feedback during and after the certification process of their application on the Windows Marketplace for Mobile developer portal. Ultimately this enables developers to devote more time to writing innovative applications, and less time trying to navigate the approval process. Developers will have access to all details once the registration doors open in the spring, and will be able to start submitting their applications later this summer.

Developers can utilize familiar tools and technologies to build unique experiences for the Windows Mobile platform through Windows Marketplace for Mobile, including the Windows Mobile 6 SDK, .NET Compact Framework 3.5, and SQL Server Compact 3.5.

With more than 20,000 applications already in market, Windows Mobile is among the most popular platforms for developers. Windows Mobile 6.5, the next generation of the Windows Mobile operating system, will allow developers to build innovative mobile applications without having to learn new skills or programming languages, by leveraging familiar desktop and server development tools such as Win32, Active Template Library and Microsoft Foundation Classes (Visual C++), Visual C#, Visual Basic .NET, ASP.NET and asynchronous JavaScript and XML (AJAX).

Let’s get after it!

-Rob

Windows Mobile 6.5 Announced at Mobile World Congress

Steve Ballmer and Andy Lees announced Windows Mobile 6.5, My Phone, and Marketplace in Barcelona this week.

Check out Engadget's video walkthrough of Windows Mobile 6.5 running on a Touch Diamond 2:

http://www.engadget.com/2009/02/16/windows-mobile-6-5-walkthrough-with-engadget/

-Rob

Mobile Architecture Pocket Guide v1.1

Just wanted to let everyone know that version 1.1 of the Mobile Architecture Pocket Guide is now available on CodePlex at http://www.codeplex.com/AppArch/Release/ProjectReleases.aspx?ReleaseId=19798.  This is the first patterns & practices update to this guide since 2002 so it's a welcome sight to to have it out there for all our Windows Mobile developers.

I've spent the last couple of months working with J.D. Meier, Rabi Satter, Rob Boucher and the rest of the P&P team to tune, tweak and update the new Mobile Architecture Pocket Guide to ensure that it's as accurate and relevant to today's Windows Mobile platform and runtimes as possible.  The guide's chapters include:

  • Ch 01 > Mobile Application Architecture
  • Ch 02 > Architecture and Design Guidelines
  • Ch 03 > Presentation Layer Guidelines
  • Ch 04 > Business Layer Guidelines
  • Ch 05 > Data Access Layer Guidelines
  • Ch 06 > Service Layer Guidelines
  • Ch 07 > Communication Guidelines
  • Ch 08 > Deployment Patterns

Our goal is to empower our Windows Mobile developer community as much as possible, and while this guide may seem like it's targeted exclusively to developers, I ensured that the IT Pro side of the house is accommodated as well.  Mobile infrastructure elements of this guide include System Center Mobile Device Manager (Deployment), SQL Server (Sync Services + Merge), IIS (Web Services + Sync + WCF), Exchange (WCF Store and Forward) and Active Directory (Auth).

Download it, take if for a spin, and give us your feedback so we can keep improving it.

- Rob

The Desktop Web Comes to Windows Mobile

Internet Explorer Mobile 6 transforms the web for devices based on Windows Mobile 6.1.4.  A rich, desktop web with flicking, panning and zooming is coming to Windows Mobile.  Fast, robust Javascript support is included ala the IE 8 Javascript engine.  Plugin support includes Flash Lite 3.1, Silverlight, and the embeddable Media Player.  Device developers don't have to wait for shipping devices in order to get started.  The Windows Mobile 6.1.4 Emulator Images can be found at http://www.microsoft.com/downloads/details.aspx?FamilyID=1A7A6B52-F89E-4354-84CE-5D19C204498A&displaylang=en.

  • New emulator image resolutions:
    Windows Mobile 6.1.4 Standard
    DPI: 131 - Resolution: 320 x 320 pixels
    DPI: 131 - Resolution: 400 x 240 pixels
    DPI: 131 - Resolution: 440 x 240 pixels
  • Windows Mobile 6.1.4 Professional
    DPI: 96 - Resolution: 240 x 400 pixels
    DPI: 192 - Resolution 480 x 800 pixels

Take that Webkit!

-Rob

See you in Barcelona for Tech Ed EMEA Dev

Tech Ed EMEA

Looking forward to seeing lots of familiar faces and meeting new ones starting December 10th at Tech Ed EMEA!  While I ran the Windows Mobile track for Tech Ed North America last June in Orlando, this time around I'll just be delivering a couple of presentations and spending most of my time helping empower delegates to create incredible mobile applications.  I'll be delivering the following breakout sessions:

 
MBL301 What's New in the Windows Mobile Line of Business Solution Accelerator 2008 November 10 16:00 - 17:15 Room 121
This session walks through the new features that we have added to the Windows Mobile Line of Business Accelerator 2008; features such as adapting your application to any device or screen size with a single binary, sync services, store and forward, and advanced data access objects with Microsoft .NET CF 3.5.
 
MBL310 Mobilize your Enterprise and Achieve Global Scalability with Windows Mobile and SQL Server Compact November 11 15:15 - 16:30 Room 121
With the world's largest organizations rolling out tens of thousands of Windows Mobile devices to empower their respective workforces, the ability to create mobile line-of-business solutions that can support large user populations is critical. Based on his third book on Windows Mobile development, Rob Tiffany shows you how to take the Microsoft SQL Server data you use to run your organization and make it available to all your mobile employees. Utilizing the performance, scale-out, and filtering capabilities of Merge Replication Republishing, Rob shows you how to build an n-tier mobile synchronization architecture designed to scale to hundreds of thousands of devices. Take the guesswork out of mobilizing your enterprise by tapping into the experience of one of the world's foremost authorities on Windows Mobile infrastructure and development.
 

See you there!

- Rob

 

New Resco MobileForms Release for NETCF

Just in case all you mobile developers didn't hear, Resco has released Volume 3 of their MobileForms Toolkit 2008.

Resco MobileForms Toolkit contains:

  • Resco CustomKeyboard for .NET – flexible control supporting custom keyboard layouts
  • Resco SmartGrid for .NET - powerful grid control with built-in auto edit capabilities
  • Resco AdvancedList for .NET - professional list control suitable for small displays of mobile devices
  • Resco AdvancedTree for .NET - featured tree control excellent for displaying tree-organized data
  • Resco DetailView for .NET - elegant and quick way of creating user input forms
  • Resco CompactChart for .NET - charting control supporting 5 chart types
  • Resco OutlookShortcutBar for .NET - popular shortcut control, common to all modern applications
  • Resco OutlookWeekCalendar for .NET - day/Week appointment scheduling control
  • Resco OutlookMonthCalendar for .NET - month/Year scheduling control
  • Resco OutlookDateTimePicker for .NET - modern version of common control providing advanced styles
  • Resco InkBox for .NET - ink control suitable for quick notes or signatures
  • Resco ImageBox for .NET CF - versatile image control supporting various graphic formats
  • Resco ImageButton for .NET CF - adjustable, modifiable and skinnable button
  • Resco Audio for .NET CF - powerful library for playing and recording audio
  • Resco Zip for .NET - industry standard compression library

For more information about Resco MobileForms Toolkit, visit http://www.resco.net/developer/mobileformstoolkit/default.aspx.

Additionally, they'll be at Tech Ed EMEA in Barcelona exhibiting at booth E12 so please check them out to see if their controls meet your mobile development needs.

-Rob

More Posts Next page »

Search

This Blog

Syndication

Page view tracker