-1

I'm working with adding of records to MySQL in Android Studio. In my api, when I successfully insert records, it gives me this JSON result.

{"status":"success"}

How can I integrate and code this to my Android, that whenever I insert correct values will only check the status. What I know is the old way i.e. the use of HTTPClient and HTTP Post which is not available in newer versions.

Thanks!

Anil
  • 1,605
  • 1
  • 14
  • 24
AppDev
  • 21
  • 7

1 Answers1

0

You use any of the network libraries like Volley or retrofit and call the url with post or get method respectively and you will recieve the data/ status back in the json. Now convet that Json to the Hashmap and check the status and update the UI correspondingly.

Refer the following links

https://www.simplifiedcoding.net/android-volley-tutorial-to-get-json-from-server/

How can I convert JSON to a HashMap using Gson?

PranavKAndro
  • 921
  • 7
  • 9