Welcome to MSDN Blogs Sign in | Join | Help
Giant Robot Lovers Unite :)

Okay, I found this on CNET last night and thought it was kinda cool...so I'm posting it here :)

Microsoft Windows Mobile Consumer Solution Accelerator

Here is a great set of sample code and a VS project which steps you through some cool ideas around how to create you own cool apps in the consumer space while using some of the cooler features of Windows Mobile devices (like location, Outlook Mobile, and Virtual Earth).

You can use this as a great education piece, or you can use this to spawn your own ideas :)

More Memory for ALL in WM 6.x

Now that the Windows Mobile 6.5 DTK is available, you are probably starting to discover some of the new features and APIs available to you.  There is pretty cool stuff in there to move us forward from 6.1…things like Gestures (see the DTK samples since the docs are still coming) and Widgets.  More importantly, Windows Mobile Marketplace is going to be on every 6.5 device and if you are an ISV, bells and whistles are nice, but an effortless consumer connection to sell your software is HUGE.

 

It you were a mobile developer attending Tech-Ed this last round in LA, you know it was special.  Not only was it a the first real depth series on 6.5, but I think it might have been the best event we’ve ever done in terms of session content and speaker quality (I can say this since I didn’t actually speak this time!).  There were no watered down mobile sessions…lots of info on topics like Location, Advanced UI, Motion Tips & Tricks, WCF in NETCF, SQLCE, etc… it was all great stuff.  If you attended and missed any sessions, you can watch most of them online via Tech-Ed Online.  Windows Mobile was the highest rated track at the event…credit to the partners and community who contributed to make it a success.  Many of the speakers were all the guys(and gals) who have been silent mentors to me.  You all did a fantastic job.  THANK YOU.

 

As I was sitting in Rob Tiffany’s session on “Breaking out of the 32MB Barrier with .NETCF”, he stirred my memory concerning another major improvement in 6.x that nobody (except “the man” Doug Boling) has really been talking about yet… memory improvements for native devs.  First let’s recap Rob’s message…  The technique he outlines is a clever approach to maximize available Virtual Memory space for managed apps.  It basically says, use a super light stub of an EXE and then package all your code into managed DLLs.  That keeps your EXE footprint very small and because NETCF uses large memory areas to map the DLLs into memory, you maximize your VM address space for the runtime.  You’re still subject to the 32MB limits, but because you have minimized the footprint of the EXE and DLLs in Slot 0, it’s almost all free for the managed heap which means you get a very large playground for app development.  This is a technique that works for all versions of WM…not just 6.5.  Managed Developers cheer!

 

Well that’s cool for managed developers, but… what about native developers?  What about managed code that is p/invoking native DLLs?

 

So check this out… with every release of WM, there are usually little “tweaks” added by our platform gurus to squeeze more out of available memory.  Maybe they allocate stacks out of another slot to help device drivers, load resource DLLs into slot 63, or flag a way to keep a specific DLL from reserving VM space in another process.  These changes are largely invisible to ISVs and commonly geared to help device makers.  But here is one change you may notice…especially if you are building beefy apps.  Starting with Windows Mobile 6.1, loading native DLLs larger than 64k will often end up in slot 60 and 61.  That’s a 64MB area in high memory that can now be used to get DLLs out of slot 0 and free up a ton of Virtual Address space in your processes.  The OS will attempt to load any DLL over 64k into upper slots… falling back down to lower slots when things are full.  Remember DLL crunch?  You might not after moving to WM 6.x…

 

Let’s take a look… 

It’s hard to directly contrast 5.x and 6.x device memory because there are so many variables, so I’m just going to look at a simple native app that pulls in a bunch of native dlls for comparison.  The important thing to note is how much space in slot 0 is being used.  Slot 0 is the crunch zone, so anything you get out of there is a good thing.  I’m going to build a native DLL with Visual Studio.  By default, a Hello World kind of DLL is only about 4K, so I’m going to bloat it out a bit by statically linking in a bunch of runtime code.  I basically want a bunch of small and large DLLs that I can examine in Slot 0.  So I build SimpleDLL_1, SimpleDLL_2, SimpleDLL_3, etc.  The first three are 4K, then second three are much larger (1312K).  Then I load the into my little native app called Loader.exe using LoadLibrary and compare the footprint of Slot 0 across WM emulators for v5.0, v6.1, and v6.5.  Check this out..

 

On WM5, as expected… I see all the DLLs crowding into Slot 0 (under address 0x02000000)…each DLL pushing lower..crowding my heap and reducing my space to load others DLLs for everyone.

clip_image001

On WM6.1, and WM 6.5, something very different happens…notice that the three bigger DLLs are … gone!  Only those tiny 4K DLLs were pulled into Slot 0 and everything is sitting much higher in Slot 0 memory (which leave more room for your code).

clip_image002

 

If you look higher in memory, you can see that they did in fact load, but they are taking advantage of some memory optimizations you get with WM 6.x to load large components high and free up Virtual Address space in Slot 0. 

clip_image003

What does this mean?  It means that large apps have more memory space than ever to get things done.  It also means better stability for devices and applications across the board since it reduces DLL crunch and Virtual Memory pressure.  Mike Francis asked me if the Virtual Memory Monster was dead now…  well, let’s just say it’s walking with a big limp and probably won’t be bothering anyone today.

 

Cheers,

Reed

 

 

Windows Mobile 6.5 Emulators available for download...

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=20686a1d-97a8-4f80-bc6a-ae010e085a6e

The Windows Mobile 6.5 Developer Tool Kit adds documentation, sample code, header and library files, emulator images and tools to Visual Studio that let you build applications for Windows Mobile 6.5. This document contains important information about this package. For general information about writing software for Windows Mobile, please see the Windows Mobile Developer Center. The Windows Mobile 6 SDK must also be installed in order to use any of the Windows Mobile 6.5 Gesture API or samples. Windows Mobile 6.5 Developer Tool Kit comes with the following Emulator Images:

  • Windows Mobile 6.5 Professional Square Emulator
  • Windows Mobile 6.5 Professional QVGA Emulator
  • Windows Mobile 6.5 Professional WQVGA Emulator
  • Windows Mobile 6.5 Professional VGA Emulator
  • Windows Mobile 6.5 Professional WVGA Emulator
  • Windows Mobile 6.5 Standard Square Emulator
  • Windows Mobile 6.5 Standard QVGA Emulator

Available locales:
0804 CHS Chinese Simplified
0409 USA English
0407 GER German
040c FRA French
0410 ITA Italian
0c0a ESN Spanish

A new set of APIs is being introduced that will enable application developers to take advantage of the new Windows Mobile 6.5 touch gesture framework. The gesture APIs allow an application to handle touch gesture input and provide a visually consistent experience with the rest of the device UI. Note that the gesture APIs are only available on the Windows Mobile Classic and Professional SKUs. The headers and libraries are installed in the Windows Mobile SDK\Pocket PC\ folder. Samples that make use of these APIs are installed into the Windows Mobile 6.5 Developer Tool Kit\Samples\ folder.

Windows Mobile developer support in VS2010? YES!!!

Recently, because of an ill-worded product description in the VS2010 Smart Devices up on MSDN, MANY folks have been going crazy saying "it's the end of the world for Windows Mobile."

Well, I am here to tell you that that could NOT be farther from the truth.

There will be support for Windows Mobile devolvement in Visual Studio 2010.  You have to remember that the release of VS2010 is a BETA...not all things are baked or ready to be shipped with it.

Also, remember that every version of the Windows Mobile SDK has, to date, shipped out-of-band from the major VS release.  So, this really should not be a big surprise.

As for the official line:

We are absolutely committed to making Visual Studio a great development tool for the Mobile developer. For existing Visual Studio 2008 developers, we will be releasing a new Windows Mobile 6.5 emulator in the upcoming months [weeks hopefully - Hegenderfer] that works with the Windows Mobile 6 SDK. This provides a great solution for existing developers. We will deliver Mobile device tooling for Visual Studio 2010 but we can’t share details at this time.

I hope this helps reassure some folks :)

Ramp Up with Windows Mobile

What Is Ramp Up?

Ramp Up is a free, online, community-based learning program, with a number of different tracks that will help you build your portfolio of professional development skills. Ramp Up has a solid foundation of premium technical content from subject-matter gurus, and provides easy-to-access content in a variety of forms that guide you in learning the important skills. Join Ramp Up (it's free!) and help advance your career - click on a track now to start!

Check it out… and many thanks to the great contributors who helped put it all together!

http://msdn.microsoft.com/en-us/rampup/dd807370.aspx

Level 1: Mobile Development Introduction
In this module, we will discuss how to install the development tools in the correct order. Then we’ll concentrate on the differences between developing desktop applications and developing Windows Mobile applications. Once you have all the tools installed, we’ll talk you through developing your first Windows Mobile application.


Level 2: Device Emulators
We’ll begin this module with an overview of different releases of Device Emulator. You will learn about specific features of Device Emulator 2.0 and Device Emulator 3.0. You will also get a guided tour around Cellular Emulator which allows to emulate cellular connectivity in conjunction with Device Emulator. As part of new features of Device Emulator 3.0 you will also learn about using Device Emulator Manager to control individual Device Emulators, either from inside Visual Studio 2008 or from within a desktop application through a COM object.


Level 3: Mobile Windows Forms Development
This module will start with an overview of basic Windows Forms Development, including information about different out of the box available User Interface Controls for both Windows Mobile 6 Professional and Windows Mobile 6 Standard devices. We will then move on to the challenges around developing a single application that can run on different devices with different form factors and how applications can adapt to different device capabilities by isolation of specific code and creating a factory model (define an interface for creating an object, but let subclasses decide which class to instantiate). Since your applications will always run on battery powered devices, you will also get a number of tips on how to be friendly to the battery to extend battery life as much as possible.


Level 4: Advanced Mobile Windows Forms Development
In this module, we’ll look at different possibilities for creating your own User Interface Controls, derived from existing controls or developed from Scratch. You will also learn how to re-use existing functionality that is available through Pocket Outlook (contact lists, appointments etc.) inside your own application. More and more Windows Mobile Devices ship with integrated GPS hardware. With Windows Mobile 5 and Windows Mobile 6 devices it is really easy to retrieve GPS location information and test location aware applications as you will see. Finally we’ll do an overview of a number of diagnostic tools that are available as a separate download: The .NET Compact Framework 3.5 Power Toys that will help you to find performance bottlenecks inside your applications.


Level 5: SQL Server CE Introduction
When working with data and mobile applications, SQL Server CE is a great way to quickly get productive. This module will begin with an overview of SQL CE. You will learn the basics around dealing with data on Windows Mobile Devices. Along with the introduction in SQL Server CE, and you will get information on how to access data programmatically inside your own managed applications.


Level 6: Security and Deployment
When developing Windows Mobile applications, there are different security policy considerations. This talk will cover some of the prominent security and deployment considerations for applications to run on Windows Mobile devices and how to make use of certificates to make applications trusted.


Level 7: Mobile Web Development
After a quick overview of mobile web development, we will discuss different options for developing mobile web apps, and different devices to support. We will also discuss advantages of these different technologies. From there, we’ll concentrate on web based applications, take a look at Visual Studio 2008 support and will focus in on ASP.NET 2.0. You will see how to identify on which device your application will run and what devices will support AJAX. You will also learn how to setup your device to get AJAX support working.

Windows Mobile Getting Good Press? No... :)

Windows Mobile: Alive and well -- and suitable for business

Computerworld, Michael Gartenberg, May 14, 2009

http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=9133099

Fun read.

Mobile Buzz at Tech-Ed

There is a lot of good stuff going on a Tech-Ed this week in LA.  In you are here, come by and see us at the Windows Mobile booths.  This is one of the first big events to really start sharing details and demonstrating the technology Windows Mobile 6.5.

Some highlights thus far…

·        Take your pick from several sessions that overview WM 6.5 and show off new features.  You can finally see the UI improvements in action and get a feel for the rich users experience behind this release.

·        The Windows Mobile Marketplace team is here!  Come by the Marketplace booth or attend one of the breakouts to get your Marketplace questions answered.  Feedback Welcomed!

·        Nickolas Landry spotlighted “The Windows Mobile Unified Sensor API” in his session earlier this week.  This is a handy library up on Codeplex that you can use to take advantage cool hardware like accelerometers and light sensors on popular WM devices.

·        Curious about this thing called a Widget?  There is a good Hands-On-Lab (HOL) that will have you up and writing your own widgets in 15min.    They are easy, they are connected, they are … well, Widgets and they are pretty cool.

·        Rob Tiffany published a post recently that covered some techniques to maximize available memory space with managed applications.  He followed it up this week with a session that covered this technique in depth.  This is good stuff, but we also haven’t talked enough about some major changes that occurred in the platform under 6.1 to automatically help with the old Virtual Memory Monster.  Doug talked about it here.  Net, net… “While execute-in-place(XIP) DLLs are still loaded from the top of Slot 1, any DLL that is larger than 64 KB and isn’t XIP is loaded in slot 60.  If the 32 MB of slot 60 fills up with DLLs, the OS uses slot 61 for the DLLs.   This additional 64 MB of DLLs space should go a long way in reducing the problem of too many DLLs in Windows Mobile systems.”    This is… HUGE.

·        Maarten Struys gave a smoking session on Creating Location-Aware Applications on Windows Mobile.  Maarten rocks…what else can I say. 

…and that’s just the first two days!

Cheers,

Reed

 

 

 

 

WM 6.5 and GAPI….going, going, gone…

We’ve been talking about it forever…deprecating GAPI, but it’s REALLY hard to take back anything once it’s in the wild.  With the release on WM5, we told ISVs to start making to move to DirectDraw and leave GAPI behind.  Most of you have done it.  Many, simply used it to easily handle keyboard input.  With WM 6.5, it’s official….bye bye GAPI.

If you were using GAPI to handle keyboard input, you need to make sure you make the switch to AllKeys.  See the WM Team post here for more info (Just Say No To GAPI).  This should be a minimal change for most developers as GAPI simply used these APIs internally in the GAPIOpenInput and GAPICloseInput routines.  If you have problems or questions, please let us know!

Stay tuned lot’s of new 6.5 stuff to in the pipe to talk about…

Cheers,
Reed

Windows Marketplace for Mobile is ready for ISVs :)

All, if you haven't seen, you can go to http://developer.windowsmobile.com/marketplace.aspx now and register to start selling your apps in the Marketplace.

If I were an app developer, I would register now and get in line first.  There will be a line-up as application ingestion starts, so you want to make sure you are at the head of the queue as we start rolling thru the certification process :)

Intercepting Mail using IMapiAdviseSink

mailman There is a lot of interesting stuff going on with Windows Mobile right now…unfortunately, I can’t talk about much of it (yet).  Hang in there…eventually the “hush” orders will be lifted and the posts will start. 

I owe you guys some cool stuff NOW though and you have been really patient waiting for some dev posts.  Go ahead, say it.. “You OWE US”.   I know…I do.  I have been in the dark cave at Microsoft we call “figure out what you can realistically do in a day and double that.”  I’m out for air and I’m digging back in to my bag of tricks for some stuff we can talk about NOW. Let’s see…

Here’s one that comes up from time to time with no sample I am aware of…how to programmatically intercept mail.  Intercepting SMS message is pretty easy.  We’ve had support for this back in the via SDK MapiRule Sample and then added support in NETCF to simple add an event handler.  Wow, that was easy.

So the next question becomes, how do I intercept email messages programmatically to do something cool?  What if I want to play a special ringtone or kick off some automated process for workflow.  It should be really easy, like SMS right? 

The NETCF guys never added a no-brainer message handler for email like they did for SMS, so you actually have to do a little work…in native code.  If you are on NETCF 3.5 and using Exchange, you could build something around WCF like David did with the Lunch Launcher.  If you are targeting the consumer market though, not everyone is using Exchange and you would really need an approach that had zero dependencies on the back-end.  MAPI provides this and to get it done, you just need to plug into IMapiAdviseSink.

I’m always a little stand-offish at SDK docs that refer me to some COM object that I’m supposed to wire up with no example…so let’s hack it out.

 

First we build a simple COM object that inherits from IMAPIAdviseSink and then implements OnNotify.  When OnNotify fires, we simply look for the fnevObjectCreated event to let us know that a new message has just been added and pull out the goodies.

The COM object part is standard stuff, so here’s what OnNotify might look like:

STDMETHODIMP_(ULONG) CAdviseSink::OnNotify (ULONG cNotify, LPNOTIFICATION lpNotifications)
{
HRESULT   hRes = S_OK;
 
if (!m_hWndParent) return 0;
 
// Advise events fire on a number of different events, so be sure you look for the MAPI_MESSAGE+object creation event
// and take some action when one arrives.
try
{
  for (ULONG i=0 ; i<cNotify ; i++)
  {
   hRes = S_OK;
   if (fnevObjectCreated == lpNotifications[i].ulEventType)
   {
    if ( lpNotifications[i].info.obj.ulObjType == MAPI_MESSAGE ) // Found a message, so grab it
    {
     // New message has arrived, so take some action...
     
     // The event can fire before the message is ready to read, so I inject a slight delay here to give the system
     // a second or two to process the new message before I try to read it. 
     Sleep(1500);

     // Process the new message
     GetMsg(&lpNotifications[i]);
    }
   }
  }
}
catch(...)
{
  MessageBox(NULL,L"AdviseFail", L"AdviseFail", MB_OK );
}
return 0;
}

What you do with the message is up to you.  I created a very simple GetMsg routine to throw a MessageBox with the message subject as the title.

void GetMsg(NOTIFICATION *pNote)
{
   HRESULT             hr;
   IMessage        *   pmsg        =   NULL;
   ULONG lType=0,val=0;
   ULONG  subjectprop[]    =   { 1, PR_SUBJECT };
   LPSPropValue subjectpropval;

   // Get the message stores table
   hr = g_pSession->OpenEntry(pNote->info.obj.cbEntryID, pNote->info.obj.lpEntryID,0,0,&lType,(IUnknown **)&pmsg);
   ASSERT(pmsg);

   // Double Check the props on the message for finer control of which types of messages/folders you want to handle
   // this example traps every new message...
   hr = pmsg->GetProps((LPSPropTagArray)subjectprop,MAPI_UNICODE,&val,&subjectpropval);
   if ( hr == S_OK )
   {
// *** DO SOMETHING HERE ***
// example: popup a message box with subject info, play some cool ringtone based on sender, etc.
if ( subjectpropval->Value.lpszW )
  MessageBox(NULL,subjectpropval->Value.lpszW, L"Message Intercepted", MB_OK | MB_TOPMOST | MB_SETFOREGROUND);
   }
   RELEASE_OBJ(pmsg);

   return;
}

From our main application, now we just do a simple MAPILogon, create our class, and hand it to the Advise method which tells it to listen for any newly created MAPI objects.

   hr = MAPILogonEx(NULL, NULL, NULL, NULL, &g_pSession);
   g_pSink = new CAdviseSink(hWnd,0);
   hr = g_pSession->Advise(0,NULL,fnevObjectCreated,g_pSink,&lConn);

That’s pretty much it.  I’ll attach the sample project for reference to this post if you want to play with it or see the working app.  Keep in mind, this sample is really basic and does no filtering.  That means if I send a message to myself, it fires twice!  Why?  Because a message is created when I author it, and another is created when I receive it.  You get a message on EVERY new message object.  In the real world, you would want to do some filtering.  You could modify the GetMsg routine to filter on sender, folder, etc. to make it “smarter”.  It’s up to you… go get creative.

Cheers,
Reed

This blog entry brought to you by Windows Mobile and 3G Internet Connection Sharing…because a PC shouldn’t be useless just because the WiFi is.

Developer Patterns for Saving Memory on Windows Mobile

Check out this new post over on Rob's blog around saving memory on Windows Mobile...very cool stuff :)

You can see him present this live at TechEd as well...

Windows Mobile Marketplace FAQ...and good news :)

The Marketplace team has just announced some more details around the 'Windows Marketplace for Mobile', which I think is great news:

 

Q: Do I need to pay the $99 fee again to submit an application update?

A: No, if your application has been previously certified and published in the catalog, you can submit subsequent updates without incurring any additional fees. The application update will be made available through Windows Marketplace to all customers that have downloaded your application in the past.

Q: I previously heard that you only had 7 days to submit a free update. Has this changed?

A: Yes, we originally communicated that only application updates submitted within 7 days of their publish date would benefit from a free submission. After talking to the developer community and better understanding the dynamics and frequency of application updates, we have decided to extend the original 7-day window and make it permanent. This means that if an application has been previously approved in the marketplace the developer can submit updates to it without incurring any additional fees.

 

WAHOO!

We hope to get a good FAQ around the Marketplace up on the developer.windowsmobile.com site ASAP, so hang tight.

Also, expect more details in the coming weeks and months around this at developer.windowsmobile.com...

Solid Code

Okay, here is a shameless plug for one of my good friends.  John Bruno wrote a great book called Solid Code that deals with the best practices around writing good code.

John is also the PM lead for Marketplace, so he knows a thing or two about efficient code:)

Tech Days and Windows Mobile Development

If you are planning on going to Tech Days, there will be a pretty good line-up of Windows Mobile sessions:

Developing Mobile Applications with Visual Studio 2005/2008

Abstract: 

Visual Studio 2008 brings lot of improvements for mobile developers, and Windows Mobile 6 SDKs tools that allow developers easier and faster solution development. This session will show you how to effectively develop Windows Mobile client applications. You will see some of the cool features that can be easily used in you applications, such as POOM integration, SMS interception, state and notification broker and camera integration. Session will be packed with live demos and code samples.

Using SQL Server Compact Edition for Data Storage and Synchronization in Mobile Applications

Abstract: 

This  session  explains how to program SQL Server Compact Edition 3.5 SP1 for use as a fast, queryable local data store. You will learn how to use SQLCeResultSet objects as the fastest way to access data in a SQL Server Compact Edition database, and outline how to use LINQ to Objects to access data from the database. Finally, you will learn how to use SQL Server Compact 3.5 as the client-side datastore for a data synchronization solution using merge replication or Microsoft Synchronization Services for ADO.NET solution, and some tips for effective usage.

Windows Mobile Performance and Power Optimization

Abstract: 

Windows Mobile Devices have a lot of processing power. However, when you are developing applications for Windows Mobile Devices you have to be aware of the fact that devices are battery powered and have less resources then desktop computers. In this demo filled webcast Maarten Struys explains how to create great performing applications that are not consuming too many system resources and that do not drain the battery. Using the ideas presented in this webcast not only allow you to create better applications, your end users will also get a better experience because your applications will look snappy and will help preserve battery life.

Win32 and .NET: For Windows Mobile, Which, When, and Why?

Abstract: 

The Windows Mobile platform offers two core APIs. Each has its strengths and situations when one makes sense over the other. This session provides a framework for selecting which API makes sense, when it makes sense, and why each choice makes sense for the given scenarios. This session provides details that will ensure that you never feel at a loss when encountering this question.

Windows Mobile Web and Widgets: Leveraging web technologies to build experiences for Windows Mobile

Abstract: 

The last few years have shown people the power of having a full-fledged web browser on a mobile device. From content providers building dedicated mobile sites, to cheaper mobile data tariffs, mobile devices have usher a new era of content an experiences available on the go. A new programming paradigm called mobile widgets has emerged in response to these recent trends. Widgets enable web developers to write application-like experiences that run outside of the existing browser, but are powered by the same technologies [HTML, JavaScript and CSS]. Gone are the days of building WAP sites. By leveraging the capabilities of a fully fledged browser on windows mobile, web developers can now build rich experiences for mobile devices without resorting to native/managed code. In this session, members of the windows mobile widget team will give you a sneak peek at the upcoming widgets platform. They will demonstrate how easy it is to develop widgets that mash up existing web technologies in novel ways.

Distributing and Monetizing Windows Mobile Applications through the Windows Marketplace for Mobile

Abstract: 

This session presents developers with a unique opportunity to understand the next generation of Windows Mobile application distribution: Windows Marketplace for Mobile. Windows Marketplace will revolutionize distribution of Windows Mobile applications, games, and content, and is designed to solve the two largest problems of the Windows Mobile consumer-focused developer community: distribution and monetization. This session will provide application developers with the insights, tools, and processes necessary to begin distributing and monetizing their applications on the Windows Mobile platform.

Creating Compelling and Attractive UIs for Windows Mobile Applications

Abstract: 

We explain how to utilize the Alpha blending and Gradient drawing APIs on the Windows Mobile platform to create a compelling and attractive user experience in your mobile applications. We also provide an example of how to create a framework that could be used to simplify the development of custom user interfaces

More Posts Next page »
Page view tracker