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: , , , , ,

Bookmark this post :
  • co.mments
  • del.icio.us
  • digg
  • YahooMyWeb
  • description
  • StumbleUpon
  • Technorati

 

Recommended Reading

3 smashing comments for this post.

  1. Adapting StringTokenizer for J2ME : mypapit gnu/linux blog Said:

    [...] 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 [...]

  2. StringTokenizer unresolved Said:

    [...] 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 [...]

  3. J2MeForum :: Thema anzeigen - StringTokenizer Said:

    [...] 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 [...]

Leave a Comment

Subscribe by Email


Powered by FeedBlitz

 


Your Ad Here

Bad Behavior has blocked 0 access attempts in the last 7 days.