Android Question JSON library unterminated string error

Devv

Active Member
Licensed User
Longtime User
i got this strange error
main_loaddata (java line: 713)
org.json.JSONException: Unterminated string at character 24576 of {"rss":{"@attributes":{"version":"2.0"},"channel":{"title":"\u0623\u0631\u062f\u0631\u0648\u064a\u062f","link":"https:\/\/ardroid.com","description":"\u0627\u0646\u062f\u0631\u0648\u064a\u062f \u0627\u0644\u0639\u0631\u0628","item":[{"title":"[\u0644\u0644\u0641\u0626\u0629 \u0627\u0644\u0645\u062a\u0648\u0633\u0637\u0629]: \u0646\u0648\u0643\u064a\u0627 \u062a\u0643\u0634\u0641 \u0639\u0646 \u0647\u0627\u062a\u0641 Nokia 7 \u0628\u0645\u0648\u0627\u0635\u0641\u0627\u062a\u064d \u0645\u062a\u0642\u062f\u0645\u0629 \u0645\u0639 \u0633\u0639\u0631\u064d \u0645\u0646\u0627\u0641\u0633","link":"https:\/\/ardroid.com\/%d9%84%d9%84%d9%81%d8%a6%d8%a9-%d8%a7%d9%84%d9%85%d8%aa%d9%88%d8%b3%d8%b7%d8%a9-%d9%86%d9%88%d9%83%d9%8a%d8%a7-%d8%aa%d9%83%d8%b4%d9%81-%d8%b9%d9%86-%d9%87%d8%a7%d8%aa%d9%81-nokia-7-%d8%a8%d9%85\/","guid":"https:\/\/ardroid.com\/?p=77041","description":"<p>\u0641\u064a \u0627\u0644\u0648\u0642\u062a \u0627\u0644\u0630\u064a \u0646\u0646\u062a\u0638\u0631 \u0641\u064a\u0647 \u062c\u0645\u064a\u0639\u064b\u0627 \u0642\u064a\u0627\u0645 \u0646\u0648\u0643\u064a\u0627 \u0628\u0627\u0644\u0643\u0634\u0641 \u0639\u0646 <a href=\"https:\/\/ardroid.com\/tag\/nokia-9\/\"><span>\u0647\u0627\u062a\u0641\u0647\u0627 \u0627\u0644\u0631\u0627\u0626\u062f Nokia 9<\/span><\/a>\u060c \u0642\u0631\u0631\u062a \u0627\u0644\u0634\u0631\u0643\u0629 \u0627\u0644\u0641\u0646\u0644\u0646\u062f\u064a\u0629 \u0623\u0646 \u062a\u0641\u0627\u062c\u0626 \u0627\u0644\u062c\u0645\u064a\u0639 \u0648\u062a\u0643\u0634\u0641 \u0639\u0646 \u0647\u0627\u062a\u0641\u064d \u062c\u062f\u064a\u062f \u064a\u0646\u062a\u0645\u064a \u0644\u0623\u0639\u0644\u0649 \u0627\u0644\u0641\u0626\u0629 \u0627\u0644\u0645\u062a\u0648\u0633\u0637\u0629 \u0648\u0647\u0648 Nokia 7.<\/p>\n<p><img class=\"alignnone size-large wp-image-77042\" src=\"https:\/\/ardroid.com\/wp-content\/uploads\/2017\/10\/Nokia-7-1-768x533-600x416.jpg?x99461\" alt width=\"600\" height=\"416\" srcset=\"https:\/\/ardroid.com\/wp-content\/uploads\/2017\/10\/Nokia-7-1-768x533-600x416.jpg 600w, https:\/\/ardroid.com\/wp-content\/uploads\/2017\/10\/Nokia-7-1-768x533-300x208.jpg 300w, https:\/\/ardroid.com\/wp-content\/uploads\/2017\/10\/Nokia-7-1-768x533.jpg 768w\" sizes=\"(max-width: 600px) 100vw, 600px\"><\/p>\n<p>\u064a\u0645\u062b\u0651\u0644 \u0627\u0644\u0647\u0627\u062a\u0641 \u062e\u064a\u0627\u0631\u064b\u0627 \u0645\u062a\u0648\u0633\u0637\u064b\u0627 \u0644\u0645\u0646 \u064a\u0631\u064a\u062f \u0623\u0646 \u064a\u062d\u0635\u0644 \u0639\u0644\u0649 \u0645\u0648\u0627\u0635\u0641\u0627\u062a\u064d \u0642\u0648\u064a\u0629 \u0648\u0645\u062a\u0642\u062f\u0645\u0629 \u0628\u062f\u0648\u0646 \u0623\u0646 \u064a\u0636\u0637\u0631 \u0644\u062f\u0641\u0639 \u062b\u0645\u0646\u064d \u0645\u0631\u062a\u0641\u0639\u060c \u0648\u0628\u062d\u0627\u0644\u0629 \u0647\u0648\u0627\u062a\u0641 \u0646\u0648\u0643\u064a\u0627\u060c \u0641\u0647\u0648 \u064a\u0642\u0639 \u0645\u0627 \u0628\u064a\u0646 <a href=\"https:\/\/ardroid.com\/tag\/nokia-6\/\"><span>Nokia 6<\/span><\/a> \u0648 Nokia 8 \u0628\u0627\u0644\u0636\u0628\u0637\u060c \u0623\u064a \u0623\u0646\u0647 \u064a\u0645\u062a\u0644\u0643 \u0639\u062a\u0627\u062f\u064b\u0627 \u0648\u062e\u0635\u0627\u0626\u0635 \u0623\u0642\u0648\u0649 \u0628\u0643\u062b\u064a\u0631 \u0645\u0646 Nokia 6\u060c \u0648\u0644\u0643\u0646 \u062a\u0646\u0642\u0635\u0647 \u0628\u0639\u0636 \u0627\u0644\u0645\u064a\u0651\u0632\u0627\u062a \u0643\u064a \u0646\u0642\u0648\u0644 \u0639\u0646\u0647 \u201c\u0631\u0627\u0626\u062f\u201d \u0643\u0645\u0627 \u0647\u0648 \u0627\u0644\u062d\u0627\u0644 Nokia 8.<\/p>\n\n<p><img class=\"alignnone size-large wp-image-77047\" src=\"https:\/\/ardroid.com\/wp-content\/uploads\/2017\/10\/Nokia-7-768x724-600x566.jpg?x99461\" alt width=\"600\" height=\"566\" srcset=\"https:\/\/ardroid.com\/wp-content\/uploads\/2017\/10\/Nokia-7-768x724-600x566.jpg 600w, https:\/\/ardroid.com\/wp-content\/uploads\/2017\/10\/Nokia-7-768x724-300x283.jpg 300w, ht

i dont understand is this a bug i JSON library, because i got it without me changing any thing with my code
 

Devv

Active Member
Licensed User
Longtime User
Please edit the thread title and remove the exclamation mark. No need to "shout" at other members who like to help you.
i did not meant to shout this is an Exclamation mark not a shouting mark :D
any way how can i edit the title, i couldn't find that option ?

EDIT: Never mind found it, and edited it
 
Last edited:
Upvote 0

Devv

Active Member
Licensed User
Longtime User
You're showing us just some incomplete data. Maps start with a { and end with a }. As you see there's no } so the data is wrong. The message is correct.

thanks for replay
here is the complete one (it is soo big so i placed it in zip file)
please find it in this postattachments
 

Attachments

  • JSON.zip
    14.5 KB · Views: 273
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
B4X:
Dim parser As JSONParser
parser.Initialize(<text>)
Dim root As Map = parser.NextObject
Dim rss As Map = root.Get("rss")
Dim channel As Map = rss.Get("channel")
Dim item As List = channel.Get("item")
For Each colitem As Map In item
Dim twitter_description As String = colitem.Get("twitter_description")
Dim dc_identifier As String = colitem.Get("dc_identifier")
Dim twitter_card As String = colitem.Get("twitter_card")
Dim og_title As String = colitem.Get("og_title")
Dim link As String = colitem.Get("link")
Dim dc_format As String = colitem.Get("dc_format")
Dim description As String = colitem.Get("description")
Dim dc_creator As String = colitem.Get("dc_creator")
Dim og_type As String = colitem.Get("og_type")
Dim og_url As String = colitem.Get("og_url")
Dim title As String = colitem.Get("title")
Dim dc_language As String = colitem.Get("dc_language")
Dim pubDate As String = colitem.Get("pubDate")
Dim og_image As String = colitem.Get("og_image")
Dim twitter_image As String = colitem.Get("twitter_image")
Dim twitter_creator As String = colitem.Get("twitter_creator")
Dim twitter_site As String = colitem.Get("twitter_site")
Dim og_description As String = colitem.Get("og_description")
Dim guid As String = colitem.Get("guid")
Dim twitter_title As String = colitem.Get("twitter_title")
Dim category As List = colitem.Get("category")
For Each colcategory As String In category
Next
Next
Dim link As String = channel.Get("link")
Dim description As String = channel.Get("description")
Dim title As String = channel.Get("title")
Dim @attributes As Map = rss.Get("@attributes")
Dim version As String = @attributes.Get("version")
 
Upvote 0
Top