提供的其他应用程序后台服务 [英] Providing a background service for other apps
问题描述
我是新的Android开发,我找不到这个开发指南中。
I'm new to Android development and I couldn't find this in the Dev Guide.
我想创建一个后台服务,使任何其他应用程序可以连接到它,并从中得到一些数据。只见android.app.Service,但它似乎只允许其他应用程序来ping服务,它不允许他们登记为某些特定的事件。 我脑子里想的东西像内置的LocationManager及其addProximityAlert甚至requestLocationUpdates。
I would like to create a background service so that any other app could connect to it and get some data from it. I saw android.app.Service, but it seems that it only allows other apps to ping the service, it doesn't allow them to register for some specific events. I had in mind something like the built in LocationManager and its addProximityAlert or even requestLocationUpdates.
是这样的事可能与现有的SDK?
Is anything like this possible with the existing sdk?
推荐答案
您好,欢迎到Android的发展。我希望你过得愉快:D。 关于你的问题:
Hi and welcome to android development. I hope you enjoy your stay :D. About your question:
你问什么是有服务一做>。 如果你想要的应用程序,以注册事件是通常做的是以下内容:
What you are asking is done with a Service. If you want apps to register for events what is usually done is the following:
- 所有的逻辑创建服务。
- 请该服务发送一个广播味精。
- 在所有感兴趣的应用程序都将有一个接收器类来获得味精。
我想知道你正在尝试做的,给你更多的帮助的东西。
I would like to know what you are trying to do to give you further assistance.
这篇关于提供的其他应用程序后台服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!