Thursday, April 30, 2009
Windows Mobile Application Setup and Deployment
Sure, it is easy to start with developing a Smart Device application. Visual Studio provides us the Smart Device project template to get started. During the course of development, you can test your application by pressing F5. Visual Studio automatically launches the emulator and starts on the deployment of the application on the emulator. Everything is easy (and hidden from view!!).
Well, after the development, it is time to deploy your application. You would need to present an acceptable form of installer for your end users. For Windows mobile, you have a choice of packaging the application as a cab file. But then, the users have to transfer the cab file on their mobiles and launch the cab files on the mobile. It is messy and complicated job to ask for and more often than not, the end users would demand an easy method to install on their mobiles, like the Windows installer they are used to on their desktop.
So, how do we go on creating that elusive MSI? The answer is fairly simple and leverages Microsoft Active Sync (available on Windows XP and earlier) and Windows Mobile Device Center (on Vista) to install the windows mobile application on the device. Active Sync/Windows Mobile Device Center is the sync program to keep your Outlook contacts/files in sync between the desktop and the mobile device. It also enables one to install applications on the device and this is what we would transparently run and install the application on the mobile, while providing a pleasant user experience.
I will discuss the pre-requisites and detail out the steps to be done to create an MSI installer and how to install on the emulator. The same installation process can be followed to install the application on the windows mobile device. Installing on the emulator is a big advantage, since you have a chance to do a dry run and do a check for the working of the application on the emulator before you install on the actual device!
Before you start
If you have Windows XP or earlier, ensure that you have Active Sync 4.5 installed. Note that, Active Sync 4.5 does not work on Vista. You can get it from the Microsoft site through this link.
Those having Windows Vista, download Windows Mobile Device Center 6.1 from here. Note that there is a pre-installed Windows Mobile Device Center that runs on Windows Vista, but that just launches a simple program to just transfer files on the emulator. The actual installation manager program is handled by the CEAppMgr.exe which gets installed only when you download and run the Device Center 6.1 installer!! By the way, don't get confused seeing a driver update installer (drvupdate-x86.exe) at the Microsoft download site. This is the download containing the Windows Mobile Device Center program and drivers in a single package!
Components required for the MSI Setup Package
There are 2 components that are required in creating a setup windows installer (MSI) package. One is the cab file and other is a custom installer.The mobile device application is packaged into one or cab files. The custom installer is required to guide the installation of the cab files to the mobile device by launching the CEAppMgr.exe.
Its easy to setup a Smart Device Cab project; once you have added and configured the Cab Setup project to your solution, you can move ahead to create a Custom Installer project.
Creating the Custom Installer
To your Smart Device solution, add a Windows Class Library project. Call it CustomActionSetup. Remove the class1.cs and add a new Installer class item, say CustomAction. You should code the AfterInstall and AfterUninstall event handlers of this class to launch the CEAppMgr.exe similar to this: System.Diagnostics.Process.Start(ceAppMgrPath, iniFilePath);
The iniFilePath is the path to a Setup.ini. This Setup.ini at the minimum should list the cab files, the application version and name of application.
Creating the MSI package
To the Smart Device Solution, add a Windows Setup and Deployment project. Add the files from the other project outputs like CustomActionSetup.dll (from the Custom Installer Project), the TestMobileSetup.cab (from Smart Device project) file and the Setup.ini file.The MSI package can now be created. However, we still need to tell the MSI package to run the CustomActionSetup.dll, which in turn calls CEAppMgr.exe for installation to the device, after installing the cab files.
To do this, setup a Custom Action (right click on the project; View -> Custom Action). Add the custom action to the Install action and choose the CustomActionSetup.dll in the Application folder.
Build the MSI project to get the MSI file.
Installing on the emulator
Start the emulator through Visual Studio (Connect To Device button in the toolbar). Once the emulator is started, launch Device Emulator Manager (under Tools menu). Cradle the emulator you just started. Now, you can run the MSI file. The installation first installs on your desktop and seamlessly installs on the emulator. You will get a message as such. The emulator also will show a message saying Cab file installed.
Congratulations! The installation is done. To run the app, check the Program files (Program shortcut menu) on the emulator.
Installing the application on the mobile device is very similar. You first connect the device through USB and launch ActiveSync to connect to the device. Then run the MSI file on your desktop.
Uninstalling the application can be done through the ActiveSync/Windows Mobile Device Center.
Though it seems easy to implement at a glance, the real issues come forth during creating the MSI setup package and one is at a loss to understand what has happened.The steps in the article give a concise reference to the key items involved in building a MSI package to install an application in a mobile device. You can contact me through this blog for sample code pertaining to this article.
More recently we came across a strange issue when installing an application on the mobile that referenced a web service. I will cover the issue and the resolution in my next post!
Challenges of Web Design for Mobile Devices
Of course, Web design for mobile devices brings its own unique set of challenges that designers must overcome to create a successful mobile website. If you’ve attempted to design for mobiles, these were probably some of your most significant challenges.
1. Variety of screen sizes
Although Web designers are used to dealing with varying screen sizes and the resulting issues, mobile design presents this challenge in a bit of a different way than dealing with different-sized desktop monitors. Most designers are comfortable with the challenges that arise from various screen resolutions on desktop monitors, but if you haven’t worked with mobile design before, it can be something yet more complicated that you need to overcome.
Because mobile technology is always changing, screen sizes are changing, too. Fortunately for designers, modern mobile devices typically have bigger screens and higher resolutions than those of a few years ago, but of course those older phones are still in use.
While we’re on the topic of mobile screen sizes, there are two excellent articles from April of 2008 at Sender 11: Mobile Screen Size Trends and More on Mobile Screen Size Trends. The results of the study behind these articles show that 240 x 320 (a.k.a. QVGA) should be the standard for mobile development. Many newer mobiles and smart phones have larger screens, but smaller ones are largely a thing of the past.
The graph below shows the findings of the report, which is close to a year old at this point. With the rise in popularity of the iPhone and its competitors, the most recent numbers most likely favor larger screens even more.
For more interesting details on the study and other helpful charts and graphs, please see both articles at Sender 11.
2. Lack of understanding
One of the biggest challenges that many designers face is just the intimidation of dealing with a new aspect of design. If you haven’t considered mobile browsers and visitors in your previous design work, it’s most likely not something you feel comfortable doing without some research. Because mobile browsers behave somewhat differently than desktop browsers and because the environment of its users is not the same, the designer needs to gain some understanding and familiarity. Through the information and resources presented in this article, you can easily get started with a general understanding of the mobile Web, if you don’t already have experience.
3. Rapid change
Like any other technology, rapid change is a constant. Of course, Web designers need to stay on top of the industry in general, and the mobile Web is no different. As technology and trends continue to change, the mobile Web will evolve accordingly. The challenge of change isn’t really anything new to designers; the mobile Web just presents another area in which designers need to stay up to date.
4. Testing challenges
One of the most significant challenges in designing for mobiles is the wide variety of phones in use. While designing for desktops brings its own testing challenges, with its various browsers and screen resolutions, there are more dependable ways of testing these items at the moment. On the mobile Web, however, many of your visitors will likely be accessing your website in an environment that you were not specifically able to test.
There are, of course, some things you can do so that a mobile website is tested as well as possible. To start with, the simplicity of mobile websites in a way makes the testing process easier because there is less that can go wrong. With a careful design and some well-planned testing, it’s possible to be fairly certain that a website will be displayed properly and, more importantly, usable on the vast majority of mobile devices.
For testing, we’d like to point out a few here . First, the Web Developer Toolbar has some very useful features for testing a website for mobile users. Because CSS and images may not be enabled when a mobile visitor is on your website, you can use the toolbar to disable both and see how the website will appear. While this does not exactly replicate the experience of visiting the website in a mobile browser, it can help identify potential problems in the way content and navigation is displayed.
Another helpful testing resource is the Opera browser. In the Opera toolbar, go to “View” and select “Small Screen.” This will display the website in a very narrow window, similar to what would be used on a mobile device. Additionally, you can use the Opera WebDev Toolbar to view an unstyled page by clicking on “Display.” By viewing the page in the small screen with CSS turned off, you can get an idea of how mobile visitors may experience the website.
5. Deciding on what is essential
If websites are to contain only what is most essential, the website owner or designer will have to determine accurately what content is most important . This may seem pretty simple, but taking a website that’s loaded with content, images and maybe even video, and weeding it down to just the essentials can be quite a challenge. Another aspect to this issue that must be considered is the status of the average mobile visitor. What are they doing? Why are they accessing the website at that time? What are they likely and unlikely to have any interest in? Keep in mind that the goals of mobile visitors are often vastly different than those of visitors sitting at a desk.
Bluetooth – Security issues

Bluetooth is an open wireless protocol for exchanging the data over short distances. People use bluetooth widely for communication in day to day life, hence security is a major concern. People who send sensitive information over wireless connection need to take precautions to prevent information from leaking out to the external world.
Some of the Bluetooth – specific security issues (loopholes) are :
- Bluejacking
- Bluesnarfing
- Bluebugging
Bluejacking is sending unsolicited messages over Bluetooth to Bluetooth-enabled devices such as mobile phones, PDAs or laptop computers. This is achieved by sending a business card wherein the name field contains the message to other Bluetooth users within a 10 meter radius.
Bluejacking doesn’t harm the mobile phones. However, it makes users think that the phone is malfunctioning as they fail to understand what has happened.
To prevent bluejacking:
- Disable Bluetooth when you don’t need it and nobody will be able to bluejack you.
- Set the Bluetooth device to hidden, invisible or non-discoverable mode.
- Ignore bluejacking messages by refusing or deleting them.
Bluesnarfing involves accessing unauthorized information from a wireless device through a Bluetooth connection between phones, desktops, laptops and PDAs. This allows access to the calendar, contact list, emails and text messages, and even multimedia content (pictures and videos).
Bluesnarfers illegally pair with Bluetooth-enabled devices like cell phones and PDAs to access data which can include everything from your address book to sensitive personal/corporate information.
Bluesnarfing can be done if the phone allows pairing and your Bluetooth is on and discoverable. Someone with the right program can easily create a remote connection without any confirmation or code-input from you and can easily download the details.
A phone set to “hidden” mode can be bluesnarfed by guessing the device's MAC address via brute force. However, this is difficult because Bluetooth uses a 48-bit unique MAC Address, so there are over trillions possible addresses to guess.
To prevent bluesnarfing:-
- Update your devices. Early models often has discoverable mode by default. These loopholes are eliminated in most of the newer devices.
- Sdevice mode to “hidden” as a regular practice.
- Do not pair your phone with an unknown device.
- Do not accept contact from unknown contact source. One of the common bluesnarfing techniques is to send an unsolicited business card. When you accept that, device becomes a trusted device and can access your data.
- Protect the data with IPINs
Bluebugging is a form of bluesnarfing. Bluesnarfing is about stealing files from a victim’s device whereas bluebugging is taking control of a victim’s mobile and commanding it to do whatever the bluebugger wishes. A bluebugger can take complete control over you phone, and use it to send message or make a call or do anything as they own the phone.
When a hacker successfully bluebugs your phone, he can access your Internet connection, make calls from your phone number, listen to your conversations and change entries in your calendar and contact list.
To prevent bluebugging:-
- Check if your phone model is susceptible to bluebugging. Older phone's Bluetooth technology is easy to bluebug.
- Contact phone’s manufacturer, as many of the major cell-phone companies have developed software patches that makes difficult to bluebug the phones.
- Turn off the phone’s Bluetooth capability when not required as the bluebuggers can only make a connection when Bluetooth is enabled.
- Scan all incoming multimedia messages and electronic business cards for viruses.
- Take advantage of the fact that a phone cannot be bluebugged beyond 10meter hence if possible move to a remote area when using your phone's Bluetooth capabilities.
Summary
- Turn on the Bluetooth of your phone if and only if it is required.
- Try not to use Bluetooth in public places.
- Upgrade the phones with the latest patches available in the market.
- Don’t accept any data from an unknown source.
Location without GPS for Windows Mobile

So you are lost again- you don’t know the directions back from the down market and there is little help on the road at this hour. The town’s paper map did not live longer being subjected to daily mauling. How you wish you could have bought that smart phone with built-in GPS that tracks down all the directions, gets you details of nearest pizza vendors, helps you arrange a plumber for that leaky job and even tells you where you can go for an evening out.
But alas! It’s troubled times and you can’t afford a GPS integrated phone when it’s already tough to pay the home rent.
Detailing maps, points of interest, driving directions, and enterprise scenarios, LBS has become one of the hottest areas of mobile device development.
A large number of new generation phones have GPS built in. But the goal here is to cut cost and get the same service on phones which don’t have the built-in GPS.
We can broadly categorize Location Based services into two categories. One is a positioning technology available within carrier network system where they are able to locate the device and second GPS receiver is installed on the user’s device to get the location via satellites.
But we can also achieve it by using cell tower Information which is available on almost all the phones. It doesn’t require any GPS receiver on user device and it doesn’t require any carrier paid service for getting cell tower information. Naturally, cell tower data isn't as geo-precise as GPS. You can't tell from your cell tower data if you are 10 feet or 1000 feet from the tower, but it can still be of great help.
What we need?
We just need four key pieces of data. Cell tower ID, location area code, mobile network code and mobile country code. We need to crack open the Windows mobile Radio Interface Layer (RIL) to get cell tower data. It’s not as complex as you might think.
Windows Mobile (5 and 6) has a native API to get those four pieces of data. You can search for RIL on MSDN for details on the entire RIL library. It’s very well documented.
We're only interested in the cell tower portion of the RIL. The first thing we need to do is import necessary methods from ril.dll to call into the radio interface layer. The methods contained in ril.dll are our gateway to cell tower data.
Once we get the cell tower data we need to translate it into latitude and longitude.
Google makes this task simple for us. We can send it off to Google via HTTP, and get back the latitude and longitude. However, Google is not the only database of tower locations. OpenCellID.org is an open source initiative to map all cell towers and their GPS coordinates. Yahoo! is doing the same thing with their ZoneTag service.
Testing your application on the computer
Testing this application is not as straight forward. This code will not directly work on your emulator. We have to configure and run cellular emulator for testing this code on developer boxes. Cellular emulator comes with Windows Mobile SDK 6.
So we got the location, now it is up to you what you do with this location. The field is wide open to come up with your own creative ideas.
Thanks for reading, and happy geo-coding!
Note: This article highlights how we can get user location based on cell tower id. If you require further details or source code you can contact me through this blog.
Mobile Web Design Trends
Because designing websites for mobile devices brings some unique situations and challenges into play, the subject requires a strategic approach from the designer and developer. In this article, we’ll look at the subject as a whole, including current trends, challenges and tips. Plenty of helpful resources and articles are also linked to throughout the post, so if you’re interested in learning more about designing for mobiles, you should have plenty of information at your fingertips.
CURRENT TRENDS
1. Simple options
One of the most intriguing things about mobile websites is the scaled-down options that are available to visitors. The mobile home page of Digg, for example, contains only 10 simple headlines and links, a log-in link and a few very basic navigation options. When it comes to mobile websites, simplicity is key. Because of the lack of space on the screen and Internet connections that are often slower, it’s important for visitors to have access to what is most crucial, and as little else as possible.In an age of crowded pages, the simplicity of mobile websites can be refreshing. What’s important is there, and what is most likely excess gets cut out. The simple options that a user has can make a mobile website much more usable than it would be otherwise, as long as the options allow for actions the visitor wants to take.
2. White space
White space is an important part of any design, and it’s something that’s usually a challenge in Web design because there is a desire to get as much as possible in front of the visitor. White space becomes even more of a necessity in mobile design because the typical screen size is so much smaller. A jumbled website would be very user-unfriendly and very difficult to pull off in the mobile environment.
As you browse through the websites shown in the gallery further down in this article or in real-world scenarios on your own mobile device, you’ll find that many websites include ample white space, especially the ones that are helpful and easy to use.
3. Lack of images
As high-speed Internet connections have become more common in recent years, designers have been able to take more liberties with things like bandwidth-hogging video and images. The average visitor on a desktop or laptop wants to see a visually engaging website, and, as a result, images are heavily used. However, when it comes to mobile design, excessive use of images often does more harm than good.There is a great variety of speeds of mobile Internet connections and of pricing plans for access. Visitors are more likely to be slowed down or concerned with use of their resources when they’re on a mobile. Additionally, the size of the screens can make many images difficult to see and content harder to read. For these reasons, it’s very common to see minimal use of images in mobile Web design.
As a growing number of mobile users move to smart phones with larger screens and better connection speeds, more opportunity exists to use images. However, because there is still a large percentage of users who are not using these devices, many mobile websites still avoid images when possible.
4. Sub-domains instead of .mobi or separate domains
When the .mobi top-level domain (TLD) first became available, a lot of buzz surrounded the news. While some websites use .mobi for mobile versions of their websites, it is currently more common to see companies use a sub-domain or a separate folder on their primary domain. There are multiple issues a company must consider when making this decision, but one of the major benefits of using a sub-domain is that it keeps everything on one domain, rather than spreading things out and potentially confusing visitors.
You’ll commonly see mobile versions of websites at such addresses as mobile.example.com, m.example.com, example.com/mobile, example.com/m and other ones along these lines. Some actual examples are m.twitter.com, mobile.washingtonpost.com and netflix.com/mobile/. Of course, there are exceptions to this trend, but as you look at the mobile versions of major websites, you will see more sub-domains than .mobi TLDs.
5. Prioritized content
Because of the simplicity of these pages and the general lack of many options, the content displayed is highly prioritized. One thing you may find surprising when viewing mobile websites is how much of the content is prioritized for the visitor. Of course, all websites should be user-focused, but because most websites are run commercially for business purposes, there are often elements that aren’t necessarily important to visitors, such as banner ads. While advertisements have largely become an accepted part of the Internet, most mobile websites are ad-free. The content available on a mobile website is typically of the highest priority to the average mobile visitor, not the company, although in the end the company benefits by having a more usable website.You can see an example by looking at the mobile version of The Onion. Like most news websites, TheOnion.com does have ads with its stories (although many are internal ads). The mobile version, however, is ad-free.
Another example of prioritized content and simple options can be seen on Best Buy’s mobile website. The only options here are for a product search and store locator (a phone number is also listed to allow customers to place orders). The logic here is that visitors who are accessing the website on a mobile device are probably on the go and probably have something very specific in mind. Maybe they’re looking for a store close to their current location to buy a product. It’s less likely that a mobile visitor would be interested in simply browsing the website, so the most important options for this visitor are presented, with nothing else to get in the way.
Monday, April 6, 2009
Mobile Widget Development
My experience in Widget development began when we developed our first “FaceBook Widget application”. Later we started developing several information widgets on web pages compatible with mobile devices. So here I am, sharing some of the information about Mobile Widgets development that I learnt during the course of development.
What are Mobile Widgets?
To begin with, let’s understand what a Widget is all about. A good way to think of a Widget is as small applications that typically serve as front ends to Web 2.0 services or internet content.
From User’s perspective, Widgets mainly fall into one of the following categories:
- Accessory Widgets are self-contained like Clocks, timers, calculators, and note-takers fall into this category.
- Application Widgets are often read-only interface. The iTunes Controller and Address Book Widgets fall into this category.
- Information Widgets are designed to work with data from the Internet like weather, flight status, or stock prices.
- Ecommerce widgets, allows people to sell things from their sites.
From Developer’s perspective, there are generally four common types of widget platforms:
- Desktop Widgets
- Mobile Widgets
- Web Widgets
- TV Widgets
A mobile widget is nothing but a thin application that resides on the device and performs one task very well.
Why should you care about Mobile Widgets?
Now let’s take a quick sneak peek into the sample Mobile widget usage trends over last year from a Leading Off-Deck Mobile Widget Service.
CPMs range from US$1 to US$10 (Mobile Advertisements) depending on different factors:
- Audience Demographics
- Significant Events (Twenty20)
- Usage Patterns
How to develop a Mobile Widget?
You should start out by determining what sort of widget you want to make. Analyze user needs and consider the characteristics of the mobile device before embarking on making a widget.
Companies considering new mobile widgets should evaluate and then deploy applications according to four criteria: the business model, distribution model, server-side application framework and the run-time environment.
The mobile device is small and the interface is often challenging. Developer should consider the following recommendations:
- Keep the widget simple: Avoid clutter and too many choices in each view.
- Offer larger click surfaces to make clickable elements easy to hit with a low precision input method.
- Enhance or replace text input with auto completion and lists of options.
- Use hover effects to improve usability and make it clear to the user what is active.
Today's mobile widgets are based on standard web technologies you may already know such as HTML, CSS, and JavaScript. In the future these same technologies will enable developers to access device-level data such as an address book, current location, or upcoming calendar appointments.
Some of the mobile platforms are available.
- Yahoo Mobile widget platform runs on the iPhone, Windows Mobile devices and the Nokia S60 phone.
- Nokia WidSets SDK for Nokia handsets.
- Opera’s Mobile 9.5 platform which runs on Windows Mobile, Nokia S60, and UIQ.
- MOTODEV Studio for WebUI from Motorola
- Java ME-based mobile widget engines exist including Bling Software, BluePulse, Zumobi, Mywidz, Plusmo, WidSets, Webwag, WidX, Bicon.
Several AJAX-based native widget platforms are also available for mobile devices including Access' NetFront, Openwave's MIDAS and Opera's Opera Platform.
How to distribute the Widgets?
Once done with coding, the widget needs to be tested and published in the gallery for distribution. There are many ways in which you can distribute your Widgets. You can make them available on your web site or as a download in a third-party portal.
For instance, you can test Yahoo mobile widget on Yahoo Mobile Developer site, and then upload it to Yahoo Mobile Widget Gallery for distribution via Yahoo!’s mobile products. For Nokia Widsets, upload your widget to your dashboard and publish it, logon to widsets.com and use the tools provided under "My profile".
Also, the Betavine Widget Zone features a tutorial on how to build widgets from scratch, and the terms and conditions under which widgets will be accepted for distribution. Developers can upload their widgets to the Widget Zone, and then use the Vodafone Widget Manager Beta (WMB) as a distribution channel to reach Vodafone customers, according to the firm. Vodafone WMB is a free application available from Vodafone Live.
Widgets are transforming the mobile web from an experience that is just about browsing anywhere to one that is interactive and personal. So get started, check out the various Mobile Widget Platforms, and try writing a Mobile Widget.


