Log in

View Full Version : Maintain a Single Binary for Pocket PC and Smartphone


Andy Sjostrom
12-18-2003, 08:00 PM
<div class='os_post_top_link'><a href='http://msdn.microsoft.com/mobility/default.aspx?pull=/library/en-us/dnppcgen/html/mantsngbin.asp' target='_blank'>http://msdn.microsoft.com/mobility/.../mantsngbin.asp</a><br /><br /></div>This is quite unique for the Pocket PC and Smartphone platforms! I am not aware of any other mobile platforms that can actually run the same binary on both a touch screen PDA and a mobile phone. Be that as it may... Check out the MSDN article "How to Maintain a Single Binary for Pocket PC and Smartphone" which helps you get started writing code that maintains one binary for Pocket PC and Smartphone. Here are some hints from the article:<br /><br />"• Do a runtime check for the platform<br />• Check for the screen resolution<br />• Minimize your menus entries<br />• Minimize the use of Common Dialog Boxes<br />• Save and load only from "My Documents"<br />• Create a resource for each platform or use the "condition" property<br />• Load Pocket PC and Smartphone specific libraries dynamically<br />• Do not assume a touch screen"<br /><br />I believe some applications could be developed this way. And if the downsides of walking down this alley is too significant, then at least parts of the code base could leverage these development hints.

newbie2
12-18-2003, 08:21 PM
Do not assume touchscreen?

Jason Dunn
12-18-2003, 08:48 PM
Do not assume touchscreen?

Smartphones do not have touch screens. :-)

pdhenry
12-18-2003, 09:37 PM
Given that some devs have trouble with the concept of having fewer than four function keys, the touchscreen thing is going to be off the radar for them.

(Some Phone Editions only have two redefineable function keys...)

snowlion
12-18-2003, 09:50 PM
is there a developer newsgroup for smartphone.

this may not be the forum...

but what's a smartphone? something that runs
windows mobile 2003 + some additional software.

or is it a generic word for a class of cellphones.

Jason Dunn
12-18-2003, 09:52 PM
is there a developer newsgroup for smartphone.

this may not be the forum...

but what's a smartphone? something that runs
windows mobile 2003 + some additional software.

or is it a generic word for a class of cellphones.

It would be best for you to stop by www.smartphonethoughts.com and post a message in the forums there - lots of helpful people will explain things to you. :-D

corphack
12-18-2003, 10:02 PM
Given the extremely limited memory space available in \My Documents (especially on the SmartPhone) applications that limit file access to that subdirectory will be of no use to many customers. This "suggestion" by M$ also seems very naive about the smartphone platform as currently implemented, since the three I've played with (including my current MPx200) all have SD card provisions. This space will be totally unavailable to their applications, should developers strictly follow these recommendations.

caywen
12-19-2003, 03:28 AM
This model doesn't work well for medium-sized and larger products. This is because half the code ends up looking like:

#ifdef POCKETPC
// PocketPC-specific code
#elif SMARTPHONE
// SmartPhone-specific code
#endif

It becomes quite unmanageable after a while.

Better to have two separate projects with a common source area for those things that really are shared.

Southway
12-20-2003, 12:07 AM
There is a typo in the code, the platform name for smartphone is shown as "Smartphone" but it is "SmartPhone".

I think there are some situations where a single binary (and single code base altering behaviour at run-time) provide significant advantages to deployment, multi-form factor device support and code maintenance.

It can be hard-enough with 5 CPU CAB files, let a lone versions for PPC, SP, HPC, CE.NET, etc.

MultiIE auto detects PPC, PPC2002 and WM2003 and supports all from a single binary, and I think that has greatly added to reducing support issues and fixing bugs.