过去几天,我一直在尝试为手表创建闹钟应用程序。而且找不到任何线索,我们可以如何为Android Wear创建后台服务。即使在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.
但是,我只想为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.
推荐答案Android Wear基于与常规Android手机相同的体系结构。因此,如果您要创建后台服务,则其操作与在电话上完全相同。
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.
例如,以下是创建后台服务的教程: developer.android/training/ run-background-service / index.html
For example, here is a tutorial on creating a background service: developer.android/training/run-background-service/index.html
还有关于后台服务的stackoverflow问题: 在Android中创建后台服务
And a stackoverflow question about background services: Creating Background Service in Android
如果您希望运行某个应用可穿戴设备,您仍然需要提供一个最小的手机应用程序,才能通过Google Play将其交付给手机。有关包装的更多信息,请参见: developer.android/training/ wearables / apps / packaging.html
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: developer.android/training/wearables/apps/packaging.html
更多推荐
在Android Wear中创建后台服务
发布评论