Solved

Running a mobile application in the background

Posted on 2004-10-14
7
136 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.

771 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

11 Experts available now in Live!

Get 1:1 Help Now