It is currently Sat Apr 29, 2017 4:22 am



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  [ 3 posts ] 
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: 1128
Location: From Blighty
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  
 
 Post subject: Re: Marshmallow 'Doze' and BASIC!
Unread postPosted: Tue Apr 25, 2017 3:11 am 
Offline
User avatar

Joined: Sat Dec 08, 2012 2:14 am
Posts: 1128
Location: From Blighty
Hmm... Although the code works it got stuck on just showing 1 satellite and when lost duplicating the same time stamp and info. I have environmental issues where I am it seems. In theory, you need line of sight of at least 3, which should be overhead at any given time for GPS to work I know, but if I'm in line of sight of at least one to pick up for this experiment it won't matter.

I read this post:-

gps-can-t-refresh-after-i-turn-off-t2788.html

Aat showed an idea that I can incorporate in this. But I guess I might shelve this post for now...

Mog


Report this post
Top
 Profile  
 
 Post subject: Re: Marshmallow 'Doze' and BASIC!
Unread postPosted: Tue Apr 25, 2017 6:12 am 
Offline

Joined: Tue Dec 04, 2012 10:50 am
Posts: 644
Location: UK
Mog wrote:
Hmm... Although the code works it got stuck on just showing 1 satellite and when lost duplicating the same time stamp and info. I have environmental issues where I am it seems. In theory, you need line of sight of at least 3, which should be overhead at any given time for GPS to work I know, but if I'm in line of sight of at least one to pick up for this experiment it won't matter.

Erm, are you living in a cave? You should be able to see lots of GPS satellites even in daylight...

Mike.


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


Who is online

Users browsing this forum: No registered users and 3 guests


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