Using StringTokenizer in J2ME / JavaME applications
For those who worked with J2ME application, you should by now noticed that J2ME has strip down many classes from the standard java library, and this include StringTokenizer.
Why do you need StringTokenizer ?
For starters, StringTokenizer enables you to breakup delimited text and assign it separately, a text like :
99|Max Headroom|32|124, Park May Avenue,LA
can be separated to :
id : 99 Name : Max Headroom Age : 32 Address : 124, Park May Avenue,LA
with relative ease. This delimited format is important because it is a relatively compact format to transfer data between client-server application (xmlrpc,soap are too bloated), because the simpler the format is, the faster the operating will be.
Because J2ME does not have StringTokenizer implementation, I was forced to adapt another StringTokernizer to be use in J2ME applications. For this i choose to adapt from Stephen Ostermiller java class, which can run smoothly in J2ME devices.
I've included the modified StringTokenizer class with a demo app on how to use the class in this zip file : StringTok.zip
Hope you enjoy the download, please contact me if you have any further questions.
[tags]j2me,java,javame, java class, StringTokenizer, mobile[/tags]
September 18th, 2006 at 1:04 am
[...] Besides being a GNU/Linux user (Ubuntu user specificly), my favorite past time (was) include coding mobile application in Java (JavaME), and here’s a post that I write about my modified StringTokenizer class that can be use in J2ME / JavaME application : Using StringTokenizer in J2ME application [...]
April 14th, 2007 at 12:54 am
[...] You can try this : http://mobilepit.com/09/using-stringtokenizer-in-j2me-javame-applications.htmlhttp://blog.mypapit.net/2006/09/adapting-stringtokenizer-for-j2me.html [...]
May 18th, 2007 at 3:31 pm
[...] nein, die J2ME spezifikation sieht keine stringtokenizer klasse vor. im polish gibt es sie allerdings, und auch andere stellen eigene klassen zur verf?gung… auch suchmaschinen eignen sich super f?r solche fragen! http://mobilepit.com/09/using-stringtokenizer-in-j2me-javame-applications.html_________________ ?To alcohol, the cause of, and solution to, all of life? s problems.? – H.J. Simpson [...]
November 11th, 2009 at 6:46 am
Thank you so much it work perfectly, GENIOUS WORK
April 2nd, 2010 at 4:39 am
Thanks Man. I was looking for something like this.
I’m developing a sync file app for mobiles.
April 4th, 2010 at 9:17 am
Or you could just use indexOf() and substring().
I mean, I would probably build the same class if I worked on mobile apps enough, but if you can’t build something like this on your own..
June 19th, 2010 at 4:46 am
Thank you very much, this is just what I needed, you are a good people.
September 12th, 2010 at 4:05 am
I love this site..
September 12th, 2010 at 6:22 am
Nice Post!!!
September 30th, 2010 at 6:56 am
Thanks!
October 19th, 2010 at 1:07 am
Wollte den SuMa Eintragungsdienst gerade benutzen, bis mir aufgefallen ist, dass er kostet.
April 26th, 2011 at 12:59 am
Hi,
The download link of StringTokenizer.zip file is broken. Can you please fix it?
Thanks.