jeudi 21 mai 2015

Android - Tamagotchi game background service

I try to build a Tamagotchi game with Unity for Android. The Tamagotchi has a food attribute that should go down even when the Game is closed.

So my approach would be build a IntentService that holds the variables, increase and decrease them if needed. For Batterie reasons i would use Alarm manager to start the Service only every 10 minutes if the App is closed. If the app is started it would bind the Service so it never closes and i can get the Variables.

Is there a more efficient way to handle this? I dont want my app to battery drain too much.

€: If the food gets low it should also display a notification.

Aucun commentaire:

Enregistrer un commentaire