James Reilly

+ Follow
since Oct 01, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by James Reilly


Yes a servlet can easily return a custom result set to a
remote app like a MIDlet. Ideally, I think one first designs the message sequence chart and request/response protocol between the MIDlet application and servlet, based on the problem to be solved. One probably also designs the screen map of MIDle UI screens and set of screen transitions at the same time.

There are many cases where a MIDlet may only have a relatively small set of request/response pairs, and a fixed set of well-defined data in those that the MIDlet needs to handle.

16 years ago
BTW, there's an introductory example of a MIDlet accessing remote databases using an intermediate servlet proxy here: http://www.forum.nokia.com/files/nds_disclaimer/1,6673,4347,00.html

16 years ago
If you need to get familiar with MIDP or J2ME, the FAQ at the top of
this J2ME discussion board may help. If you need to get familiar with developing MIDP and Bluetooth apps., these might be of some help as starters:
- http://developers.sun.com/techtopics/mobility/midp/articles/bluetooth1/
- http://www.amazon.co.uk/exec/obidos/ASIN/1558609342
- http://benhui.net/modules.php?name=Bluetooth
- http://forum.nokia.com/main/0,6566,040,00.html?fsrParam=1-3-&fileID=5005

good luck
16 years ago
Maybe you need to include J2MEUnit (http://j2meunit.sourceforge.net/)
for any unit tests?
16 years ago
If you've not already done so, you might check out the defined java.lang types available in CLDC 1.0 and CLDC 1.1, for example from the API references for them downloadable from here: http://java.sun.com/reference/api/

This thread may also help: https://coderanch.com/t/227577/JME/Mobile/me
[ July 26, 2004: Message edited by: James Reilly ]
16 years ago
As a general rule, mobile devices often sit behind firewalls and Network Address Translators (NATs) of the mobile network operator, for reasons of security and manageability. (One can occassionally find some exceptions though.) That can make it difficult for an external IP-based host or device to learn the IP address of a mobile device (or in general of any IP device that sits behind a NAT firewall), unless the mobile device has first initiated and maintains a connection to it.

This slideset might help to give a better understanding of some possible issues that can be involved: "Multi-user MIDP Game Design" (http://www.forum.nokia.com/ndsCookieBuilder?fileParamID=3302).
16 years ago
It ought to be pretty straightfoward to write your own HTML to XHTML converter servlet, cgi bin page, etc. using something off-the-shelf like Tidy or JTidy? O'Reilly has something along those lines here: http://www.oreillynet.com/network/2000/04/28/feature/index.csp.

Off the top of my head, it doesn't sound like a great deal of work.
For an HTTP GET, it is probably relatively straightforward and perhaps
with some googling one could find lots of helper packages and APIs
for converting HTML to XHTML.

Theoretically, a MIDlet could also do a conversion to XHTML too.
But MIDlet size and memory (e.g. for large HTML pages) might be

Your mileage may vary :-).
16 years ago
For a Nokia 6600, it might help to have a look at the Forum Nokia tutorial on
signed MIDlets if you haven't done so already:

For example, about the use of self-signed certificates only in an emulator (for simple testing only) but not for signing MIDlets for use in an actual MIDP2 device. This is because a MIDlet that is signed with a self-signed certificate cannot be authenticated by a real device.

Hope this helps.
16 years ago
Some of these might help, depending on what you are trying to accomplish:

- checking the values of system properties 'microedition.profiles', 'microedition.configuration', etc.

- Using a try / catch block for 'Class.forName(String className)' and ClassNotFoundException might help an application to infer that some API (e.g. from an optional package) is available or not. This might be helpful in some specific cases (e.g. sound effects). But it ought to be used judiciously, if at all.

- Some optional package APIs may also provide some additional support. For example, the JSR-82 Bluetooth API allows one to query a device property 'bluetooth.api.version', using the JSR-82 API specific class javax.bluetooth.LocalDevice.
[ July 13, 2004: Message edited by: James Reilly ]
16 years ago
You don't provide a lot of information about what the problem is.

One approach might be to start with a simple known working MIDlet/servlet
pair that use HTTP (there's lots of those available) and testing that both of those work in whatever J2ME device/SDK and server, network configuration, etc. that you are using. So you have a known working starting point.

And then modify that MIDlet and servlet pair as appropriate: e.g. setting the Content-Type, Content-Length, URL, POST contents, etc. on both sides (MIDlet and servlet) as appropriate.
[ July 09, 2004: Message edited by: James Reilly ]
16 years ago
CLDC provides the 'Generic Connection Framework' (GCF). The GCF is a generic, extensible IO framework for resource constrained devices. The 'javax.microedition.io' classes and interfaces in CLDC provide the GCF.
MIDP also provides support on top of CLDC's GCF interfaces and classes:
like javax.microedition.io.HttpConnection.

The 'java.io' classes arose in J2SE. J2ME tries to be as compatible
as possible with J2SE (to the extent possible in resource constrained
devices). Some java.io interfaces and classes are therefore also used
by CLDC, java.io.InputStream/OutputStream, java.io.Exception, etc.

(And it's maybe worth mentioning that CDC is generally
much closer to J2SE than CLDC.)
[ July 07, 2004: Message edited by: James Reilly ]
16 years ago
If you use HTTP as the communication protocol between
your MIDlet and servlet, then you need to use a network
binding (or access point) that supports HTTP (Note: on both ends).
GPRS via an appropriate carrier/network operator is one example.

This assumes your servlet is visible on a web server someplace
on the public Internet.
[ July 06, 2004: Message edited by: James Reilly ]
16 years ago
The .zip for the sourcecode examples on Forum Nokia
(i.e. 'MIDP_Example_Applications_1.4.zip'
or whatever the latest version is) contain Ant build
files and the top-level 'midp/examples' README file
has more info. Some of the examples use the Nokia UI API.

16 years ago
I didn't see any mention of using e.g. HTTP Basic Authentication for the directory (and files) where the .jad and .jar are kept on the web server. This is normally very straightforward to configure on e.g. a per-user basis with Apache, Tomcat, etc. Depending on one's needs, that might give some minimal protection. Also the web server can be configured so that timestamped log files show who is accessing (or who attempt to access) a directory.

This ought to work with both HTML and WML browsers (at least all
such phone and PC browsers that I've ever tried). The ease of typing
in the username + password on a phone's browser might be an issue for some usernames or passwords esp. if they are long.

[ July 02, 2004: Message edited by: James Reilly ]
16 years ago
You can use method drawLine to draw three lines {x1, y1} to {x2, y2},
{x2, y2} to {x3, y3}, and {x3, y3} to {x1, y1}.
16 years ago