在Android Wear中创建后台服务 [英] Create a background service in android wear

查看:111
本文介绍了在Android Wear中创建后台服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去几天,我一直在尝试为手表创建闹钟应用程序。而且找不到任何线索,我们可以如何为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.

例如,以下是创建后台服务的教程:
http://developer.android.com/training/ run-background-service / index.html

For example, here is a tutorial on creating a background service: http://developer.android.com/training/run-background-service/index.html

还有关于后台服务的stackoverflow问题:
在Android中创建后台服务

And a stackoverflow question about background services: Creating Background Service in Android

如果您希望运行某个应用可穿戴设备,您仍然需要提供一个最小的手机应用程序,才能通过Google Play将其交付给手机。有关包装的更多信息,请参见: https://developer.android.com/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: https://developer.android.com/training/wearables/apps/packaging.html

这篇关于在Android Wear中创建后台服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆