I have a file in my sdcard which extension is abc.ser and the file contain JSON objects like
{"music":"abc","highqualityavailable":"true","cacheable":"true"}
{"music":"xyz","highqualityavailable":"false","cacheable":"true"}
{"music":"aaa","highqualityavailable":"true","cacheable":"true"}
{"music":"bbb","highqualityavailable":"false","cacheable":"true"}
{"music":"ccc","highqualityavailable":"true","cacheable":"true"}
the file contain JSON objects but not the proper format of JSON how can i read or parse it in my app i have already read the string in file but don,t know how to convert it to a POJO
String root = Environment.getExternalStorageDirectory().getAbsolutePath();
File file = new File(root+"/tmp/playerSongsString.ser");
if (file.exists()) {
FileInputStream stream = null;
try {
stream = new FileInputStream(file);
FileChannel fc = stream.getChannel();
MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
/* Instead of using default, pass in a decoder. */
jString = Charset.defaultCharset().decode(bb).toString();
JSONObject object = new JSONObject(jString);
Log.d("json:",jString);
} catch (IOException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
} finally {
try {
stream.close();
} catch (IOException e) {
e.printStackTrace();
}
}