Json parsing error:org.json.JSONException

Rapor et
Soru

Bu soru rapor edilmelidir hissediyorum neden kısaca açıklayınız.

Rapor et
İptal

Merhabalar veriyi  json olarak çekebiliyorum fakat  alttaki koda geldiğimde başlıktaki hatayı alıyorum aldığım jsonda altta bulunmakta hatanın nedenini anlayamadım bitürlü yardımcı olursanız sevinirim.

JSONObject jsonObj = new JSONObject(dosya);
[{"Adverts":[{"game":{"Adverts":[],"GameID":1,"Name":"fdfd"},"AdvertID":1,"Title":"dws","Description":"dwcsf","SendTime":"2019-06-18T09:38:55.657","LeftTime":"2019-06-18T09:38:55.657","UserID":1,"GameID":1}],"Messages":[{"chat":{"Messages":[],"ChatID":1},"MessageID":1,"Content":0,"SendTime":"2019-06-18T09:38:55.723","ChatID":1,"UserID":1}],"UserID":1,"Nick":"ASCA","Name":"melih","PhotoPath":null,"Password":"0DPiKuNIrrVmD8IUCuw1hQxNqZc=","Email":"dssdv","Description":"abc","Rank":0.00,"HashGuid":"00000000-0000-0000-0000-000000000000"},{"Adverts":[{"game":{"Adverts":[],"GameID":2,"Name":"fdfd"},"AdvertID":16,"Title":"dws","Description":"dwcsf","SendTime":"2019-06-18T09:38:55.657","LeftTime":"2019-06-18T09:38:55.657","UserID":2,"GameID":2}],"Messages":[{"chat":{"Messages":[],"ChatID":2},"MessageID":2,"Content":0,"SendTime":"2019-06-18T09:38:55.723","ChatID":2,"UserID":2}],"UserID":2,"Nick":"ASCA","Name":"melih","PhotoPath":null,"Password":"fOC2y9+Hn8pcP6xxQaCXGPzgOL0=","Email":"melospr","Description":"abc","Rank":0.00,"HashGuid":"00000000-0000-0000-0000-000000000000"},{"Adverts":[{"game":{"Adverts":[],"GameID":3,"Name":"fdfd"},"AdvertID":21,"Title":"dws","Description":"dwcsf","SendTime":"2019-06-18T09:38:55.657","LeftTime":"2019-06-18T09:38:55.657","UserID":3,"GameID":3}],"Messages":[{"chat":{"Messages":[],"ChatID":3},"MessageID":3,"Content":0,"SendTime":"2019-06-18T09:38:55.723","ChatID":3,"UserID":3}],"UserID":3,"Nick":"ASCA","Name":"melih","PhotoPath":null,"Password":"fOC2y9+Hn8pcP6xxQaCXGPzgOL0=","Email":"melosprrrr","Description":"abc","Rank":0.00,"HashGuid":"00000000-0000-0000-0000-000000000000"},{"Adverts":[{"game":{"Adverts":[],"GameID":4,"Name":"fdfd"},"AdvertID":24,"Title":"dws","Description":"dwcsf","SendTime":"2019-06-18T09:38:55.657","LeftTime":"2019-06-18T09:38:55.657","UserID":4,"GameID":4}],"Messages":[{"chat":{"Messages":[],"ChatID":4},"MessageID":4,"Content":0,"SendTime":"2019-06-18T09:38:55.723","ChatID":4,"UserID":4}],"UserID":4,"Nick":"ASCA","Name":"melih","PhotoPath":null,"Password":"fOC2y9+Hn8pcP6xxQaCXGPzgOL0=","Email":"melospracv","Description":"abc","Rank":0.00,"HashGuid":"00000000-0000-0000-0000-000000000000"},{"Adverts":[{"game":{"Adverts":[],"GameID":5,"Name":"fdfd"},"AdvertID":25,"Title":"dws","Description":"dwcsf","SendTime":"2019-06-18T09:38:55.657",
"LeftTime":"2019-06-18T09:38:55.657","UserID":5,"GameID":5}],"Messages":[{"chat":{"Messages":[],"ChatID":5},"MessageID":5,"Content":0,"SendTime":"2019-06-18T09:38:55.723","ChatID":5,"UserID":5}],"UserID":5,"Nick":"ASCA","Name":"melih","PhotoPath":null,"Password":"fOC2y9+Hn8pcP6xxQaCXGPzgOL0=","Email":"melosprcxzs","Description":"abc","Rank":0.00,"HashGuid":"00000000-0000-0000-0000-000000000000"},{"Adverts":[{"game":{"Adverts":[],"GameID":6,"Name":"fdfd"},"AdvertID":26,"Title":"dws","Description":"dwcsf","SendTime":"2019-06-18T09:38:55.657","LeftTime":"2019-06-18T09:38:55.657","UserID":6,"GameID":6}],"Messages":[{"chat":{"Messages":[],"ChatID":6},"MessageID":6,"Content":0,"SendTime":"2019-06-18T09:38:55.723","ChatID":6,"UserID":6}],"UserID":6,"Nick":"ASCA","Name":"melih","PhotoPath":null,"Password":"fOC2y9+Hn8pcP6xxQaCXGPzgOL0=","Email":"melosprcxzsijkl","Description":"abc","Rank":0.00,"HashGuid":"00000000-0000-0000-0000-000000000000"},{"Adverts":[{"game":{"Adverts":[],"GameID":7,"Name":"fdfd"},"AdvertID":27,"Title":"dws","Description":"dwcsf","SendTime":"2019-06-18T09:38:55.657","LeftTime":"2019-06-18T09:38:55.657","UserID":7,"GameID":7}],"Messages":[{"chat":{"Messages":[],"ChatID":7},"MessageID":7,"Content":0,"SendTime":"2019-06-18T09:38:55.723","ChatID":7,"UserID":7}],"UserID":7,"Nick":"ASCA","Name":"melih","PhotoPath":null,"Password":"fOC2y9+Hn8pcP6xxQaCXGPzgOL0=","Email":"melosprcxzsijkllk","Description":"abc","Rank":0.00,"HashGuid":"00000000-0000-0000-0000-000000000000"},{"Adverts":[{"game":{"Adverts":[],"GameID":8,"Name":"fdfd"},"AdvertID":28,"Title":"dws","Description":"dwcsf","SendTime":"2019-06-18T09:38:55.657","LeftTime":"2019-06-18T09:38:55.657","UserID":8,"GameID":8}],"Messages":[{"chat":{"Messages":[],"ChatID":8},"MessageID":8,"Content":0,"SendTime":"2019-06-18T09:38:55.723","ChatID":8,"UserID":8}],"UserID":8,"Nick":"ASCA","Name":"melih","PhotoPath":null,"Password":"fOC2y9+Hn8pcP6xxQaCXGPzgOL0=","Email":"melosprcxzsijkllkfdvdf","Description":"abc","Rank":0.00,"HashGuid":"00000000-0000-0000-0000-000000000000"}]
Cevaplandı 1
Android 3 ay 1 Cevap 157 görüntüleme Intern 0

Yazar HakkındaIntern

Cevap ( 1 )

  1. Avatar

    Bu cevap rapor edilmelidir hissediyorum neden kısaca açıklayınız.

    Rapor et
    İptal

    Hatanın tam sebebi görünmüyor. Json dosyanız köşeli parantez ile başlıyor bu da array olduğunu gösterir. JSONArray olarak çekip daha sonra döngüyle JSONObject olarak almayı deneyin. Başka bir hata yoksa muhtemelen çalışacaktır.

    En iyi cevap

Cevap bırak

Gözat

KOD PAYLAŞIRKEN DİKKAT!!!!

HTML kod paylaşmak için

<pre class="html">HTML KOD</pre>
XML kod paylaşmak için
<pre class="xml">XML KOD</pre>
Diğer dillerde(php,java,android,javasvript,c# vs..) kod paylaşmak için
<pre>KOD</pre>
tagları arasında paylaşmayı unutmayın.