locked
gps battry consumption in WM6 RRS feed

  • General discussion

  • Hi,

    I am developing an application for windows mobile and found that the GPS really drains a lot of battery.

     

    Well for now, I need some help to optimize my code so that the device will less battery.

    I am using WM6 & c#.NETCF 2.0.

    The c# sample code given by Microsoft where the method UpdateData() is getting called continuously drains a lot of battery.

    So I have modified my code and now it is like this-

     

    gps.Open();

    gps.GetPosition();

    gps.Close();

     

    I wonder that the app will get hanged up at the statement "gps.GetPosition();" in case the device is under a roof and not connected to the satellites. So is it that it will keep searching for satellites and get blocked at the statement gps.GetPosition(); ??

    Any help highly appreciated.

     

    Thanks in advance,

    Anky

    Thursday, November 5, 2009 1:48 PM

All replies

  • What you can do is use the position changed event, once you get the first valid position then close the GPS device

    Thursday, November 5, 2009 2:06 PM
  • How often are you retrieving the device's location?
    Joel Ivory Johnson
    It takes all the running you can do to stay in one place.If you want to get somewhere else,you must try to run at least twice as fast as that.
    Thursday, November 5, 2009 6:16 PM
  • Hi,

    I wouldn't have thought that calling GetPosition would be a blocking call, if no data was retrieved at the point of calling the method then no data would be returned.

    Hope this helps.

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    Thursday, November 5, 2009 6:59 PM
  • Hi Joel,

    If I use the sample code given by microsoft at the location-
    C:\Program Files\Windows Mobile 6 SDK\Samples\PocketPC\CS\GPS

    then it consumes a lot of battery. Any solution for that.

    Isn't there any property that we can set through coding so as to set the battery consumption requirement.


    Thanks in advance,
    Anky
    Friday, November 13, 2009 7:21 AM
  • Could you answer the question I asked earlier?  How often are you retrieving the device's position?


    Joel Ivory Johnson
    It takes all the running you can do to stay in one place.If you want to get somewhere else,you must try to run at least twice as fast as that.
    Friday, November 13, 2009 1:20 PM
  • Hi Joel,

    I had tried to do the foloowing-

     

    gps.Open();

    gps.GetPosition();

    gps.Close()

    but this does not work well..

    So, it is not that I am retrieving the device's location after some time interval.

    I am using the sample code given in the WM6 SDK.

    That same sample code which gets copied to the location C:\Program Files\Windows Mobile 6 SDK\Samples\PocketPC\CS\GPS.

    In this code the method UpdateData gets called continuously without any time interval.

    This drains a a lot of battery. Any solution for this problem.



    Thanks in advance,
    Anky
    Saturday, November 14, 2009 3:07 PM