Results 1 to 3 of 3

Thread: Keep Phone Awake

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    12
    Vote Rating
    0
      0  

    Default Keep Phone Awake

    Is there anyway to keep the phone from going to 'sleep'?

    I know there are native (Android) methods of handling this like WakeLock and KeepScreenOn, but I can't seem to find a way of doing this with Sencha.

    We're writing an application to track our trucks in the field, but when the phone goes to sleep it stops transmitting the GPS coordinates. We're not concerned about power consumption, because the devices will always be using a car adapter.

    Thanks for any help!

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    I would actually setup the device to handle this. The device will sleep when there is no interaction with it, your app can be animating things or loading stores and that won't affect the device going to sleep.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    12
    Vote Rating
    0
      0  

    Default

    Are you saying that we should setup each phone so that it doesn't sleep (basically set screen timeout to 'never')? That won't work for us because we have thousands of trucks that will use this software.

    If there isn't a way to code stopping the phone from sleeping, is there a way to have a callback function that can fire at a specified interval even if the phone is 'asleep'? So, for example, we could have a callback function that runs every minute, which gets the geolocation of the truck and then goes back to sleep.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •