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.
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]
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
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
Everyone I know at Microsoft uses a Windows Mobile phone (well, except for 2 people...one is a guy that works in the Mac Unit and the other is Bill Gates who doesn't use a cell phone). Microsoft employees are often the first customers of our product. To see just how passionate they can be, check out this video clip. It's from an annual employee event called "TechReady", which is attended by our field staff from all around the world.
This clip shows the popular "mobility smackdown" session hosted by Jason Langridge. It continues to be the most popular event at TechReady year after year.
The passion you see in this video translates into vocal and critical feedback throughout our internal testing cycles, also known as "dogfooding".
Windows Mobility Smackdown at TechReady 6
-Mel
A few years ago when I was getting my Bachelor's Degree I decided to learn how to write code for mobile devices (I had Compaq Ipaq at that time that was running Pocket PC 2003 version of the software). I downloaded eVC 4 and wrote my first little program for my device. It was an exciting time! As a student I did not have much disposable income, so it was nice to know that eVC was free.
If you have not heard about it, Microsoft just started a new program to allow students to get Free Professional level Development Tools. The program is called Microsoft Dreamspark. If you are are a student, you can go to https://downloads.channel8.msdn.com/ and download tools like Microsoft Visual Studio 2008 Professional Edition or Microsoft Expression Studio at no charge!
Enjoy!
Luis Cabrera
We're really excited to announce that the new Windows Mobile Line of Business Solution Accelerator 2008 has been released to the web and can be found here http://www.microsoft.com/downloads/details.aspx?FamilyId=428E4C3D-64AD-4A3D-85D2-E711ABC87F04&displaylang=en at the Microsoft Downloads site. Having the best mobile development platform and tools is more important now than it’s ever been before and that’s why we’ve delivered this new Accelerator to empower our developer community to do their best work on the Windows Mobile platform. Highlights of the Accelerator are listed below:
The Microsoft® Windows Mobile Line of Business Solution Accelerator 2008
Delivering new innovations and development best practices to the Windows Mobile platform with Visual Studio 2008, the .NET Compact Framework 3.5, SQL Server Compact 3.5, a working Supply Chain application, over 5,000 lines of commented code plus over a hundred pages of helpful documentation.
Adapt your App :: Create a single binary that runs unchanged on Windows Mobile Standard or Pro, Portrait or Landscape, Rectangle or Square. No more wasting time building separate executables to accommodate different screen sizes or input methods.
Sync Services for ADO.NET :: Synchronize your data between SQL Server 2008 and SQL Server Compact 3.5 using the new Sync Framework. Keep all your occasionally-connected mobile workers on the same page.
Windows Communication Foundation (WCF) Store and Forward :: Reliably push messages to servers or other devices via Exchange Server 2007. Programmatically notify peer devices that they have new orders waiting for them and need to sync.
MapPoint :: Guide delivery drivers to their customers via either the shortest or quickest route. Integrated mapping means you’ll never get lost again.
LINQ :: Use the new Language Integrated Query to filter results from Generic Object Collections. Query both your objects and XML using a familiar, SQL-like syntax to boost developer productivity.
Custom Controls :: Capture signatures and dazzle your end-users with 3D and Alpha-blended controls that alter their behavior depending on the platform they’re running on.
Managed Stored Procedures and Triggers :: The pluggable data layer allows you to say goodbye to compiling Dynamic SQL inside your code and fires events to react to INSERT, UPDATE, and DELETE operations.
Notifications and Online Help :: Formerly only supported on Pro, say hello to Popup Notifications and Online Help on Standard. Popup Notifications, also known as “toast,” display an HTML message and then disappear after a pre-determined amount of time. Using Online Help on every screen reduces your application training costs.
Language Switching and Localization :: Change Language/Regional Settings inside your app and watch text and Online Help speak a different language. Don’t wait until your application is finished to realize that it needs to be world-ready.
Time to Market :: Stop reinventing the wheel and use this Accelerator as the foundation for your next Windows Mobile development effort. If you don’t want to use the whole thing, pick and choose the components that are the best fit for your project.
Find out More :: The first Windows Mobile Line of Business Solution Accelerator has been downloaded tens of thousands of times and has served as the foundation for some of the largest and most important Windows Mobile projects in the world. Visit http://msdn.microsoft.com/windowsmobile to accelerate your career as a Windows Mobile developer.
While you're working:
- Windows Mobile Library. This technical library contains resources that can help you deploy and operate Windows Mobile powered devices.
While you're playing:
Enjoy!
-Mel
This video has been shown at internal Microsoft events a few times. It always draws a great response from the audience, followed by internal email aliases flooded for days with requests for a link or high bandwidth version. I finally found it on MSN Soapbox and YouTube (thanks to whoever posted it there). It shows a whole bunch of Microsoft consumer technologies working together in this average guy's "digital lifestyle". Most Microsoft products featured in this video, including Windows Mobile, Zune, XBOX 360, and Windows Media Center fall under the Entertainment & Devices (E&D) division, arguably the best division to work at within Microsoft (biased personal opinion). Come work here!
The soundtrack in this video is very catchy too, and I've seen just as many requests from people asking about the song and band. The song is called "Girl From Mars", and it is covered by a band named Magneta Lane. I'm not sure but they might have done some private/promotional work for Microsoft because I can't find the track associated with Magneta Lane anywhere else. The original song was released in 1995 by a band named Ash from their album named "1977". Watch the original Ash version on YouTube or check out the Wikipedia entry if you like the song.
-Mel Sampat
(update) p.s. I don't know where the green jacket is from. Banana Republic maybe?
Recom Research is running a wireless developer survey and offering participants a free copy of the findings, as well as discounts to the Wireless Developer Forum Conference in Cambridge on March 10-11 and a chance to win a wireless application development package.
I think we have the best, most talented developers of any mobile platform, and want to make sure your voice is heard! You can participate by following this link:
http://www.recomdeveloper.com/uc/main/6b0d/?a=109&b=
Thanks!
A quick glance at the Windows Mobile Developer Center clues you in to the fact that we’ve done a complete overhaul of the site. For years, our “bread and butter” has been delivering you content on Smart Device Development which most often included articles on building apps with the .NET Compact Framework and SQL Server CE/Mobile/Everywhere/Compact. While we will still do that, we’re now making a concerted effort to expand the diversity of our content to cover an ever-growing mobile developer audience.
The biggest thing you notice when you come to the site is 4 big boxes. Think of these as 4 concurrently running worker threads delivering more content on more topics than ever before.
1. From the “Applications for Smart Devices” box, you’ll see content that targets native, managed, and SQL Server Compact topics. Don’t worry. It won’t be 100% enterprise development 24/7 anymore. We’ll tackle more and more consumer scenarios like Peter Foot did recently with his article on Mobile Facebook. We’ll also go the other direction too and provide content on working with low-level APIs with C++. And yes, we’ll even start talking about creating better device drivers.
2. The “Mobile Web” box will unleash wave after wave of new content that covers the explosion that some are calling “Mobile 2.0.” You’ll learn the nuts and bolts of building web sites designed for mobile devices as we talk about things like the new .MOBI standards, W3C Mobile Web best practices and the XHTML Mobile Profile. Don’t forget AJAX on Internet Explorer Mobile. Jim Wilson and Mel Sampat have blown everyone away with their coverage of AJAX on our favorite mobile platform.
3. In the “Mobile Games” box we’ll resurrect a topic that we used to give a lot of coverage to several years ago. Based on the way this segment of the market is taking off, teaching you how to build games for Windows Mobile devices could turn out to be just as important as the work we’ve done in teaching you how to build mobile apps for the enterprise. We do in fact have a portable gaming runtime for all our devices called Direct3D Mobile that can be programmed via another portable runtime called the .NET Compact Framework. We also have Direct Draw or you could just chill out and create a casual 2D game with simple Sprites using NETCF and maybe a little GDI+.
4. The “Rich Internet Applications” box is a bit of a mystery and looks to be pretty vacant place at the moment. Don’t think of it like you would an “Under Construction” web site. Think of it as the big tease that it is. Who knows for sure what’s to come in the RIA space for Windows Mobile devices?
Now that I’ve covered the 4 big boxes, take a look at the “Getting Started with Windows Mobile” section on the top-right hand side of the page. This place is a tour de force of readiness to get you going with Windows Mobile development. Labs, Webcasts, Videos, Solution Accelerators, Wiki’s, SDK’s, runtimes, and Power Toys oh my!
Stay on the right side of the page and drop one section down to give props to our Device Application Developer MVPs. We all owe so much to these great folks! They single-handedly created the Windows Mobile developer community back at the beginning of this decade by answering questions in the NETCF newsgroup, writing books, speaking at conferences (with the highest scores) and creating amazing organizations like OpenNETCF.org. They also identify a disproportionally greater number of bugs in our beta software than any other individual or group.
If you move back beneath the main boxes on the page, you’ll see a section on the left that completely displays the content of the latest Windows Mobile Team Blog. The section on the right displays the latest blog posts from Jim Wilson, Loke Uei, Me, Visual Studio for Devices, the NETCF team, the SQL Server Compact team, Steve Lasker, Jason Langridge, Mel Sampat, Constanze Roman, and Frank Prengel. The real-time information delivered by these blogs will keep you abreast of the latest developments in the Windows Mobile community.
Last but not least is a section at the bottom that lists all the Forums that help make up the Windows Mobile ecosystem. Get answers to some of your toughest questions from Microsoft employees and the community at large whether you’re building apps with C++, C#, VB, and/or SQL Server Compact.
As a Mobile Developer, Architect, Marketer, Planner and former Embedded MVP, it’s been my vision to create a one-stop resource for all my Windows Mobile needs. I believe this new Windows Mobile Developer Center is a big step in that direction. The multiple, concurrent streams of content that follows the launch of this new site will represent the proof in the pudding. It’s been my great pleasure to deliver fresh content on a monthly basis to the Windows Mobile developer community. As always, I look forward to your feedback so that I can better equip you with the information you need to get your job done.
Best Regards,
Rob Tiffany
What are some ways the Zune player and a Windows Mobile device can work better together? I'm not referring to an imaginary "Zune phone", and I'm certainly not hinting or speculating about a converged device.
Instead, I'm wondering if there are any opportunities for us to improve the experience for people who use both devices (a Zune and a Windows Mobile phone). For example, viewing your Zune Social network in IEMobile, converting a Zune playlist into .WMA ringtones, converting Zune's artwork to Windows Mobile themes, showing your Windows Mobile contacts as pictures in Zune etc.
If you can think of similar interesting or compelling scenarios, we'd love to hear them.
Thanks,
-Mel
When I was in college and heard about some of Microsoft positions (PMs, SDETs, SDEs) I thought immediately that I liked writing code and solving problems, so I wanted to be a Software Development Engineer (SDE). But what do SDEs do?
What does the D in SDE stand for?
D is for Development
Ok, let’s get it out of the way. Yes, the one task an SDE does that no one else does is “they write product code”. An SDEs main task is to write code that is secure, maintainable, readable and that does what it is supposed to do. The program written should also have good performance and also be “world ready”. An SDE without good coding skills is like a carpenter without tools.