It is currently Sun Mar 26, 2017 11:36 pm



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Marshmallow 'Doze' and BASIC!
Unread postPosted: Sun Mar 19, 2017 7:36 am 
Offline
User avatar

Joined: Sat Dec 08, 2012 2:14 am
Posts: 1108
Location: UK
Recently, I upgraded to Marshmallow and was wondering what effect this would have on BASIC!.

In short, what I understand is this:-

'Doze' mode interferes with applications that require constant connectivity, with some exclusions to Social Media apps. But not affecting the 'radio' side, text messaging, phone calls... It's all about trying to save battery life.

 'Doze' works when your device is idle, say laying flat on a table and not being disturbed and unplugged from a charger or USB.

Has anybody done any tests with their apps on devices with this?

I thought I conduct an experiment with GPS... I can't do this until overnight (It's Sunday afternoon here in the British Isles). So I'm posting now, with any thoughts if this may work. Any amendments or other information to offer would be good!

I'll post my own results on Monday morning.

So, I've put down this code for maybe fellow users to try, if they so wish to maybe participate in a collective experiment. It runs every five minutes and puts .txt log in the data folder of BASIC!. You just need to push the power button in to put the device to sleep and lay it idle somewhere.

Note:- The way I coded the text file was to overwrite any previous data. I must remember this (best have my pot of early morning tea first) and also hope Android doesn't close my program down to clear up space for RAM reasons!

I will also put my phone into flight mode first as GPS still works.

Code:
GPS.OPEN
WAKELOCK 1

TEXT.OPEN w, doze, "marshbas.txt"
PRINT "* Doze mode Marshmallow test *"
PRINT "Log: /rfo-basic/data/marshbas.txt
PRINT "Waiting for satellites..."

DO
  GPS.SATELLITES satellites
  PAUSE 1
UNTIL satellites > 0

PRINT "Program will check every 5 minutes. Press power button, do not disturb device, and keep unplugged."

elapsed = CLOCK()

DO
  TEXT.OPEN a, doze, "marshbas.txt"
  i = i + 1
  TIME , , , hour$, minute$, second$
GPS.TIME gpsTime
  systemTime$ = INT$(i) + " | " + "System time: " +  hour$ + ":" + minute$ + ":" + second$
  PRINT systemTime$
  gpsTime$ = "    GPS time   : " + USING$ ("", "%tT", INT(gpsTime))
  PRINT gpsTime$
GPS.SATELLITES satellites
  IF satellites > 0 THEN
    satellites$ = "    Number of satellites: " + INT$(satellites)
  PRINT satellites$
  ELSE
    satellites$ = "    * GPS failed."
  PRINT satellites$
  ENDIF
  file$ = systemTime$ + CHR$(13) + gpsTime$ + CHR$(13) + satellites$ + CHR$(13)
TEXT.WRITELN doze, file$
TEXT.CLOSE doze

  DO
    PAUSE 1
  UNTIL CLOCK() - elapsed > 300000
 
  elapsed = CLOCK()
UNTIL 0

ONBACKKEY:
PRINT "Back key pressed to exit."
END


Research list:-

https://developer.android.com/training/ ... stand_doze

http://stackoverflow.com/questions/3228 ... -doze-mode

https://developer.android.com/training/ ... _use_cases

Mog


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred