问题
I have been trying to create an alarm application for my watch for past few days. And unable to find any clue that how we can create a background service for android wear. Even I didn't find anything in the developer guide for android wear.
But, I just want to create this application only for android wear and don't want to synchronize data from my cell phone.
回答1:
Android Wear is based on the same architecture as regular Android phones. So if you want to create a background service, you do it exactly the same as you would on a phone.
For example, here is a tutorial on creating a background service: http://developer.android.com/training/run-background-service/index.html
And a stackoverflow question about background services: Creating Background Service in Android
If you want an app to run on the wearable, you will still need to provide a minimal phone application to deliver it to phones via Google Play. More information about packaging is here: https://developer.android.com/training/wearables/apps/packaging.html
来源:https://stackoverflow.com/questions/31091402/create-a-background-service-in-android-wear