很好的 Android 服务示例应用程序
是否有一个很好的示例应用程序或教程来创建在后台运行的 android Service
?
Is there a good sample application or tutorial for creating android Service
that run in the background?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Android API 演示包括远程服务示例。我认为我们用它作为后台服务的起点。 Service 类的文档中还有示例代码。
The Android API Demos include a Remote Service sample. I think we used it as the starting point for our background service. There is also example code right in the documentation for the Service class.
好吧,除了我自己的应用程序之外,我什么都不知道。但这是真实的应用程序,带有所有额外的代码,而不是示例。
如果您仍然想尝试一下,我建议您在 Calculator_Activity.java< /a> 以及 Calculator_Service.java。这应该会给你一些想法。
Well, I don't know any apart from my own application. But that is real applications with all the extra code that comes with it and not sample as such.
If you still want to have a go you I suggest you look for Service_Intend and Service_Connection in Calculator_Activity.java and for Calculator_Thread and Binder in Calculator_Service.java. That should give you some idea.