Forums Register Login

Dynamic menu generation

+Pie Number of slices to send: Send
Hi,
I'm just wondering that am I doing/trying to do something what currently is not possible to do by J2ME compatible devices (phones).
Brief:
1. Phone/application makes a network request of server-folders from the main server.
2. By using information of return value, the phone/application regenerates menu.
3. Depending on user selection, the phone/application makes a request of servers under selected folder.
4. By using information of return value, the phone/application regenerates once again menu based on this reguest.
5. Depending on user selection, the phone/application makes a request of supported commands of selected server under previously selected folder.
6. By using information of return value, the phone/application regenerates once again menu based on supported commands.
7. Selected command can be sent to selected server.
The data structure of this is mainly based on use of Hashtables (hashtables inside hashtable and so on). Also used phone's/application's Command-objects are stored into these hashtables that regenerating of phone/application menus are possible to do later on easily and without new network request of previously requested thing (e.g user pushes Backward-button).
First this dynamic menu (re)generation sound very good idea and it actually worked "quite" well in Nokia's emulator. Then I tested it on Sun's similar and it jamed immediatelly while requesting data on network. I got warning about using network connection inside ActionCommand (network connections should do in other thread!?!), but somehow I felt this warning indicates of something more (serious bug in J2ME implemetation?). Also Nokia's emulator started to confuse after a couple of forward - backward pushes even network connection wasn't needed anymore (data structure was created on previous requests).
I'm quite beginner in Java programing and especially J2ME knowledge is based on a week testing period. So, I'm intteresting in your professional experience of my possibility to succeed. Does the thread help, or should I gave up this way of coding/menu generation? In j2SE I could use JTree+serialization or even XML-parser, but this Micro edition starts to shit me quite much...
Your opinions are highly welcome.
br,
Jorma
+Pie Number of slices to send: Send
In short, yes, you do need to put any network operation in a separate thread. Otherwise, it blocks the main UI thread. This behavior is discussed in the MIDP specification.
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1274 times.
Similar Threads
How to refresh the display?
j2me app not working on device
Does J2ME replace WAP/WML.?
Simple Hello World crashed
separating input in a dialog
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:12:32.