Run App in Background

edited December 2013 in Android Mode

Is it possible to run an app in background when it´s closed? The app shouldnt exit when the back button is pressed,it should run minimized to perform actions.

greetz

Answers

  • edited December 2013

    Back button?

    How are you deploying your sketch?

    Edit- Nevermind, I see this is in the "Android Mode" forum.

  • What do you want your app to do when it isn't visible?

    Processing's Android implementation uses an Activity, which is only capable of performing actions when it is displayed (this is the user-viewable part of the app). To run code in the background, you need a Service. Processing does not currently support Services. If you want to include this functionality in your app, you will probably need to move to a bigger and better IDE, such as Eclipse.

    At this point, you should probably re-evaluate exactly what you want to achieve. Perhaps Processing isn't the best choice for writing the app that you have in mind. If you do switch to Eclipse, though, you can continue to use Processing's APIs... it is just a little bit more complicated.

Sign In or Register to comment.