Android Question Background Service without notification

khwarizmi

Active Member
Licensed User
Longtime User
Hi all
Is it possible to create a service that runs in the background without notification? If not, what is the alternative?
 

MicroDrie

Well-Known Member
Licensed User
Longtime User
A service is a means to achieve the unnamed goal. Without this unnamed goal, it is difficult to name possible alternative means. The and the question is: What do you want to achieve?
 
Upvote 0

khwarizmi

Active Member
Licensed User
Longtime User
I want to set the license validity period for my app, as the license validity period is one month, and I don't want to rely on the date on the user's device as it may be tampered with, I want there to be a service running in the background that provides the app with the correct date.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
I want there to be a service running in the background that provides the app with the correct date.
You can use the Network Time Protocol to set the date and time on the Android device, but that requires <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SET_TIME" /> and an internet connection and user permission. And that last one is also the weakness of this solution, so if your app doesn't use a network connection it won't work. You also have to think carefully about the different time zones, date format differences and how to deal with that.
 
Upvote 0

khwarizmi

Active Member
Licensed User
Longtime User
I don't have a time zone issue because the license starts when you get it, and the app counts 30 days after that, whatever its time zone.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…