• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Parser returns only 1/3 of the entire string!

 
Ranch Hand
Posts: 69
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there!

From the title, it might seem strange, but that's the deal. I have a parser that it should return a list of polylines (Direction API). However, it is returning only one value and even that value is incomplete.

Parser.Class



Main.Class



the value returned is "{kd_IljoJ"  which is not even the full string. It is supposed to be "{kd_IljoJd@L|Ab@pA\\r@P^L`AXxA`@|@VxBn@dAZNDd@NNDd@PXLJDRLJDNJHFHFRPJJdAbATPRJTJPDVBF@P@L@"

As you can see it returns a small bit only, not to mention that I actually need a list of them and not just one. Am I missing something?
 
Bartender
Posts: 15737
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Returned from where? And what is the return value of downloadUrl.readUrl(distUrl)?
 
Marin Capranov
Ranch Hand
Posts: 69
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
distUrl ->



and returned from an JSON Object:

Ex:

 
Stephan van Hulst
Bartender
Posts: 15737
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So that JSON you posted is the result of calling readUrl()? What you posted is not a complete JSON response.
 
Marin Capranov
Ranch Hand
Posts: 69
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know but the problem is that the JSON is too big and I can't post it. Basically what I posted is one of the 20 waypoints that are in the JSON file.
 
Stephan van Hulst
Bartender
Posts: 15737
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you show us the exact line that is logged from your call to Log.i("poly", "getPath: " + polyLine) ?
 
Marin Capranov
Ranch Hand
Posts: 69
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
02-17 15:39:59.251 12128-12806/com.example.authorisationfirebase I/poly: getPath: {kd_IljoJ
 
Stephan van Hulst
Bartender
Posts: 15737
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, you need to create an SSCCE. It's the smallest application you can write that demonstrates the problem. Remove everything like downloading the JSON, just assign the entire JSON data to a constant using a string literal, and then try to get the offending polyline point from the JSONObject. You can do all of this in a single class file.

Post the SSCCE here in it's entirety. The goal is to give us the minimal amount of code that we can compile and run ourselves.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic