Liam Quinn

Ranch Hand
+ Follow
since Jan 18, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Liam Quinn

The limit varies from device to device. On some devices, you're limited to 8K or 20K. Others allow hundreds or thousands of kilobytes.
18 years ago
Motorola and Sony Ericsson phones return null for microedition.platform. Sanyo, Samsung, LG, and MIDP4Palm all return "j2me".
Most phones do not set a User-Agent header with MIDP HttpConnections, so you can't rely on that either.
When I've needed to identify the device, I've used a combination of microedition.platform, the canvas size, and the number of display colours. Unfortunately, it involves some guesswork and isn't very robust, but I've found it satisfactory for my needs.
18 years ago
If XML isn't an absolute requirement, I would avoid it and instead use DataInputStream/DataOutputStream. In my experience, using DataInputStream and DataOutputStream instead of XML provides better speed and a smaller JAR.
If you really want to use XML, there's a good, small XML parser at kObjects.org.
18 years ago
Use DataInputStream and DataOutputStream with a ByteArrayInputStream/ByteArrayOutputStream, readUTF()/writeUTF() for Strings, readInt()/writeInt() for ints.
18 years ago
Rather than focusing on the JAR size, I would focus on reducing the heap memory required by your program when running. Don't create so many objects.
The J2ME Wireless Toolkit's memory profiler can be helpful for tracking down the main memory hogs. In KToolbar, go to Edit -> Preferences -> Monitoring, and check "Enable Memory Monitor". (This is in version 1.0.4.)
18 years ago
You can use UTF-8. UTF-8 is the default character encoding if you don't specify a charset parameter in your JAD's HTTP Content-Type header.
You can also use ISO-8859-1 (or anything else) if you set the charset parameter of the HTTP Content-Type header.
I'm not sure what device support is like when you stray from US-ASCII though. In theory, UTF-8 should work for all devices; ISO-8859-1 might, in theory, not be supported by a device.
18 years ago
You can use MicroEmulator to demonstrate a MIDlet in a browser.
18 years ago
Motorola iDEN phones support serial connectivity from MIDlets, but very few other phones do. Current Nokia phones don't support serial connectivity from MIDlets.
18 years ago
You need to URL-encode the name. See
http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1
On the servlet, you need to escape apostrophes and backslashes before putting the name in your SQL. Precede each apostrophe or backslash with a backslash to escape it. If you don't do this, you have a SQL injection security hole.
You may also have better luck calling os.close() before you open the input stream in your MIDlet. Otherwise, the Nokia 7650 won't send your request properly.
19 years ago
There is no Nokia 7650 emulator, but the Series 60 emulator is a reasonable approximation. (The Nokia 7650 is a Series 60 phone.)
19 years ago
The Nokia Series 60 MIDP SDK is the closest thing to a 7650 emulator.
19 years ago
You can display HTML in a MIDlet using ReqwirelessWeb:
http://www.reqwireless.com/products-web.html
19 years ago
Your code isn't doing anything to handle the HTML. If you want to render the HTML, you can use the ReqwirelessWeb library:
http://www.reqwireless.com/products-web.html
19 years ago