Aug 14

We've covered icons in the past, but I thought it was a good idea to review this information because I often see applications that use incorrect icon sizes. At a high level, here are the icon sizes Windows Mobile developers need to be aware of:

Windows Mobile Professional and Classic devices (formerly known as "Pocket PC"):

  • Normal DPI: 16x16 (small) and 32x32 (large)
  • High DPI: 32x32 (small) and 64x64 (large)

Windows Mobile Standard devices (formerly known as "Smartphone"):

  • Normal DPI: 16x16 (small) and 32x32 (large)
  • High DPI: 22x22 (small) and 44x44 (large)

So which of these icons should you use and where?

Application icons:

Your application's main icon (the first one embedded inside your .exe) is used in various places such as File Explorer, Task Manager, Start menu shortcuts, 3rd party memory management utilities etc. Since you cannot predict or control whether the user will see this as a large or small icon, you should support the maximum number of sizes for this icon (i.e. both small and large formats).

If you are creating a single .exe that is designed to run on all Windows Mobile devices, use an application icon with these sizes:

  • 16x16
  • 22x22
  • 32x32
  • 44x44
  • 64x64

If your .exe is only designed for "Pocket PC" devices, use an application icon with these sizes:

  • 16x16
  • 32x32
  • 64x64

If your .exe is only designed for "Smartphone" devices, use an application icon with these sizes:

  • 16x16
  • 22x22
  • 32x32
  • 44x44

"Feature" icons:

These are icons used within your own application. As a developer you can control the appearance of common controls such as ListViews and TreeViews used within your application, and hence you can decide which icon formats are most appropriate. For example, if you use a ListView control with the LVS_ICON style, you will need a "large" icon. If you use the LVS_REPORT style instead, you will need a "small" icon. To create applications that look great across all Windows Mobile devices (regardless of "Pocket PC" or "Smartphone"), support all the necessary icon formats - but no more than you really need. For example, if I know that my ListView will only use the LVS_REPORT style, my icon only needs to support the "small" sizes (16x16, 22x22 and 32x32). Similarly if my ListView only uses the LVS_ICON style, I only need the "large" sizes (32x32, 44x44 and 64x64).

Bottomline, treat your application icon and feature icons differently. And strive to support all the icon sizes that are necessary across different types of Windows Mobile devices. I hope this post helps you improve the look and feel of your applications. Please post comments if you need more clarification around icon size issues.

-Mel Sampat (PM, Windows Mobile shell team)

Aug 03

I'm really excited to announce the release of the Windows Mobile API Usage Tool, available here: http://www.microsoft.com/downloads/details.aspx?FamilyID=fc803c7b-e855-475a-b8f3-38c19a007d36&displaylang=en

 The API Usage Tool scans your Windows Mobile applications (in cab, msi, or binary formats), performs static analysis, and reports on the usage of APIs and other system resources.  Our application compatibility team has been using the tool for several months now to ensure that we have good coverage of our public SDK when we do testing with 3rd party applications, as well as to help guide resource allocation and investments toward the most frequently used APIs.

 The tool includes a file-- deprecated.txt-- that has the current list of deprecated APIs for Windows Mobile, and will report on your application's usage of these APIs.  It's a really effective way to evaluate how your application will be affected once these deprecated APIs are removed from Windows Mobile.

 The tool is command-line based, and its output is a SQL Compact Edition database (.sdf file).  When used with the /deprecated option, the tool will also generate a collection of useful reports.

 We're hoping that developers find the tool and reports useful, and we're encouraging developers to send us a copy of their database (or a link to a copy for larger files) at wmaut@microsoft.com.  We'll aggregate the data and incorporate it into our application compatibility planning, and we'll also share findings with the community via this blog.

Jul 01

I'd like to share a great photo of the Windows Mobile Phone team enjoying a much needed day off. These guys (and gals) are responsible for Smart Dial, Call History, Speed Dial, Call Progress, Voicemail, Wireless Manager and a whole bunch of phone UI and APIs. They're all hard at work on building a great phone + connectivity experience for the next version of Windows Mobile. (The smiles on their faces are probably indicative of some great new features they've just wrapped up).

Introducing the team from L-R:

JJ (test), Arturo (test), Darin (dev), Kerry (PM), Robert (dev lead), Howard (dev), Ritu (dev), Kelly (test), Thairu (dev).

So there you have it, folks - your typical Microsoft feature team consisting of dev, test and PM on a hot summer day. I'll try and post pictures of other teams bringing you Windows Mobile. In the mean time, feel free to share comments with the team but please keep it courteous.

-Mel

Jun 05

It looks like the topic of TechEd this year evolves around new rendering/layout technologies, like WPF and Silverlight. There are already many ISVs out there selling controls built on top of these new technologies. I was listening to a presentation about Silverlight running on Windows Mobile at TechEd today. At MIX it was announced that we are planning to release Silverlight for Windows Mobile devices and that we will have a technical preview by the end of the year. People were really excited to hear that.

I am not one to review devices, but today was a special day. I had the chance to play with the new HTC Diamond device. The device was impressive. HTC did a really impressive job on top of Windows Mobile 6.1. The device is slim, high-resolution (640x480), FM receiver, WiFi, bluetooth, touch sensors and some kind of a accelerometer... well, you can get the specs from the website. It is a great mixture of software and platform. In short, the device is delightful.

Other than that, I will be presenting tomorrow on how to increase the compatibility and usability of your Windows Mobile application. If you are here at TechEd, it would be great to see you.

 -Luis Cabrera
Windows Mobile Shell SDE

Jun 03

Hi, my name is Jorge Peraza; I am a Developer on the Windows Mobile team that was responsible for the new “Sliding Panel” home screen in Windows Mobile 6.1.

 

When we were working on the visual style and functionality of the home screen we tried to make something that looked both professional and appealing while still showcasing all the information the user is going to need to know what’s important and requires attention.  While I think the default design looks really cool, we added some customization features to enable users to make it their own.

 

Customizing the layout:

 

The home screen layout can be modified using the same home.xml file from previous versions of WM, the schema of the file was extended to allow the customization of many of its elements, this includes the art assets that are used for most of the plug-ins.

 

When you open the SlidingPanel.home.xml file (inside \ApplicationData\Home) you will find the plug-in element that corresponds to the sliding panel home screen (its CLSID is {E9267CAB-02EE-4f37-8216-6BF6A8FF5A71}).  All the child elements inside it are designed to tweak and customize the way the home  screen will look.

 

The top level element is the plugins tag, this has one attribute called “Order” and it’s used to list the plug-ins that will be shown and the order they are going to be laid out on the screen.

 

The built in plug-in names are:

1)      CClock – The big clock

2)      CAppointments  - The calendar plugin

3)      CHome – The notifications plugin

4)      CMyPhotos – The photos plugin

5)      CMessage – The message center (this is off by default on all sliding panel built in layouts.

6)      CMusic – The music plugin

7)      Settings – The settings plug-in

8)      Custom Plugins – Users can  specify custom plug-ins with static content that can be displayed on the home screen.

 

For example, the XML snippet bellow moves the photos plug-in to the first position and enables the message center (which is turned off by default on both "Sliding Panel" and "Sliding Panel Media")

 

<plugin clsid="{E9267CAB-02EE-4f37-8216-6BF6A8FF5A71}" name="Bronze" height="266">

  <Plugins Order="CMyPhotos;CClock;CMessage" />

</plugin>

 

 

There are many other ways of customizing the home screen using the plug-in settings like overriding the default images or even adding your own custom plug-ins that display static content, I'll post and updated entry latter on on how to do this in detail but for now, you can use the provided home.xml files to start experimenting with this.

 

The notifications plug-in and message center

 

In the sliding panel home screen, the notifications plug-in by default serves as a dual-purpose notifications/gateway to all you phone/message accounts where every page represents one account (so, if you have multiple notifications in one category they will be shown as one summary page).

 

There is however an alternative behavior where individual notifications are added as independent pages (Similar to what the T-Mobile shadow home screen does) and the plug-in only shows accounts that have new notifications in them.  One cool feature of this alternate behavior is that each individual notification can be dismissed without having to leave the home screen.

 

 

You can enable this alternative behavior by setting the following registry key to a value other than 2 (The actual value indicates how many pages of each notification type will be added to the home screen before collapsing them into a summary page. We have tested 2 and 5 but feel free to experiment with other values)

 

[HKLM\Software\Microsoft\Chome\Chome]

PageCollapseThreshold: DWORD

 

Note that this prevents you from being able to access the email/phone account data if there are no notifications for it. If you still want to be able to do that you can always re-enable the message center as described in the previous section as a separate plug-in.

 

There is one more behavioral change you can make that allows you to “dock” the condensed view of the first plug-in to the top of the screen when it is not active, we added this for people like me that want to have the clock always visible. To enable just set the following registry key to “1”

 

[HKLM\Software\Microsoft\Chome]

DockOperatorBar: DWORD

 

Advanced layout modification:

There are even more advanced things you can do to further tweak the look of the home screen but it is unsupported by Microsoft at this moment so you’ll have to experiment on your own J (Hint, look at the following files \windows\CHome_240x320.cpr and \windows\CHome_320x240.cpr).

May 18

Two years ago I released the first version of the SSLChainSaver tool. This tool helps you diagnose and repair SSL problems on Windows Mobile devices. After a very long delay, Version 2 is now up on the Microsoft download center. I wasn't able to release the source code this time. The usage instructions are similar to the previous version:

From a command prompt, run the tool.

> sslchainsaver mail.company.com

This will create a directory called mail.company.com which contains all the certificates from the SSL chain. It will also create files called mail.company.com.wm5.xml and mail.company.com.wm6.xml which can be installed over USB using rapiconfig or put in a CAB file for installation on device.

New features:

  • Creates versions of the XML for Windows Mobile 5 and 6. The WM6 version of the XML should always be able to be installed on WM6 devices - it installs certs to the user store so the security policies on the device should never block it.
  • Tries to diagnose many common SSL problems - no root cert sent by the server, common name mismatch, wildcard certs w/ WM5 devices, etc.

Known Issues:

  • The tool needs to be able to write to the current directory in order to save the files. If you install to \Program Files on Vista and are not running an admin command prompt, it won't be able to write out the certs. Either install it to a directory where you have write access (like Documents) or run from an elevated command prompt.
  • The tool can detect a common name mismatch on the cert but it doesn't parse the "SubjectAltNames" extension. If your certificates are using SubjectAltNames, the tool will report a name mismatch but the certs will really work fine.

 

Let me know here if you have any problems with it. I hope it helps you out.

 

Scott

May 01

A new site from Microsoft, the Windows Mobile Connection, launched today as a new forum destination for anyone who sells mobile phones or works in the mobile industry.

Here's a quote from the site's moderator:

"I think the Connection is unique: It's all about bringing together the real people behind the retail counters or on the other end of the phone line—the people who sell and support mobile phones, particularly Windows Mobile phones. We just didn't see anywhere on the Web that was specifically built with these people in mind, to help mobile-industry professionals connect with each other, find answers, and talk openly about what matters to them—offering customers great solutions and, ultimately, making the sale.

 

"The Windows Mobile Connection tries to be that place—something that's truly by and for sales professionals. We've launched with a discussion forum, photo gallery, and home page news—all built and moderated by technical experts and others who work directly with the Windows Mobile team. In the weeks and months ahead, we plan to add even more great content, and we hope lots and lots of new users will be there to help the Connection grow."

Any and all mobile-industry professionals are invited to visit the site, sign up, and give it a try. It's completely free, and all you have to do to sign up is provide a Windows Live™ ID. Visit www.windowsmobileconnection.com to get started.

Apr 15

Hi everybody, my name is Roshan Khan and I’m a dev working on Windows Mobile at MS. I’ve been working at the Mobile Devices division for the past 18 months. For the majority of my day I’m working in C++  and on a few unfortunate occasions assembly. Whenever I get the chance however, I try to push managed code.   In fact, you may be surprised to know that with Windows Mobile 6.1 we are shipping a feature written entirely in managed code (guess which one!).

While pushing my vigilante managed code agenda I’ve run headfirst into the limitations of the Compact Framework. The CF team did a great job getting ~30% of the functionality into ~10% of the space. And with a little bit of work you can get around many of the obstacles presented by the reduced code! And hopefully this article shows you one or two ways I managed to do this.

Today’s lesson is fast bitmap manipulation. Trying to alter pixels on an image is an intensive operation due to the problems associated with accessing managed memory. It’s just plain slow. This won’t be a big concern if all you are doing is drawing an image to a graphics object – but when you want to run a per-pixel filter on an image you quickly hit a performance bottleneck.

For this tutorial lets create a few classes that will let us invert the pixels on an image. The first thing we need to do is create a faster bitmap class. I’m going to make a class called FastBitmap, but I can’t subclass from Bitmap since it’s sealed. Oh no! Relax … we can fix this. Let’s create a class that contains a member variable that is a bitmap.

    public class FastBitmap

    {

        private Bitmap image;

 

But with this we won’t be able to pass in our FastBitmap into methods that accept Bitmaps – this is going to be a problem. One way to solve this is to simply pass in FastBitmap.image into the places that want a Bitmap, but this is a suboptimal solution. Instead let’s use the power of implicit casting!

        public static implicit operator Image(FastBitmap bmp)

        {

            return bmp.image;

        }

 

        public static implicit operator Bitmap(FastBitmap bmp)

        {

            return bmp.image;

        }

 

With this code we can now cast a FastBitmap object to an Image or Bitmap object on the fly. This helps especially when plugging the FastBitmap class into an existing application that is already using Bitmaps.

 

But we still haven’t solved our performance problems. How do we quickly manipulate the pixels on an image? Simple – lock the pixels in memory so we can access them quickly and in a contiguous fashion. This is done via the LockBits method. I’m going to add the following methods to our FastBitmap class that allow us to put the managed pixel data into a format that is better suited for direct manipulation.

        public void LockPixels()

        {

            LockPixels(new Rectangle(0, 0, image.Width, image.Height));

        }

 

        private void LockPixels(Rectangle area)

        {

            if (locked)

                return;

            locked = true;

            bitmapData = image.LockBits(area, ImageLockMode.ReadWrite,

                PixelFormat.Format24bppRgb);

            IntPtr ptr = bitmapData.Scan0;

            int stride = bitmapData.Stride;

            int numBytes = image.Width * image.Height * 3;

            rgbValues = new byte[numBytes];

            Marshal.Copy(ptr, rgbValues, 0, numBytes);

        }

 

        public void UnlockPixels()

        {

            if (!locked)

                return;

            locked = false;

Marshal.Copy(rgbValues, 0, bitmapData.Scan0, image.Width * image.Height * 3);

            image.UnlockBits(bitmapData);

            locked = false;

        }

 

By calling lock pixels we can copy the pixel data from memory into an array that we will manipulate later on. When we call UnlockPixels we dump this entire array back into our managed image in one atomic operation.

 

I’m going to ahead a few more methods to our FastBitmap class for ease of use. Here’s the completed class.

    public class FastBitmap

    {

        private Bitmap image;

        private BitmapData bitmapData;

        private int height;

        private int width;

        private byte[] rgbValues;

        bool locked = false;

 

        public int Height

        {

            get

            {

                return this.height;

            }

        }

 

        public int Width

        {

            get

            {

                return this.width;

            }

        }

 

        public FastBitmap(int x, int y)

        {

            width = x;

            height = y;

            image = new Bitmap(x, y);

        }

 

        public byte[] GetAllPixels()

        {

            return rgbValues;

        }

 

        public void SetAllPixels(byte[] pixels)

        {

            rgbValues = pixels;

        }

 

        public Color GetPixel(int x, int y)

        {

            int blue = rgbValues[(y * image.Width + x) * 3];

            int green = rgbValues[(y * image.Width + x) * 3 + 1];

            int red = rgbValues[(y * image.Width + x) * 3 + 2];

 

            return Color.FromArgb(red, green, blue);

        }

 

        public void SetPixel(int x, int y, Color cIn)

        {

            rgbValues[(y * image.Width + x) * 3] = cIn.B;

            rgbValues[(y * image.Width + x) * 3 + 1] = cIn.G;

            rgbValues[(y * image.Width + x) * 3 + 2] = cIn.R;

        }

 

        public static implicit operator Image(FastBitmap bmp)

        {

            return bmp.image;

        }

 

        public static implicit operator Bitmap(FastBitmap bmp)

        {

            return bmp.image;

        }

       

        public void LockPixels()

        {

            LockPixels(new Rectangle(0, 0, image.Width, image.Height));

        }

 

        private void LockPixels(Rectangle area)

        {

            if (locked)

                return;

            locked = true;

            bitmapData = image.LockBits(area, ImageLockMode.ReadWrite,

                PixelFormat.Format24bppRgb);

            IntPtr ptr = bitmapData.Scan0;

            int stride = bitmapData.Stride;

            int numBytes = image.Width * image.Height * 3;

            rgbValues = new byte[numBytes];

            Marshal.Copy(ptr, rgbValues, 0, numBytes);

        }

 

        public void UnlockPixels()

        {

            if (!locked)

                return;

            locked = false;

            Marshal.Copy(rgbValues, 0, bitmapData.Scan0, image.Width * image.Height * 3);

            image.UnlockBits(bitmapData);

        }

    }

 

 

With the class completed we can move on to the inversion algorithm. This part is actually quite simple.

 

        public new static void DoFilter(FastBitmap image)

        {

            image.LockPixels();

            byte[] pixels = image.GetAllPixels();

            for (int i = 0; i < pixels.Length; i++)

            {

                pixels[i] = (byte)(255 - pixels[i]);

            }

            image.SetAllPixels(pixels);

            image.UnlockPixels();

        }

 

 

Now we have an algorithm that in union with our FastBitmap class can invert a 320x240 image nearly instantly on a mobile device.

 

Thanks for reading. Let me know what you thought about this by leaving a comment!

[Author:Roshan Khan]

Apr 02

Windows Mobile 6.1 was just announced at CTIA yesterday. A bunch of us got together to record a video demoing most of the new features in Windows Mobile 6.1. Check out this 40-minute video that shows:

  • Cool devices, including the T-Mobile Shadow, HTC Tilt, Pantech Duo, Moto Q9
  • The new Sliding Panel home screen (aka "Bronze")
  • All new home screen plugins
  • Threaded SMS
  • Copy & Paste support for non-touch devices
  • New Task Manager
  • Clock & Alarms
  • Windows Live and Live Search Mobile
  • and more...

This is a long video but it shows several features in great detail that you may not see elsewhere. Also note, there are other improvements in Windows Mobile 6.1 that we don't cover in this video, including IEMobile's new Zoom feature and integration with SCMDM 2008.

-Mel Sampat

Apr 01

Windows Mobile 6.1 screenshot

This morning Microsoft officially announced Windows Mobile 6.1 and an upgrade for Internet Explorer Mobile. Windows Mobile 6.1 will start showing up in devices very very soon, and the IEMobile update will be available later this year.

Windows Mobile 6.1 includes a slew of new features and improvements, including a redesigned home screen, built-in Task Manager, threaded SMS client, browser improvements, Copy & Paste support for non-touch devices, integration with SCMDM 2008, improved Windows Live integration, Getting Started Wizard, faster Bluetooth setup, significant and noticeable improvements in performance and battery life, and much more.

Upgrades for several current devices will be available. From the press announcement linked above, the following new phones and updates were announced today:

Mobile operators:

  • Alltel Wireless: HTC PPC6800, HTC Touch
  • AT&T: Samsung BlackJack II, MOTO Q 9h global, Pantech duo, AT&T Tilt by HTC
  • Sprint: A new Palm Treo and updates for the Mogul by HTC, Touch by HTC, MOTO Q 9c, Samsung ACE
  • T-Mobile International: T-Mobile MDA Ameo 16 GB, T-Mobile MDA compact IV

Device-makers:

  • ASUS: New phones including the P320, ZX1, P560, M536 and updates for the P527, P750, M930
  • HTC: A new Touch Dual for the U.S. and updates for the AT&T Tilt, Touch by HTC, Mogul by HTC from Sprint, TyTN II
  • i-mate: 8502, 9502, 8150, 6150
  • Intermec: CN3
  • Motorola: MOTO Q 9c, MOTO Q 9h global, MC70, MC9000
  • Pantech: Pantech duo
  • Samsung: BlackJack II
  • Toshiba: Portégé G810,Portégé G910

For more screenshots, please visit the Windows Mobile page on Facebook. We'll post even more information about Windows Mobile 6.1 on this blog shortly.

-Mel Sampat