Skip to content Skip to sidebar Skip to footer

Service Accessing A Database

Ok guys, I did ask before on how to create a way to run a code always in my app. It's similar to how say iMobeter or something like that check your hp, if it's less than max it'll

Solution 1:

Problem is, I need a service that is always running in the background.

That is not possible. Users can stop your service whenever they want, and Android will stop your service if it lives too long.

Plus, I could not create a service that can access the database. I cant use the cursor there as in it does not support the method.

Yes, it does. Use SQLiteOpenHelper, the same way you would with an activity, content provider, etc.

Post a Comment for "Service Accessing A Database"