This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Parallel WiFi? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Parallel WiFi? " Watch "Parallel WiFi? " New topic
Author

Parallel WiFi?

lesley evensen
Greenhorn

Joined: Nov 02, 2001
Posts: 14
Has anyone tried running parallel-ized apps on Palm or other PDA's for instance? The J2ME last time I looked didn't contain packages that would necessarily support that.


<A HREF="mailto:zorgalina@minspring.com" rel="nofollow">zorgalina@minspring.com</A>
Burk Hufnagel
Ranch Hand

Joined: Oct 01, 2001
Posts: 814
    
    3
If by parallel-ized you mean multiple threads in the same app, then I believe that the answer is "Yes, they're supported", but if you mean multiple apps running at the same time on a Palm then I think the answer is "No, Palm doesn't support that."
Although I think in the MIDP 2.0 spec there's something about an app requesting it be brought out of the paused phase of its lifecycle - which would allow something like multiple apps running in parallel.


SCJP, SCJD, SCEA 5 "Any sufficiently analyzed magic is indistinguishable from science!" Agatha Heterodyne (Girl Genius)
Jonathan Knudsen
Author
Ranch Hand

Joined: Apr 22, 2003
Posts: 55
I think nobody is really expecting to run multiple MIDlets on the same device, but as mentioned previously, multiple threads are certainly supported (and crucial).
MIDP 2.0 does include an API for a MIDlet to request being woken up at a specific time.
Burk Hufnagel
Ranch Hand

Joined: Oct 01, 2001
Posts: 814
    
    3
Originally posted by Jonathan Knudsen:
I think nobody is really expecting to run multiple MIDlets on the same device, but as mentioned previously, multiple threads are certainly supported (and crucial).

I assume that by multiple Midlets you mean two or more that are working in concert. Otherwise we're asking people to install a JVM (and use up valuable memory) for just on app - that makes it kind of expensive.
Jonathan Knudsen
Author
Ranch Hand

Joined: Apr 22, 2003
Posts: 55
Sorry, I should have been more specific. I don't think anyone's really expecting to run more than one MIDlet concurrently. Multiple MIDlets and MIDelt suites may be installed on a device.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Jonathan Knudsen:
Sorry, I should have been more specific. I don't think anyone's really expecting to run more than one MIDlet concurrently. Multiple MIDlets and MIDelt suites may be installed on a device.

Ahem. I do.
There are some things I really dislike about MIDP 1.0. For example I'd like to write applications that could be configured to start in the background upon power-on or some other system event, or so that the user can launch an application which goes into the background to do its thing and lets the user launch other applications.
Is this possible in MIDP 2.0? How about in 3.0?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Burk Hufnagel
Ranch Hand

Joined: Oct 01, 2001
Posts: 814
    
    3
Originally posted by Lasse Koskela:
How about in 3.0?

3.0!? I didn't know there was a 3.0... Heck, the ink for 2.0 isn't even dry yet.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Burk Hufnagel:
3.0!? I didn't know there was a 3.0... Heck, the ink for 2.0 isn't even dry yet.

Yeah... But for some reason I'd be interested to hear whether this kind of features are being planned at all. Having background programs running demands certain capabilities from the platform and I'm not sure whether this will be required from the plain vanilla MIDP or delegated to the "more advanced" profiles such as the PDA Profile.
Burk Hufnagel
Ranch Hand

Joined: Oct 01, 2001
Posts: 814
    
    3
Unless they bump up the minimum requirements, I doubt that the CLDC spec will include bacground execution. There's just not enough oomph in the hardware to support it properly.
Jonathan Knudsen
Author
Ranch Hand

Joined: Apr 22, 2003
Posts: 55
MIDP's application model doesn't really specify whether you can have multiple MIDlets running simultaneously. It's up to the implementation. I believe my Nokia 3650 does allow MIDlets to run simultaneously, but I'm sure my Motorola i85s does not. At any rate, the specification doesn't guarantee that MIDlets can run simultaneously, so you can't count on it.
That being said, you may be able to achieve the functionality you're seeking regardless. MIDP 2.0 offers two features that may do what you want. The first feature is the ability to request that a MIDlet be run at a certain time. This is great for ticklers or appointment book applications.
The second feature is the push registry, which allows MIDlets to register interest in incoming network connections. When the phone receives such a connection (incoming SMS message, maybe) it launches your MIDlet and you get to handle the incoming connection.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Jonathan Knudsen:
MIDP 2.0 offers two features that may do what you want. The first feature is the ability to request that a MIDlet be run at a certain time. This is great for ticklers or appointment book applications.
The second feature is the push registry, which allows MIDlets to register interest in incoming network connections. When the phone receives such a connection (incoming SMS message, maybe) it launches your MIDlet and you get to handle the incoming connection.

These features sound promising. Do you know whether the MIDlet can setup its own scheduling without user intervention? This would practically mean that I could write a MIDlet that would launch itself, say, 10 seconds after it finished the last time. I think it should be close enough to a real background process for many purposes.
Jonathan Knudsen
Author
Ranch Hand

Joined: Apr 22, 2003
Posts: 55
Hi Lasse,
I think you should probably try a different approach. A MIDlet launching itself every 10 seconds would be very disruptive to the user. See if you can offload this background processing to a server or try some alternate approach. I think you're still thinking in a desktop way and you need to scale down a little for MIDP.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Jonathan Knudsen:
A MIDlet launching itself every 10 seconds would be very disruptive to the user.

Disruptive because of "launching" or disruptive because of "10 seconds"? I'm probably overestimating the CPU power of handhelds in general, but if there's no GUI to render and only does something like reads a timestamp from RMS then shouldn't the background process be relatively light-weight?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parallel WiFi?
 
Similar Threads
NullPointerException on SessionFactory sessionFactory = new Configuration().configure().buildSession
scp multiple files concurrently
Sending multiple request on a Single Click
Tomcat 5 on Dedicated sever
Catching change of Boolean