Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 18    Views: 122

FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
05/30/14 09:38 AM (10 years ago)

json tool help

hi guys, i have a live app, that im updating and its come back with problem reading some data on launch, so im checking the json with the json toll, but it keeps freezing on both mac and pc when checking the code, so i cant read the errors, the app is quite large 2010 screens and rising, is there a better way of checking large config files cheers
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
05/30/14 09:55 AM (10 years ago)
i have found another json tool that reads the config file and it coming back with this error The JSON input is NOT valid according to RFC 4627 (JSON specification). Unexpected duplicate key:itemId at position 1929. where is position 1929, ive looked in xcode and theres no error at that line
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
05/30/14 10:21 AM (10 years ago)
and this error { "valid": false, "critical": "Invalid JSON - SyntaxError: JSON.parse: bad control character in string literal at line 8552 column 127 of the JSON data" }
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/30/14 01:43 PM (10 years ago)
Send me a copy of your JSON data and I'll help. Cheers! -- Smug
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
05/31/14 12:16 AM (10 years ago)
removed
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
05/31/14 12:28 AM (10 years ago)
removed
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
05/31/14 12:37 AM (10 years ago)
removed
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/31/14 12:38 AM (10 years ago)
Got it. Thanks! Gimme a minute and I'll let you know what I find... Cheers! -- Smug Edit: and take it off line... there's some information in there you'll probably consider 'private'.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
05/31/14 01:09 AM (10 years ago)
thanks smug, ive removed the above code, normally i would just paste the json in the checker, and would see the problem, but for some reason the checker just locks on both pc and mac when i paste the json
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/31/14 01:12 AM (10 years ago)
Yeah, I can see that, lol! It's buckling under the pressure; that's a LOT of JSON, lol! I'll tell you what I think though... Because there 'was' so much JSON, I removed your entire 'screens' portion, just to run the 'base' through to see what happened, and I got the same error. It turned out to be a missing '}' at the end of the JSON... So I'm running the entire config through the validator again, but as you've seen, it takes a while. In the interim, add a closing bracket to the end of your config.txt file and see if it works. In a second I'm going to add some more comments, but that's the information you need to know 'now'. Cheers! -- Smug So... I'm guessing it takes a while to load your app... I'm not meaning to be cruel, but thats a *lot* of json. And every time the app loads, it has to parse through all that. And every time there is an update, it has to download all that, and parse through all that. This may be something for you to think about for your next app, or an app update, or whatever... but the method you want to read up on is 'External Child Item Files'. http://www.buzztouch.com/docs/v1.5/childItems.php It's not entirely intuitive, however... I was hoping to be writing a tutorial on it, coupled with 'loadScreenObject' (another concept you may be interested in) soon, but you ought to do some research on it now. The bottom line is, instead of using childItems in the control panel, you're creating them 'outside' of the control panel, either as an export from a php/mysql database, or converterd from a csv file... then use your plugins screen 'dataURL' (or include it locally in the app bundle) to point to that json text file with your childItems on it. Menu items, map locations, whatever. This really speeds up the app, because it has far less data to wade through on startup, and any subsequent methods. It'll also be less of a burden on the memory, speeding things up in that way as well... Also, the control panel has a finite number of screens it can display (in the control panel) making large configurations a bit of a challenge, eventually... Creating external childItem files from your existing config file isn't a difficult task; it'll just take time once you understand which pieces you're 'slicing' away to where. Anyway, give it some thought. It'll be a major increase in app efficiency.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
05/31/14 01:31 AM (10 years ago)
do you mean add the closing bracket in xcode or here in buzz, as to this app, with the stalling, after it was finished i was going to take url address out of the code, to stop it looking for changes, as i then only need to update the app each month, so i can send update through itune, will look at the above now, as i havnt got my head around database stuff yet, thanks smug
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
05/31/14 01:31 AM (10 years ago)
do you mean add the closing bracket in xcode or here in buzz, as to this app, with the stalling, after it was finished i was going to take url address out of the code, to stop it looking for changes, as i then only need to update the app each month, so i can send update through itune, will look at the above now, as i havnt got my head around database stuff yet, thanks smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/31/14 01:37 AM (10 years ago)
And one other thing... I nabbed this off the app store: https://itunes.apple.com/us/app/json-validator/id457563999?mt=12 and it made short work of your file. Nice. It pointed at illegal characters on this line: {"itemId":"4051A8D048668AEEE2D1ECE", "itemType":"BT_screen_map", "itemNickname":"Grimsby-Auditorium", "navBarTitleText":" Grimsby-Auditorium", "singleLocationDefaultZoom":"15", "defaultMapType":"standard", "childItems":[]} Notice the spaces between "navBarTitleText":" and Grimsby-Auditorium", - remove that... You may not need that closing bracket after all... Grab a copy of that JSON validator... it doesn't make it pretty (not a formatter) but it did a bang up job of looking through your file, and it's free. I like free. Cheers! -- Smug
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
05/31/14 01:40 AM (10 years ago)
i dont get how you put things externaly, will i have to set up an external database, im on a deadline with the above app,and still have to input about half of the uk, so having to start listing all the theatres again and working out external stuff, will probably lose me the contract, wish i,d known it would slow down when i started, i thought hosting all the images externally would keep the app quick
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/31/14 01:41 AM (10 years ago)
First and foremost, get the job done. After that you can worry about the other stuff... And it doesn't mean you can't release an update later... if the current app response is satisfactory, then don't worry about it... yet. But it is something you'll want to look into after deadlines are over and everyone is popping champagne... :) Cheers! -- Smug If you have the lists in an external file as a source, I modified a script to convert csv files into childItem files... but it doesn't create screens or anything too fancy... https://dl.dropboxusercontent.com/u/115208762/sjcon.zip Niraj found that you can change the 'php' extension to 'html' and you can use it locally.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
05/31/14 01:48 AM (10 years ago)
that fixed it smug, just needed to know where the problem was, and then i could fix, will download that json tool, which will be great for fault finding, so if i finish the app then stop it from checking the url, will that speed it up
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
05/31/14 07:37 AM (10 years ago)
Smug -- My Super Bowl app had 30,000+ lines of JSON. There are only 48 games thus far! I broke out each MVP screen into its own Cubbyholes file. That cut down the main JSON file to a tad over 3,000 lines of JSON. The next major feature of BuzzTouch should be the creation of individual JSON files for each screen. At least for the Menu type of screens. @Funky -- I recommend making each Menu screen to be a different JSON file. That will speed up the loading times and make it easier to update just that one screen. Eventually, you want it all in a database. -- Niraj
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
05/31/14 09:46 AM (10 years ago)
how do you mean niraj, i thought i was doing that, and thats why the app loads slow, because theres to many json files
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
05/31/14 06:00 PM (10 years ago)
I don't know your project structure nor have I reverse-engineered the app you have on the App Store. I would have to know your project details to make specific comments. Perhaps Smug might pipe up since he has seen your JSON file. -- Niraj
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.