9

I need a basic JSON parser that works with J2ME / CLDC 1.1.

A Google search returns tons of answers on this (some even on stackoverflow), but it appears that all point to libraries and solutions that are no longer available (for example, lots point to an implementation that is supposed to be on the json.org site, but at least I can't find anything that isn't J2SE only there).

My best hope so far is the source linked here: https://meapplicationdevelopers.dev.java.net/mobileajax.html, but from that one I can't even find a straight forward way to download the code.

Given the mature state of Java in all other aspects, surely there must be somewhere I can get a pre-compiled JAR to use for parsing JSON from J2ME?

dolmen
  • 8,126
  • 5
  • 40
  • 42
Liedman
  • 10,099
  • 4
  • 34
  • 36
  • I found where the code is now: http://java.net/projects/meapplicationdevelopers/sources/svn/show. Seems they migrated the site, left most of the old site there, but broken, and have some broken links on the new site that refer to the old one. New site does have source though. – Travis Oct 01 '11 at 00:44

2 Answers2

14

After getting the accepted answer from ZZ Coder, I downloaded the linked code and built a JAR from it.

So in case you need a compiled JSON serializer/deserializer for J2ME/CLDC, you can find the source code here: https://bitbucket.org/liedman/json-me

Liedman
  • 10,099
  • 4
  • 34
  • 36
  • do you still have the JAR ?? I built it from the code, but I must be doing something wrong because I get some errors and warnings when I add the jar to my project – eddy May 24 '14 at 01:54
  • please share the jar if you still have it. – eddy May 24 '14 at 12:49
  • The blog link for downloading the JAR is no longer functional. – Redwood Sep 09 '14 at 18:06
  • Can you provide a quick tutorial for this? Maybe in a Q&A style with an expanded answer here? Like which method to call on an object? – Clausen Jun 23 '16 at 12:36
7

There is an org.json parser for J2ME but I can't remember the original link. You can get the source code here,

http://grt192.googlecode.com/svn/trunk/CannonBot/src/org/json/me/

ZZ Coder
  • 74,484
  • 29
  • 137
  • 169
  • Thanks, but is it really J2ME compatible? I see no mention of J2ME, and using it in my project results in java.util.HashMap being referenced, which isn't in CLDC as far as I know. Looking closer at the code, it seems to rely on J2SE's collection API quite a lot. Am I missing something? – Liedman Jun 05 '10 at 20:58
  • Not familiar with CLDC. If it has Hashtable like MIDP, there is J2ME version of this. I can't find the original site but you can get code here http://grt192.googlecode.com/svn/trunk/CannonBot/src/org/json/me/ and hope it will compile on CLDC. – ZZ Coder Jun 05 '10 at 22:23
  • 2
    That link was much more what I was hoping for. Even though it isn't compiled, it was easy enough to get the files and build myself. Would you consider posting that link as your answer (or a new answer, if you prefer), I would be happy to upvote/accept it. – Liedman Jun 07 '10 at 20:01
  • @ZZCoder do you still have the JAR ?? I built it from the code, but I must be doing something wrong because I get some errors and warnings when I add the jar to my project – eddy May 24 '14 at 01:54
  • This resource is not longer available. – kike Aug 12 '16 at 14:47