Android Question [SOLVED] - Timer is paused randomly when phone is not connected to our computer to display the logs

rleiman

Well-Known Member
Licensed User
Longtime User
Greetings,

Can you look at this small linked B4A project?

It's a simple project that has a ticking timer that ticks in the background once every second. This works only when the phone is connected to my computer and I watch the logs so the ticks in B4A with or without the phones screen turned on. If I disconnect the phone from the computer, it still runs in the background but the timer skips as shown in the attached screen shot. If you look at the attachment, it shows the timer pausing for about 7 minutes randomly.

We ran this app on a Samsung S10 Plus with Android version 11 installed.

The code is based on this app that also runs in the background.

https://www.b4x.com/android/forum/threads/background-location-tracking.99873/a

I'm not sure why the timer skips ticking randomly only if the phone if not connected to the computer.

All help will be greatly appreciated.

Screenshot 2021-03-15 at 17.04.27.png
 

Attachments

  • Project.zip
    14.4 KB · Views: 178
Last edited:

rleiman

Well-Known Member
Licensed User
Longtime User
1. There is a comment link at the top of B4XMainPage that you can use to export the project: 'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
Do it and upload the zip to the forum directly.

2. Post the logs as text.
Thanks. It allowed me to upload the project without worrying about the "file is to large" message. :rolleyes:
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
I'm going to mark this thread as solved because I thought I should try an experiment by using the B4A bridge. When I took the phone off the computer and used the B4A bridge as a connection to B4A to view the logs, the the timer ticked without skipping any seconds. That means that viewing the logs from a timer using the USB direct connection to the computer and viewing the logs from the timer has an issue. For now, I will keep using the B4A bridge unless I don't have access to the internet for app development.
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Anyway why do you persist in using USB debugging via a cable, we've had this conversation before, stick to using B4X-Bridge. Oh yes and learn how to use B4XPages, you've been a member for 10 years and should know to go with the flow by now.
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
Anyway why do you persist in using USB debugging via a cable, we've had this conversation before, stick to using B4X-Bridge. Oh yes and learn how to use B4XPages, you've been a member for 10 years and should know to go with the flow by now.
Yes, that's what I will be doing.
 
Upvote 0
Top