javaandroidwear-osandroid-wear-data-apiandroid-wear-notification

Create a background service in android wear


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.


Solution

  • 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