views:

84

answers:

2

I will soon work on a project about a mobile application. This application will work on a PDT with Windows Mobile and we will use Visual Studio and .NET to developp it.

This application will intensively use Wifi and need to consume as little power as possible. I found on the internet a lot of stuff concerning embedded software and real time systems, which deal with power management. But this stuff is very hardware related, and does not talk about software design.

I also found some interesting best practices but that mainly focus on the code of the application (for example, close handles as soon as possible or use few I/Os).

I would like to know if you are aware of some leads concerning the architecture or the design of such application.

I also saw advice about the use of event driven architecture: is it so useful concerning power saving ? And is it usable with the Compact Framework ?

Thanks for your help.

Edit: Ok, so Dave gave us some clues, that we could call architecture decisions. So i think i see clearly what could be done at two differents levels:

  • at a high-level, such decisions as Dave's ;
  • at a low level of abstraction, close to the code, tricks and tips that minimize the battery consumption.

What about at a middle level of abstraction (during the design phase) ? Is there some methodology for low-power software design (design patterns, what so ever...) ?

Links: http://msdn.microsoft.com/en-us/library/aa455167.aspx

http://www.eventhelix.com/RealTimeMantra/Basics/

A: 

Use the wifi and other power-intensive functions as infrequently as possible. If it's practical, batch wifi transmission when a certain number of requests are pending rather than doing it on-demand.

Dave Swersky
+1  A: 

Perhaps you could link to the best practices you've found. What kind of leads besides them are you expecting? I suppose this was part of what you found, whereas this is more targeted towards laptop multicore processors.

Windows Mobile is a soft real time system at best, and very far from hard real time. I doubt you'll find much use in that kind of description and advice.

Otherwise, I'd say you have fairly standard stuff. Keep off the Wifi if you can, as well as other devices. Use cacheing if you have the memory available (but measure what's happening so the cache doesn't become a liability). Never, ever do an idle loop, but use Thread.Sleep() or better, try to make everything event-driven, with short processing bursts. Threads can be your friends, used wisely.

And, of course, profile like crazy. The more efficient your code is in terms of CPU usage, the better.

But more specific advice would have to depend on the problem you're trying to solve. Why is your application Wifi-intensive? What information does it need to receive or send? Who are the users, and where do they move? Are there any heavy calculations involved? How much user interface do you need to present? Have you targeted specific hardware yet (specific CPU and WLAN interfaces will have different power consumption behaviours).

Pontus Gagge