I have a function which saves Android data in sqlite but I have to convert the String data to an Integer.
sqlite
String
Integer
Whenever the S
S
There is one more way to do this apart from the methods given in rest of the answers.
String blockId=jsonarray.getJSONObject(i).getString("block_id"); int block_id = blockId==null ? 0 : Integer.parseInt(blockId);