我可以prevent从停止我的Andr​​oid应用程序的用户? [英] Can I prevent the user from stopping my Android application?

查看:172
本文介绍了我可以prevent从停止我的Andr​​oid应用程序的用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的要求是为一个企业应用程序。该应用程序将在设备开机启动。它会在后台运行,用户不应该能够禁用或停止应用。在Android中,用户可以进入设置 - >应用程序 - >管理应用程序,并停止我的应用程序。有没有什么办法prevent这种情况的发生?

The requirement is for an enterprise application. The application will be started on device boot. It will be running in the background and the user should not be able to disable or Stop the application. In Android a user can go to Settings->Application->Manage Application and stop my application. Is there any way to prevent this from happening?

推荐答案

您不能使你的应用程序长生不老,但它取决于你真正想做的事情。这是可能的收到很多手机的事件,并执行即使你的活动/服务没有运行code。您可以使用 BroadcastReceivers 寻找有趣的事件,然后启动服务。我这样做是为将事件发送到主服务器的用户已经收到时/打了一个电话的企业应用程序。

You can not make your application live forever, but it depends on what you really want to do. It's possible to receive a lot of events of the mobile and execute code even if your Activity/Service is not running. You can use BroadcastReceivers to look for interesting events and then start a service. I do it for an Enterprise Application that sends an event to a main server when the user has received/made a call.

这篇关于我可以prevent从停止我的Andr​​oid应用程序的用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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