How to decode JSON values in my Android Aplication?

前端 未结 3 1520
死守一世寂寞
死守一世寂寞 2020-12-12 05:57

Hello guys I\'m trying to decode a JSON value into my Android Application, But I\'m not really sure What Am I doing wrong in my code...

This is my PHP file:

3条回答
  •  我在风中等你
    2020-12-12 06:46

    There are a couple of options for you available to achieve this.

    Personally i like to use the built in JSON parser in Android

    JSONObject jObject = new JSONObject(result);
    

    You can also use Google's json parse library https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/Gson.html

    Also see this link for details on how to actually parse JSON and get Strings that you can use in your program. How to parse JSON in Android

提交回复
热议问题