在谷歌Play商店服务基础Android应用 [英] Service based Android application on Google Play Store

查看:164
本文介绍了在谷歌Play商店服务基础Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个应用程序,将只包含几个服务,也没有活动(即无UI)
基本上我想有2〜3个服务在后台,当用户安装该应用程序他/她的设备上正确运行。

我有几个问题,这样的:

  1. 如何将应用程序安装后,我的服务启动?我的的BroadcastReceiver 应该听哪个事件?
  2. 如何打包我的应用程序部署在曲棍球Play商店中的应用程序?
解决方案

您不能这样做,在新的机器人。 Android的具体需要用户交互启动服务之前 - 用户将需要在物理上启动应用程序。如果你的应用程序不显示任何东西,用户将是很迷茫。

所以,创建一个活动解释什么是刚发生时的用户,注册您的接收器那里。

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?

解决方案

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.

这篇关于在谷歌Play商店服务基础Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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