It's not a secret anymore!*
The moose likes Java Micro Edition and the fly likes How do my app gets restarted so that I could launch it from Emulator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "How do my app gets restarted so that I could launch it from Emulator" Watch "How do my app gets restarted so that I could launch it from Emulator" New topic
Author

How do my app gets restarted so that I could launch it from Emulator

Sriram Padavala
Greenhorn

Joined: Aug 07, 2011
Posts: 5
Hello,

I am doing a small game in J2ME with netbeans IDE 6.9.1 and I have a small problem.

I have created the code and the logic and everthing is ok. Now when I press the exit button the application is destroyed and it is not shown in Emulator to start it again.

I have written destroyApp(true) and notifyDestroyed() only in the exit command section.

My previous application also the same code but different logic will show up in Emulator when I press exit. So that I will launch it again.

Please help me. This is the last section of my assignment. If completed I could deliver it.

Reply fast !!!
Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
Try: run project via OTA. It will do a simulated installation onto the emulator device.
Sriram Padavala
Greenhorn

Joined: Aug 07, 2011
Posts: 5
Hello,

I did not get you. what do you mean by OTA. I don't know what it is. I should submit my project so that it should run in Netbeans. So I want a solution for that.

Can you please elaborate your suggestion. Please I will be loosing more marks if I cannot resolve this issue.

Thank you
Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
OTA or "over the air" is a way to simulate the install of your application onto the emulator just like it would be if you were installing in to a real device.

Right-click your project, Choose Properties, click Running in the left hand pane, and choose Execute through OTA. Follow the prompts to install it.

I don't have Netbeans installed, so I can't verify this is how to do it in the current version.

If you have problems consult Netbeans Help.
Sriram Padavala
Greenhorn

Joined: Aug 07, 2011
Posts: 5
Hello,

Thank you for that but it says that .jad for the application does not appear to be correct type.

So its not even running like before.

First of all did you get me what my problem is..
If so is there any other you could help me

Thank you
Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
All I understand is that you need to submit your project somehow to someone, perhaps outside of your development space. Is this a test assignment? Did they not give you directions on how they want it submitted?
Sriram Padavala
Greenhorn

Joined: Aug 07, 2011
Posts: 5
Hello,

Yes its my project and not for the others. Its not a test assignment but its a real assignment in my university circulum. They did not give any directions. But they just gave me the screen shots on how should the screens appear. I have already contacted my professor about this. But unfortunately he is out of town upto aug 22nd. But I have to submit it by aug 15th.

My problem is:

In my previous application
When I press the exit button in my application. It returned to the emulator screen where I shall have three options.
1. Install Application
2. Manage certificate authorities
3. (myapplication name)

So that I could launch it again by clicking on it in the emulator itself.

But in my new application

the first two options are visible but the third option is just closing away in fraction of seconds.
I am left with only first two options and I dont find any way to restart my application without closing the emulator.

This is my problem
Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
Do you still have your first program, and, if so, does your first program continue to show the same, repeat, behavor? I think it could be the case that your first program is still running, in the background, perhaps in the paused state.

One way to find out is to select your application in the emulation screen, go to the emulation screen's menu and see if "Bring to foreground" is enabled, and if it is than the program is still running.

Usually, to get your program to stick around in the emulator, even after it is closed, you would set your project to use the OTA mode.

You're getting an error, I know, but this appears to be a bug in Netbeans. It is beyond my level of understanding, but in a quick search of the internet I see that a lot of people are having the same trouble with Netbeans 6.* and InvalidJadException when run in OTA mode.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do my app gets restarted so that I could launch it from Emulator