Welcome to MSDN Blogs Sign in | Join | Help

Thought I'd say a couple words about the Windows Embedded Student ChallengE competition which was recently held here on campus. Student teams from all over the world developed environmentally-themed projects based on Windows CE 5.0. I and several of my team mates acted as a buddy (sort of a host) for two of the teams. During my tour of the exhibits I saw some really interesting ideas, from a windscreen that filters our oncoming headlights to a CE-based ultrasound machine! It was inspiring and fun to meet young people from different locales who have a budding passion for embedded technology. Congratulations to all the winning teams, including 44 Tech for their first-prize Forest Watcher project!

WESC Team Aeolus WESC Team Explorers

Posted by James

So I was just at MEDC in Seoul and also happened to attend the Solutions and Contents Exhibition of Korea, which was happening around the same time and in the same building.

MEDC Korea: The presentations were all in Korean, so I didn't really understand them, but I was pretty impressed by the overall enthusiasm of the crowd - and even more so by the fact that 90% of them seemed to be students - I think most schools started their summer break just a few days before. There were a host of kids clustered around XBox kiosks and a ton checking out OEM booths and all the different Microsoft presentations - conferences in the US are often so expensive to attend that you don't really see too many students, but that's the age group that's most enthusiastic about new technology and cool gadgets. So I thought it was pretty great that MEDC Korea was open to everyone.

SEK 2006 - This is considered one of the largest technology fairs in Korea, and it was pretty darned spectacular. The event was opened by an android (the rather spectacular EveR1, developed by the Korean Institute for Industrial Technology) and there must have been a couple of hundred companies showing off their newest toys. Microsoft had a nice large section of the room too, with a crowd of people checking out the newest Vista and Office12 features. There's not very many small startup-type companies in Korea so most of the names there were pretty big - Samsung, HP, Dell, LG - with huge gorgeous glitzy displays. But there were a bunch of small university-funded research groups with crazy little robots and stuff like that, and these were also fun to check out.

I forgot to take my camera OR my phone along with me (my phone didn't work in Korea - there's only CDMA networks there), which was a pity, but oh well...

More later,

Ritu

Ritu neglected to mention that she's in Korea right now working with some of our Asian partners. Sounds like exciting times are afoot as Korea makes its World Cup bid! Check out her blog at http://ritukar.blogspot.com.

Posted by James

Shell connectivity mostly involves interactions between the Shell and ConnMgr for all radio connections and between Shell, ConnMgr and WZC for WiFi connections.

Shell UI - allows users to configure connection settings for different kinds of connections - shell settings contain UI to set up wifi, gprs and dial-up connections and also configure proxies and VPN's. Configuration info is then pushed down to the different CSP's or configuration service providers within ConnMgr.

Connection Manager - establishes and manages connections to different networks once it has connection configuration information from the shell. Applications send connection requests to ConnMgr when they need to connect to a particular network (Internet, Work, etc) and ConnMgr uses Connection Planner to select between all available connection types (WiFi, GPRS, etc) to provide the most optimal path to the requested network.

WZCSVC or the Wireless Zero Config Service - implements the state machine for discovering and configuring a WiFi network. Sends the airing networks list to the shell and gets updated preferred networks list information (preferred networks are networks that a user has previously configured or connected to). Also communicates with the authentication framework for 802.1x as well as the network adapter drivers.

Data connections rock!
Ritu

I've received a lot of questions over the last while as to how the Windows Mobile shell handles low memory on both Pocket PC and Smartphone and I thought it's about time somebody gave a decent explanation as to how the shell handles this situation. This is mostly an FYI post but hopefully if you're writing an app for Windows Mobile you'll also stop and consider how well your app will behave when confronted by a device running low on resources.

 

To start, low memory is a very important consideration to take into account when dealing with a resource constrained device such as a Pocket PC or Smartphone (or any other embedded device for that matter). Unlike the desktop we don't have a large source of memory to tap and no virtual memory (since we don’t require a device to have secondary storage that we could swap memory out to) so a device can quickly get into a state where most of the available memory is in use.

 

The Windows Mobile 5 shell runs a low memory check routine periodically (on Pocket PC this is done every 5 seconds, on Smartphone its 30 seconds) and assesses the state of the system memory. The routine will check to see if any action is required to keep a reasonable amount of memory free (the OEM ultimately decides what a reasonable amount is). Additionally, the kernel also monitors the amount of memory available and will nudge the shell whenever free memory drops below a certain threshold.

 

Below is a simplified diagram of the memory available for a device and the different memory thresholds that exist (note that the diagram is meant to show the relationship between thresholds and do not reflect relative values or sizes. Also, these threshold values can be modified by the OEM so there is no single value for them).

 

Hibernate

This is the amount of memory the shell tries to keep free at all times. If the amount of free memory falls below this value then the low memory check routine will try to free up memory. It will do this by first sending WM_HIBERNATE to all valid applications. When an application receives this message it should try to free as many resources as possible. When the low memory check routine runs again and the amount of free memory is still below the hibernate level then the shell will try to close the least recently used (LRU) application by sending a WM_CLOSE message. If the low memory check routine runs yet again and the amount of free memory is still below the hibernate level then the shell will call TerminateProcess on the LRU application that it last sent the WM_CLOSE message to.

 

Critical

If the low memory check routine is entered and the free memory is below this value the shell will send a WM_HIBERNATE message to all valid applications as above but it will then immediately try to close the LRU application without waiting to see if the WM_HIBERNATE messages were successful in bringing the amount of available memory above the critical level.

 

Execute

When launching an application the shell checks that there is at least this amount of memory free, otherwise it fails the application launch. This is done in order to prevent the application from taking up the last bit of available memory and potentially starving already running applications.

 

Kernel - Check

This is the value that the Windows CE kernel uses as its low memory threshold. When the available memory drops below this level, the kernel calls into the shell's out of memory handler (OOM) on a high priority thread. When the OOM handler receives this message it checks to see if the amount of free memory has dropped below the Kernel – Critical level. If the amount of free memory is greater than Kernel – Critical then the OOM handler simply calls the low memory check routine as described above. If there is less then Kernel – Critical amount of memory free then the following will happen:

 

Pocket PC – An "out of memory" dialog is displayed prompting the user to select an application to shut down.

Smartphone – The LRU application is closed without prompting the user.

  

What is a 'valid' Application?

For an application to be considered by the low memory check routine as a candidate to receive a WM_HIBERNATE message or to be closed (if it’s the LRU application) it must meet the following criteria:

 

1.      Have a top level window

2.      Not have the WS_EX_TOOLWINDOW or WS_EX_NOACTIVATE style

3.      Have been activated at some point

4.      Not the foreground application (since this is the app the user is interacting with and they'd probably be pretty mad if it started to free resources as a result of receiving WM_HIBERNATE or was closed while they were using it)

   

What can my Application do?

The best thing your application can do when faced with a low memory situation is to play nicely with the rest of the device.

  1. If your application receives a WM_HIBERNATE message free up any resources not absolutely required. 
  2. If you are planning on allocating a large amount of memory (or if a large allocation fails) you should call SHCloseApps, which will invoke the shell low memory check routine and will try to ensure that enough free memory exists. See below for an example:

#define MIN_MEMORY_TO_RUN 2*1024*1024

MEMORYSTATUS mst;

mst.dwLength  = sizeof(MEMORYSTATUS);

GlobalMemoryStatus(&mst);

If (mst.dwAvailPhys < MIN_MEMORY_TO_RUN)

{

    // Try to free memory by asking Shell to shutdown apps

    if (!SHCloseApps(MIN_MEMORY_TO_RUN))

    {

        // Handle the case where memory could not be freed

       

Cheers,
Patrick Derks
Windows Mobile Shell API

So one of the most common questions we get from OEMs about WiFi, GPRS and ActiveSync is that on a bunch of devices, connecting to desktop ActiveSync turns off WiFi and GPRS. In fact, WiFi doesn't just turn off, it disappears from settings entirely, making it seem like there's no WiFi hardware on the device at all. This is completely intentional, and in fact a security feature.

ActiveSync uses RNDIS, which is configured as an "exclusive connection" - Connection Manager will shut down all other connections that are active when you connect to the desktop. GPRS simply gets disconnected, but the WiFi adapter is completely unbound, which is equivalent to pulling out the network card. Once the device disconnects from the desktop, the wifi adapter rebinds and shows up in settings and wireless manager again. This behavior prevents devices from being multi-homed (connected to multiple networks at the same time). When you connect to ActiveSync, you can use desktop pass-through (DTPT) to access the corporate network but connection manager will not allow a connection to the Internet to stay active at the same time as DTPT.

Ritu (Shell Apps)

I've been a tester on the shell team in the Mobile Devices group for the last 3 years or so and I've just recently transitioned to the development team for a change of pace. During my time in test I worked on a bunch of cool features including input improvements (ex. auto-suggest and auto-correct), low memory handling, softkeys, hardware navigation, digital rights management (DRM) and a whole lot more. I was also pretty active in creating tools for verifying our UI consistency between rolling builds and helping to build a UI automation framework using C# for our other testers.

Now as I developer on the shell team I get the pleasure of working on some of the same areas I used to test, plus a few areas that are new to me. Over the next while I'll try to share some tidbits of information and insight for some of these areas including softkeys and low memory handling.

Cheers,
Patrick Derks
Windows Mobile Shell API

So I had the great honour of representing the Windows Mobile Shell team at MEDC 2006 last week. The conference took place at the gorgeous Venetian hotel in Las Vegas. I'll write a bit here about some of the highlights of the show for me.

A few of us arrived on the same flight from Seattle and shared a cab over to the hotel. Jay and Jason were gracious to let us jump ahead to join them in the colossal queue for taxis. Paul hadn't been to Vegas before, but from the cab he recognized some of the off-strip scenery from PGR3.

Jason and I made it in time to catch the last half of our proctor training session for the hands-on labs. The HOL is where I'd be spending a lot of time over the next few days so it was good to get the low-down on the lab setup. Lots of questions remained though, and we quickly discovered that the information flow seemed to be based on polling rather than push. Kind of like the Today screen design (more on that later).

Well, luckily we have some good connections - like Juggs, who told us about the MVP dinner at AquaKnox. On my way over there I ran into DebugJames who was 'crashing' the dinner too. He's one of the people I've known the longest at Microsoft, as he was a contractor in the cross-platform compiler group where I had my first internship way back in the fall of '93. As we weaved back to the private room I met Simon from the UK technical sales office. He told me all about life in the field and what it was like to be a technical evangelist for large customers. Sounds like fun, but also pretty stressful! He has customers deploying thousands of devices. We grabbed some food and drinks and I sat down with some .NET Compact Framework heavy hitters - Alex Feinman, Alex Yakhnin and Scott Holden (Scott and I go way back - we went to school together). Alex F got tired of waiting for the .NET CF team to write a COM interop layer so he wrote his own. That's some good MVP action! Both Alexes had some good advice on raising children as well, including a pretty hilarious wedding night story!

After the dinner a couple of people were heading over to Treasure Island for another MVP event. I went back to the room (a fair hike since I was in the Venezia tower) to see if Randy had arrived. I also visited a geocache down the street on my way over there, so by the time I got there everything was winding down. I did manage to score a Windows Mobile beach towel though! In the foyer outside the awful Kahunaville bar, I met Guhan, one of the engineers from Palm. There was a crew of nearly 40 people up from Palm, which was awesome to see. There is so much buzz around the Treo 700w (and also on the Motorola Q - more on that later).

Posted by James

Jay forwarded this on: http://www.windowsfordevices.com/news/NS9331622237.html

I'd seen PAM (the technology this is based on) before at a Science Fair event hosted by Microsoft Research, on a large-format display. They had that classic DirectX dolphin animation running, and it looked pretty amazing. On a mobile device, there could be many possibilities: fully 3D Shell? 3D messenger? 3D video telephony? Now, all we have to do is figure out how to build a cheap device with 2 cameras and twice as much RAM...

Posted by James

A few of us will be going to MEDC 2006 next week. We have some training tomorrow since normally we're just nerdy developers sitting in front of our computers all day, and at this event we actually need to talk to people. =)

Brian is going to bring WiMo to show off some of the things you can do with our managed API! That should be fun. No word yet on whether WiMo will be entering the SumoBot challenge...

Posted by James

On Tuesday in our weekly "Dev Discussion" meeting we had a special event called the Innovation Expo where people basically just showed off cool projects they have done in their spare time (spare time - what's that?!).

Jay showed a digital picture frame he built from an old laptop running Windows CE. Jason showed a new version of his ever popular MSN Virtual Earth mobile client. Nathan showed a content publishing project he's been working on. Dave showed a flexible application framework, and Joe showed an RSS reader he'd written.

Brian definitely had the coolest demo - he made a robot for which the "brain" is his Windows Mobile Smartphone! It's "built on top of the SDK" (he used an SDK DVD to mount the head rotator). There's a microcontroller for the motors and sensors which he built - it communicates with the Smartphone via Bluetooth. He can control it remotely and it can do multiple things - move around, play sounds, stream the camera over Wi-Fi. He's written all of it in .NET CF and is trying to use as many APIs as possible. Very cool! He assures me he'll be blogging about it somewhere with instructions and pictures and everything sometime soon.

Posted by James

Our man Kyle is spending 3 months in China with the development team in Beijing. He's working on some of the in-roads into the vastly expanding Chinese market including working with the local partners. You can read about his adventures at http://kyleinchina.blogspot.com.

Posted by James

James Drage Hi! I'm James Drage and I've been on the Windows Mobile Shell team (in its various forms) for a little over 7 and a half years. The way I usually like to describe "the Shell" to people is as everything between the OS and the apps. Our team puts together all the meat that makes the device usable - status display, navigation, and settings. The experience can make or break a device - if you've ever used a phone with a poorly designed UI you know what I'm talking about. That's what makes my job fun and challenging.

James Drage
Windows Mobile Shell UX

You may be asking yourself, "what is WM Shell?" Well, first of all you know that WM = Windows Mobile, Microsoft's version of the Windows operation system for Pocket PCs and Smartphones. The shell is the "front end" of the OS -- on Windows XP it's the desktop, taskbar, explorer, and much more. On Windows Mobile it includes:

  • Today screen (Pocket PC)
  • Home screen (Smartphone)
  • Control Panel/Settings
  • Taskbar and Softkeys (at the bottom)
  • Menubar (at the top)
  • Start Menu
  • File Explorer
  • Internet Explorer

I hope that gives you a better idea of what we do! I'm sure my teammates will fill in the areas that I missed here...

Ammon Larson
Shell Apps
I'm Ammon and I am part of the Shell Apps team in Windows Mobile. I work on shell security and settings on both Pocket PCs and Smartphones. Recently I did a lot of work on the device lock feature for Windows Mobile 5.0 AKU2, which added enhancements to the LASS/LAP model, including enterprise policy control. I'll try to share information I find that may be useful to Windows Mobile users but especially to Windows Mobile developers and ISVs. I would especially love to hear from anyone who is developing a LAP or other security features.

Ammon Larson
Shell Apps

More Posts Next page »
 
Page view tracker