Android Question Is this how to create a service?

tsteward

Well-Known Member
Licensed User
Longtime User
Trying to create a service that will run every night at 23:59
At the moment it will save the call log for that day to a text file.

I have no idea about services and setting a repeating time.
What I have written appears to work but I feel it just keeps running as when I delete the file it creates it immediately replaces it.
 

Attachments

  • CallLogger.zip
    379.8 KB · Views: 174

mangojack

Expert
Licensed User
Longtime User
Hopefully it helps ..
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please use File - Export as zip when uploading projects.

Your scheduling code is incorrect. It will fire several times between 23:59:00 and the next day. You can add a flag that checks whether it already ran today and avoid sending more mails. Or you can correctly calculate the time for the next day. There should be several examples of that in the forum.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…