如何在后台运行应用程序? [英] How to run the application in the background?

查看:104
本文介绍了如何在后台运行应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个应用程序。我想在后台运行我的应用程序。那么如何编写代码。请告诉我,因为我对这项技术非常新。

解决方案

一般的答案是,你不能在后台运行你的应用程序,除了某些情况。



Doc说,


此后不久,大多数进入后台状态的应用程序都会被移至暂停状态。处于此状态时,应用程序不会执行任何代码,并且可能随时从内存中删除。为用户提供特定服务的应用程序可以请求后台执行时间以提供这些服务。


所以只有一些特定的服务,如 audio,location和voip 服务可以在后台执行。阅读 在后台执行代码 doc,了解有关后台服务的更多详细信息。


Iam doing one application.In that i want to run the my application in the background.So how to write the code for that.Please tell me because iam very new for this technology.

解决方案

The general answer is, you can not run your application while in background, except certain cases.

Doc says,

Most applications that enter the background state are moved to the suspended state shortly thereafter. While in this state, the application does not execute any code and may be removed from memory at any time. Applications that provide specific services to the user can request background execution time in order to provide those services.

So only some specific services like audio, location and voip services can execute in background. Read this Executing Code in the Background doc for more detail regarding the background services.

这篇关于如何在后台运行应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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