English 中文(简体)
• 如何配备一个星体服务,使电话库活着
原标题:How to have an android service keep the phonegap ui alive

I am working on an android application that uses phonegap/cordova. This app uses a javascript to fetch content from the server from time to time and issues a systemtray alert if there is new content. The problem I was facing was that the app would eventually just quit when android was short on memory or whatsoever.

因此,我对我的发言做了补充(任何人说,服务会解决问题)。

<service android:name="UpdateService" />

更糟的是,只有提供这种服务,就没有(明显)。 因此,我如何使我的服务成为保持运作的主要应用?

ADDITION: I also managed to start the service in my main application

最佳回答

在AlarmManager登记一名待决实体,以确保其申请能够运行每个零秒。 如果有人开车,你可以再次申请。

采用诸如此等一些法典,以开始适用:

Intent serviceIntent = new Intent("com.myapp.LaunchActivity");
startService(serviceIntent);

替换com.myapp.LaunchActative, 替换为你的包裹名称和发射方法。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签