Windows Mobile Development

6 views
Skip to first unread message

Beau Adams

unread,
Oct 23, 2009, 12:48:21 PM10/23/09
to bs...@googlegroups.com

Hello folks.

 

I have a project to work on where I need to develop an application that will run on Windows Mobile devices. The objective is that the program will start up on device startup/wake-up and run infinitely with no visual interface other than a settings area where users can modify the program settings. Behind the scenes, the program will compare settings to results retrieve from what I believe will be a web service, and then takes action.

 

WM is a new area for me, and I have checked out numerous hits on google, msdn, etc, and I am still confused as to where to actually begin. Much of the code samples I have seen as well sort of flew over my head as well. I am under the impression that the ‘running behind the scenes’ part requires the ‘console application’ part, but the area that the users access the settings is in ‘device application’ using windows forms. This will be done with VS 2008, using C#.

 

Would anyone have tips to help point me in the right direction?

 

Thanks

Beau Adams

Jacob Munson

unread,
Oct 23, 2009, 1:16:28 PM10/23/09
to bs...@googlegroups.com
I have never done any WM development, but one to thing to keep in mind is that Microsoft is working on a major revamp (or new from the ground up?) mobile OS.  Anything you develop now could be quickly obsolete in the next year or two.

http://tinyurl.com/yzbdwtg

Chris Brandsma

unread,
Oct 23, 2009, 1:22:11 PM10/23/09
to bs...@googlegroups.com
I would be worried about that if I was doing C++, not so much if you are using C#.

Here is your getting started site:
http://msdn.microsoft.com/en-us/windowsmobile/default.aspx

But a great library to get is the Smart Device Framework from OpenNetCf.com
http://opennetcf.com/Products/SmartDeviceFramework/tabid/65/Default.aspx


Other than that, WinMobile development is a LOT like WinForms development.

Other tools: MyMobiler  -- you're gonna want that.

Finally: don't even start development unless you have an actual mobile device sitting on your desk.
--
--------------------------------
Christopher Brandsma
http://www.ChrisBrandsma.com
http://www.ElegantCode.com

Beau Adams

unread,
Oct 23, 2009, 1:23:58 PM10/23/09
to bs...@googlegroups.com

I was expecting changes within a few months as has been a common trend I’ve seen. :-/

 

For right now, this project is actually a prototype to demonstrate the client’s idea can be implemented.

 

Update:

 

I just got the console app set up, calling a new instance of the form, and going from there. I am looking to dig into adding the console app to startup then going from there to have settings stored on the device. I believe the settings will be stored in a file, or maybe registry setting? Would anyone have suggestions on this choice?

 

Thanks folks

Beau Adams

Chris Brandsma

unread,
Oct 23, 2009, 1:26:14 PM10/23/09
to bs...@googlegroups.com
Don't store things in the Registry unless there is NO OTHER POSSIBLE WAY.

David Evans

unread,
Oct 23, 2009, 1:25:19 PM10/23/09
to bs...@googlegroups.com

Your needs sound as if you are seeking to put a windows service on a mobile device.  While I do not know if this is possible, is it wise?  You would basically have a constantly running task on a battery driven device.  Your end users will be running out of batteries in no time.

 

 

 

 

Beau Adams

unread,
Oct 23, 2009, 1:27:29 PM10/23/09
to bs...@googlegroups.com

I take it the emulators aren’t worth a hoot? Currently that is what I’m working with, and I do believe we have a windows mobile device laying around somewhere. Beyond this, I also need to work on a Blackberry Pearl program that does the same thing this Windows Mobile one does. :-/

 

I’m glad these are prototypes, but not quite so glad the time is short. At least in this environment, it is far more developer friendly than my former job. J

 

Thanks for the tips on the MyMobiler. I’ll snag it.

 

Thank You

Beau Adams

 

From: bs...@googlegroups.com [mailto:bs...@googlegroups.com] On Behalf Of Chris Brandsma
Sent: Friday, October 23, 2009 10:22 AM
To: bs...@googlegroups.com
Subject: [BSDG] Re: Windows Mobile Development

 

I would be worried about that if I was doing C++, not so much if you are using C#.

Beau Adams

unread,
Oct 23, 2009, 1:29:23 PM10/23/09
to bs...@googlegroups.com

Don't store things in the Registry unless there is NO OTHER POSSIBLE WAY.

Does that include application startup when the device turns on or wakes up? I believe the other way is via a .lnk in a startup folder.. that is actually my preferred method. Personally the only time I ever like to dig into registry is if I’m hellbent on destruction, and/or trying to fish out programs that shouldn’t be starting up. :-/

Thank You

Beau Adams

Beau Adams

unread,
Oct 23, 2009, 1:31:49 PM10/23/09
to bs...@googlegroups.com

Yeah I agree. My first objective in the design of this thing is to ensure that it has next to 0 footprint, and does what it needs to do. More or less this will be tracking rate of movement and then doing stuff.

 

Beau Adams

 

From: bs...@googlegroups.com [mailto:bs...@googlegroups.com] On Behalf Of David Evans
Sent: Friday, October 23, 2009 10:25 AM
To: bs...@googlegroups.com
Subject: [BSDG] Re: Windows Mobile Development

 

Your needs sound as if you are seeking to put a windows service on a mobile device.  While I do not know if this is possible, is it wise?  You would basically have a constantly running task on a battery driven device.  Your end users will be running out of batteries in no time.

 

 

 

 


 

Chris Brandsma

unread,
Oct 23, 2009, 1:45:32 PM10/23/09
to bs...@googlegroups.com
Windows Mobile works fundamentally different than Apple IPhone. Please save the debate on the difference (I don't care, I'm just calling as they are).
IPhone is only able to run one application at a time EVAR -- unless your company name is Apple.  There is no way around that limitation.

With Window Mobile, by default all app stay in memory unless explicitly closed.  This is an application setting that can be turned off.

As for an example of an app that works like you want, MyMobiler does that.

Also, if you can hit the registry, you can hit the file system.

Beau Adams

unread,
Oct 23, 2009, 1:53:26 PM10/23/09
to bs...@googlegroups.com

Since WM apps stay in memory, would an app running in the background simply checking a local settings value to a GPS value every 250 or 500 milliseconds eat up memory?

 

From what little I know, I am thinking it would be something like on app start, if myApp thread doesn’t exist, create it. Then in the infinite loop put the thread to sleep for 250 or 500 seconds (whatever it is). Does this idea sound like the right path to efficient memory use without chewing up resources for other apps or the os?

 

Thanks

Beau Adams

Chris Brandsma

unread,
Oct 23, 2009, 1:57:15 PM10/23/09
to bs...@googlegroups.com
ok, back up a little bit.

Why on earth would you want to check GPS settings every 250 to 500 milleseconds?  Getting a GPS reading at all can take a minute.  And you aren't going to move that far in that amount of time anyway.  Last time I did a GPS app we were checking every 15 minutes.


And while having the app run in the background will not eat up battery too fast, checking the GPS constantly will.  A GPS reading is one of the more batter expensive tasks you can do on a device (outside of running games).

Beau Adams

unread,
Oct 23, 2009, 2:01:26 PM10/23/09
to bs...@googlegroups.com

Hrm.. the things I learn!

 

Ok backing up…. The program needs to get the speed at which a device is moving, and then perform an action based on that result. I hate to seem cryptic, I just don’t want to violate confidentiality agreements.

Jacob Munson

unread,
Oct 23, 2009, 2:10:21 PM10/23/09
to bs...@googlegroups.com
The program needs to get the speed at which a device is moving, and then perform an action based on that result.

Aren't most GPS systems only accurate down to 10-20 yards?  It seems like unless you are on an airplane, checking more frequently than every few seconds is overkill.

Beau Adams

unread,
Oct 23, 2009, 2:13:45 PM10/23/09
to bs...@googlegroups.com

It’s good to know that would be overkill.

 

While being in the beginning stages of this deal, there is a bloody lot I still need to learn about it. J So far the climb has been fun and challenging to say the least.

 

Thank You

Beau Adams

 

From: bs...@googlegroups.com [mailto:bs...@googlegroups.com] On Behalf Of Jacob Munson
Sent: Friday, October 23, 2009 11:10 AM
To: bs...@googlegroups.com
Subject: [BSDG] Re: Windows Mobile Development

 

The program needs to get the speed at which a device is moving, and then perform an action based on that result.

Chris Brandsma

unread,
Oct 23, 2009, 2:16:36 PM10/23/09
to bs...@googlegroups.com
With most programmable gps devices you can set how accurate the gps is.  The less accurate you go, the faster the gps track.  For instance, at the least accurate setting, the gps device will acknowledge you are in fact standing somewhere in North America.

Now, as far as using the gps to track speed (presumably vehicle, outside).  Your first task is to define what is close enough from the business perspective. You will never be accurate. Otherwise, if not too many turns are involved, check once every couple of minutes, check the distance and time, and that will give a rough estimate of speed.


On Fri, Oct 23, 2009 at 12:10 PM, Jacob Munson <yaco...@gmail.com> wrote:
The program needs to get the speed at which a device is moving, and then perform an action based on that result.

Aren't most GPS systems only accurate down to 10-20 yards?  It seems like unless you are on an airplane, checking more frequently than every few seconds is overkill.







Chris Brandsma

unread,
Oct 23, 2009, 2:18:14 PM10/23/09
to bs...@googlegroups.com
also, if you are talking about something indoors...give up altogether. GPS receivers on mobile devices are not strong enough to make it through building walls.

Beau Adams

unread,
Oct 23, 2009, 2:21:16 PM10/23/09
to bs...@googlegroups.com

Is the programmability of gps set by users, or can they be set by programs (say the one I build)? Based on the requirements in this project, I believe the gps will have to be set to accuracy within 100 feet perhaps? Maybe more or less I’m not sure just yet. But anyhow, the checks will probably need to be every couple of seconds or so, since the action to be performed is the key to the success of the program in general.

 

Thank You

Beau Adams

 

From: bs...@googlegroups.com [mailto:bs...@googlegroups.com] On Behalf Of Chris Brandsma
Sent: Friday, October 23, 2009 11:17 AM
To: bs...@googlegroups.com
Subject: [BSDG] Re: Windows Mobile Development

 

With most programmable gps devices you can set how accurate the gps is.  The less accurate you go, the faster the gps track.  For instance, at the least accurate setting, the gps device will acknowledge you are in fact standing somewhere in North America.

Jacob Munson

unread,
Oct 23, 2009, 2:21:04 PM10/23/09
to bs...@googlegroups.com
also, if you are talking about something indoors...give up altogether. GPS receivers on mobile devices are not strong enough to make it through building walls.

Maybe he's working on a secret government contract, using satellites and receivers accurate up to 1 millimeter, capable of signal penetration through 10 yards of concrete.  ;)



=====================
Jake Munson
Kuna, ID, USA
http://www.techfeed.net/blog/
http://www.cfquickdocs.com/
http://cfformprotect.riaforge.org/

David Evans

unread,
Oct 23, 2009, 2:21:31 PM10/23/09
to bs...@googlegroups.com

Na, I voting for a stealth method of tracking employees for the state…..  That or a way of tracking truckers as they drive through the state.

 

 

From: bs...@googlegroups.com [mailto:bs...@googlegroups.com] On Behalf Of Jacob Munson
Sent: Friday, October 23, 2009 12:21 PM
To: bs...@googlegroups.com
Subject: [BSDG] Re: Windows Mobile Development

 

also, if you are talking about something indoors...give up altogether. GPS receivers on mobile devices are not strong enough to make it through building walls.

Beau Adams

unread,
Oct 23, 2009, 2:24:18 PM10/23/09
to bs...@googlegroups.com

Maybe he's working on a secret government contract, using satellites and receivers accurate up to 1 millimeter, capable of signal penetration through 10 yards of concrete.  ;)

 

Not a bad guess. It is actually going to be 15 yards of concrete, 2 yards of brass, and 5 yards of that plastic Electromagnetic shielding that prevents EM interferance. :D

 

Thank You

Beau Adams

 

 

 

 

 

From: bs...@googlegroups.com [mailto:bs...@googlegroups.com] On Behalf Of Jacob Munson
Sent: Friday, October 23, 2009 11:21 AM
To: bs...@googlegroups.com
Subject: [BSDG] Re: Windows Mobile Development

 

also, if you are talking about something indoors...give up altogether. GPS receivers on mobile devices are not strong enough to make it through building walls.

Beau Adams

unread,
Oct 23, 2009, 2:26:14 PM10/23/09
to bs...@googlegroups.com

Heh.. a friend of mine down in Nampa was recently caught in an affair scandal. I know of one person for sure who would buy the trucker tracker idea, his wife. :-/

Chris Brandsma

unread,
Oct 23, 2009, 2:31:29 PM10/23/09
to bs...@googlegroups.com
Breaking down your requirements here...

You will also have to store the location data.  This is a case where the registry is absolutely the wrong choice.  Too much data, and accessing the data way too often for the registry. Either an xml file or a database will work (SQL Server CE and SQLite both work on mobile devices).

Here is the api for gps: http://msdn.microsoft.com/en-us/library/bb158501.aspx
this is Windows Mobile 6 and up only.  If you are talking Windows Mobile 5, you had better pray the device manufacturer has their own api for you.

Nolan Letellier

unread,
Oct 23, 2009, 11:29:45 PM10/23/09
to bs...@googlegroups.com
One more thing -- with mobile cell-phone-based gps (i.e. not satellite
gps), if you don't have multiple towers in range (potentially an issue
here in Idaho), you are probably moving as fast as the tower, at a
location that may seem to be at the tower.

You haven't indicated if battery life is a question. Depending on
your goal and implementation platform and power source, you may be
able to actually have satellite gps pulling power off a vehicular
power supply (i.e. battery life is less an issue, but still a concern)
-- depends on your goals. What I am actually remembering is some of
the ipaq devices that had a GPS plug-in you could add -- I've not
programmed or used one, but the general concept and modular
construction may be useful depending on your intent.

Other add-ons depend on what type of velocity you want to measure and
the accuracy you need -- perhaps an accelerometer to provide some
"hints" at intermediate velocity trends? Again, this is probably an
add-on to a mobile device, not something that would be in most phones,
and only provides a slightly different view of velocity, and is not a
standalone general purpose velocity measurement methodolgy. MSDN did
an article on accelerometers recently.

http://msdn.microsoft.com/en-us/magazine/ee413721.aspx

ideas from a slightly different perspective on the potential solution space...

Mike

unread,
Oct 26, 2009, 10:31:29 AM10/26/09
to BSDG
Actually most of it depends on the GPS device itself. My hand held
device regularly is accurate down to 6 feet, even in a car heading
down the freeway. A friend of mine had a GPS plugin unit for his PDA
(sound a lot like what Beau would use), and that drained his batteries
faster than any running app. He usually turned it on ran it for a
minute or two to check his directions and create a trail, then turn it
off.

As for the PDA goes, the emulators are just a pain in the butt to
use. It's difficult to configure and get up and running. And they
have a ton of quirks. Having the real thing in front of you, makes
life so much easier. You can see what's installed. Even move the pda
to another computer and run the app when cradled to another system.
You just have to find the debug mode installed app.

Enjoy and good luck.
Mike

Beau Adams

unread,
Oct 26, 2009, 12:19:37 PM10/26/09
to bs...@googlegroups.com
Thanks folks. A lot of info provided is helping shape the directions I go.
The target of this program will be cell phones/pda's and the intent is to
lock/unlock the device based on the rate of movement (which can most likely
only be achieved in vehicles). Me being me, always code for worst case
scenario. So I have established that as running on battery power, the need
for accuracy measured within a couple seconds, and minimal power drain. But
the real world and ideas are most likely going to clash a bit in this deal.

Thank You
Beau Adams

-----Original Message-----
From: bs...@googlegroups.com [mailto:bs...@googlegroups.com] On Behalf Of Mike
Sent: Monday, October 26, 2009 7:31 AM
To: BSDG
Subject: [BSDG] Re: Windows Mobile Development


Reply all
Reply to author
Forward
0 new messages