Big problems in small devices... J2ME

M

Michael Sars Norum

Hi

I'm currently working on a MSc-project where we are creating a framework to
build mobile collaborative applications using ad hoc networks on. In this
work we have encountered a problem which, to put it mildly, puzzles us. I'd
really like to have a discussion here as to what this problem stems from. We
have been trying to debug this problem for almost a week without luck. Our
concern here is that the problems we are facing are fundamental an
unsolvable...

The problem is this:
Our demo apps seem to work fine when using our framework for connecting,
creating networked groups and exchanging messages between them as long as
everything happens automatically. We do this in our MIDlet:

//snippet
protedted void startApp(){
//initing framework...
startSearch();
}

public void startSearch(){
//print message to screen
framework.startGroupSearch(.....);
}
//end-snippet

This works fine both on Nokia 6600 and our emulators. The problem arises when
we introduce user input to the system. If the startSerach() call from
startApp() is removed and instead we introduce a commandListener into the
application that runs the startSearch method, the
framework.startGroupSearch() call never returns. It still works like a charm
on our emulators, but not on the actual phone.

We've been working on theories as to why this problem arises on the phone and
not on the emulator, and our best guess at the moment is that our method call
stack is beyond the limits of the phone's capacity. Our framwork is quite
complex and quite a lot of functionality is hidden from the application.

Another theory is that the Thread handling in J2ME is causing the problems.
But we can't quite see how this can cause such an error.

If anyone has any input at all to this problem we would greatly appreciate
it.

Best regards
Michael Sars Norum

By the way, the plan is to release this framework to make it freely available
to the public...
 
L

Lothar Kimmeringer

This works fine both on Nokia 6600 and our emulators. The problem arises when
we introduce user input to the system. If the startSerach() call from
startApp() is removed and instead we introduce a commandListener into the
application that runs the startSearch method, the
framework.startGroupSearch() call never returns. It still works like a charm
on our emulators, but not on the actual phone.

I'm not sure if it was J2ME or somewhere else, but I think I read
something about these things to happen within an own thread, because
it shouldn't happen within in the thread doing the event-handling.

Again, the last weeks I was reading a lot about different
techniques, so it might be a solution for a different problem ;-)


Regards, Lothar
--
Lothar Kimmeringer E-Mail: (e-mail address removed)
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
 
D

Darryl L. Pierce

Michael said:
This works fine both on Nokia 6600 and our emulators. The problem arises when
we introduce user input to the system. If the startSerach() call from
startApp() is removed and instead we introduce a commandListener into the
application that runs the startSearch method, the
framework.startGroupSearch() call never returns. It still works like a charm
on our emulators, but not on the actual phone.

Are you wrapping the call to startSearch() in its own thread? IOW:

public void commandAction(Command cmd,Displayable dsp)
{
new Thread(new Runnable()
{
public void run()
{
startSearch();
}
}).start();
}

If you're not doing then, then please do so and try again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top