Solved

Running a mobile application in the background

Posted on 2004-10-14
7
137 Views
Last Modified: 2010-03-31
i am developing a game which should run in the backgroun,and at periodic intervals display a canvas on the screen, the rest of the time the defautl phone screen should be displayer and the normal working of the phone should not be affected.The application should continue to run even if other applications are opened on the phone.
0
Comment
Question by:ThreeSixtyKL
  • 3
  • 2
7 Comments
 
LVL 11

Expert Comment

by:cjjclifford
ID: 12306895
since you asked in the Java section, I'm guessing MIDP application... since each application is supposed to be started in a new JVM instance each time, there is no (standard) way to do what you want - "running" things in the background would generally be done with a Thread, but that would be something running in the background to the rest of your application, e.g. a IMAP poll in the background of a email client.
However, since the application is started in a seperate JVM instance, when it returns to the main menu, this JVM is likely to be gone, along with all its threads etc.

However, some Operating Systems do provide mechanisms for what you want, e.g. Symbian and Blackberry - these are non-standard APIs, but generally allow various timers to be setup with tasks being run periodically (even processes receiving time-events periodically, e.g. Calendar alarms, etc.
0
 

Author Comment

by:ThreeSixtyKL
ID: 12316291
thanks for answering,but can u give me an idea on how to set up these timers in Symbian os, and yes i am doing the project in the MIDP API.
0
 
LVL 11

Expert Comment

by:cjjclifford
ID: 12317060
actually, now that you ask, I've had another look (I've never actually developed something like this, but had to do some research, as we needed exactly this functionality for something, so we had to figure out what could/could not be done), and it is not generally possible, as far as I can figure, to do this with an MIDP application, in fact, Symbian seems to be fairly straight with the profile definition. The route my research led me was to look at the C++ development environment, sorry...
However, Symbian information is available at: http://www.symbian.com/developer/techlib/papers/java_MIDP.asp
0
 

Author Comment

by:ThreeSixtyKL
ID: 12326147
Is the development of the application possible in C++? have u developed it?

Is there a way by which i do not close my midlet but hide it so that it is still running in the background?

Thanks for you time.
0
 
LVL 11

Accepted Solution

by:
cjjclifford earned 500 total points
ID: 12337066
Hi,

Nope - we didn't actually go as far as to develop something in C++, sorry!
As for not closing a Midlet, but leaving it running in the background, AFAIK there is no standard MDIP way of doing this (but as I said before, some platforms may have their own proprietary libraries, etc - e.g. the Blackberry Java environment).

Cheers,
C.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Android studio getdrawable(int) is deprecated 4 43
topping2 challenge 13 83
starter POM and spring-boot-starter,  spring-boot-web 2 43
Java SE 8u111  Lot of stuff broke 11 54
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now