This is a migrated thread and some comments may be shown as answers.

how to make an app run in background.

10 Answers 286 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ajay
Top achievements
Rank 1
Ajay asked on 13 Aug 2013, 07:50 AM
hi, i want to update location information every n minutes, for this to happen my app must run in background(when the screen is off or other application is running) how to achieve this on android?

thanks in advance

10 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 13 Aug 2013, 07:54 AM
Hello Anup,

To keep the app running in the background on Android, it’s necessary to acquire a partial wakelock (see android powermanager for more info). In Cordova, you need to use a plugin to achieve this and luckily there is already an existing Cordova plugin to do this. For more information on adding custom Cordova plug-in to Icenium, please see Working with Custom Plugins documentation section.

Since the plug-in is currently not compatible with Cordova 2.7 and plugman specifications, you would have to modify it in order to be able to use it. We've already posted the instructions for the modification of this plug-in and the modified plug-in itself in this forum thread, so please review them carefully and follow the documentation instructions in Working with Custom Plugins help articles.

Regards,
Steve
Telerik

Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Ajay
Top achievements
Rank 1
answered on 13 Aug 2013, 10:40 AM
hi, thanks for quick reply.
i tried downloading  zip but its been failed many times.
now i got it downloaded but there is no plugin.xml file in the downloaded zip.

thanks,
0
Steve
Telerik team
answered on 13 Aug 2013, 11:36 AM
Hello Anup,

Yes, I've already mentioned that this plugin is not plugman compatible and also provided you with a link to an Icenium forum where we've already made it compatible. You can download the modified plugin from here.

Regards,
Steve
Telerik

Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Ajay
Top achievements
Rank 1
answered on 13 Aug 2013, 12:09 PM
hello steve.
ya after importing that plugin its giving build failed error.
have modified plugin.xml as suggested in childbrowser example.

thanks
0
Ajay
Top achievements
Rank 1
answered on 13 Aug 2013, 12:50 PM
yes build succeeded ..
how to check in device whether its running in background.
0
Ajay
Top achievements
Rank 1
answered on 13 Aug 2013, 02:49 PM
hi,
thanks for the help steve, its working now.
0
Warren
Top achievements
Rank 1
answered on 04 Oct 2013, 06:42 PM
Anup, how did that plugin work for you? I am just not trying Icenium and love that a plugin for this is available.

Question - does this only work on Android? What about an iPhone or iPad?

Thanks,

Warren
0
Steve
Telerik team
answered on 07 Oct 2013, 08:09 AM
Hello Warren,

The PowerManagement plugin is available for iOS as well and has already been updated to be compatible with Apache Cordova 3.0.0. You can get the latest version for iOS from here

To update the plugin in your project, just replace the existing plugin files with the updated ones. Make sure to make any necessary modifications in the code, including any references. The quickest way to do that is as follows:

  1. Download the plugin and if not already archived, zip it.
  2. In Icenium, in the Project Navigator, expand the Plugins folder and delete the subfolder for your plugin.
  3. Add the updated custom plugin as per these instructions.

Note that plugin.xml has been updated and the plugin script is declared in a <js-module> element and you do not need to make any <script> references in your code.

We have verified that you can build the updated iOS plugin against Cordova 3.0.0 projects. We have not verified if the plugin functionality works as expected.

Regards,
Steve
Telerik
You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Zinc
Top achievements
Rank 1
answered on 15 Jul 2014, 12:49 AM
How does this solve the original question?  I want to call a javascript function every n minutes which queries a web service, but how does this work with this plugin when running in the background?
0
Kaloyan
Telerik team
answered on 17 Jul 2014, 02:24 PM
Hi Zinc,

Perhaps you could benefit from the Background Fetch plugin. You can check the articles, here in order the find out how to work with custom Cordova plugins.

I hope that helps. Please, let me know if this is not what you are looking for and I will try to assist you further.

Regards,
Kaloyan
Telerik
 

Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

 
Tags
General Discussion
Asked by
Ajay
Top achievements
Rank 1
Answers by
Steve
Telerik team
Ajay
Top achievements
Rank 1
Warren
Top achievements
Rank 1
Zinc
Top achievements
Rank 1
Kaloyan
Telerik team
Share this question
or