Google Play Store 上基于服务的 Android 应用程序 [英] Service based Android application on Google Play Store

查看:29
本文介绍了Google Play Store 上基于服务的 Android 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,它只包含一些服务并且没有活动(即没有 UI)
基本上,当用户在他/她的设备上安装应用程序时,我希望有 2 到 3 个服务在后台运行.

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.

对此我有几个问题:

  1. 应用安装后我的服务将如何启动?我的 BroadcastReceiver 应该监听哪个事件?
  2. 如何打包我的应用程序以将其应用程序部署到 Google Play 商店?

推荐答案

你不能在较新的 Android 上这样做.Android 在启动服务之前特别需要用户交互 - 用户需要物理启动您的应用程序.如果您的应用程序没有显示任何内容,用户将会非常困惑.

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.

因此,创建一个 Activity 向用户解释刚刚发生的事情,并在那里注册您的接收器.

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

这篇关于Google Play Store 上基于服务的 Android 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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