با سلام خدمت دوستان
در مورد json کلیدهای 2651 و 309 رو خوندم ولی ی مشکل کوچیک دارم و امیدوارم دوستان ی کمکی برسونن
فایل json من بشکل زیر است
و کد جاوای من:
لطفا بگید مشکل کجاست؟
در مورد json کلیدهای 2651 و 309 رو خوندم ولی ی مشکل کوچیک دارم و امیدوارم دوستان ی کمکی برسونن
فایل json من بشکل زیر است
کد پیاچپی:
{
"Book": [
{
"Info": [
{
"Name": "A Bundle of Flowers",
"Author": "Ayatollah Sayyid Kamal Faqih Imani",
"Translator": "Sayyid Abbas Sadr-'ameli",
"Publisher": "Amir al-Mu'mineen Ali (a.s.) Library"
}
]
},
{
"Abstract": "In the name of Allah,..."
},
{
"Content": [
{
"Tilte": "Introduction",
"Text": "Text Intoduction"
},
{
"Tilte": "Preface",
"Text": "Text Prefrence"
},
{
"Tilte": "The Opening Tradition",
"Text": "Text The Opening Tradition"
},
{
"Tilte": "A Benevolent Expectation",
"Text": "Text A Benevolent Expectation"
}
]
}
]
}
و کد جاوای من:
کد پیاچپی:
BookArray = json.getJSONArray(json_book);
for (int i = 0; i < BookArray.length(); i++) {
JSONObject b = BookArray.getJSONObject(i);
ContentArray = b.getJSONArray(json_content);
for (int j = 0; j < ContentArray.length(); j++) {
JSONObject b1 = ContentArray.getJSONObject(j);
json_string_content_title_all = new String[ContentArray.length()];
json_string_content_text_all = new String[ContentArray.length()];
json_string_content_title_all[j] = new String(b1
.getString(json_node_content_title).getBytes(
"ISO-8859-1"));
json_string_content_text_all[j] = new String(b1
.getString(json_node_content_text).getBytes(
"ISO-8859-1"));
}
}
لطفا بگید مشکل کجاست؟