Service based Android application on Google Play Store

旧巷老猫 提交于 2019-12-20 04:49:47

问题


I'm developing an application which will consists only of a few services and no activities (i.e. no UI)
Basically I want to have 2 to 3 services to be running in the background right from when user installs the application on his/her device.

I have a few questions over this:

  1. How will my services start after application installation? My BroadcastReceiver should be listening to which event?
  2. How can I package my application to deploy it application on Googly Play Store?

回答1:


You can't do that on newer Androids. Android specifically requires user interaction before starting up services - the user will need to physically start your application. And if your application doesn't show anything, the user is going to be very confused.

So create one Activity explaining the user what has just happened, and register your receivers there.



来源:https://stackoverflow.com/questions/14229809/service-based-android-application-on-google-play-store

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!