i have this Json
{'information': [{"id_module":"123456","adresse_mac":"0.0.0.1","mot_de_passe":"mdp123"}]}
and i would like to put the "adresse mac" into a string using the url but i really don't know how to do this so if someone can help me it would be awesome.I did lot of research but the tutorials i found are bad.I'am a beginner it's my first app so just be tolerant
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.penaltyDialog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll()
.penaltyLog()
.build());
JSONObject json = null;
String str = "";
HttpResponse response;
HttpClient myClient = new DefaultHttpClient();
HttpPost myConnection = new HttpPost("the url i want");
}
public void parseJson(String jsonString)
{
try
{
JSONObject json = new JSONObject(jsonString);
JSONArray userdetails = json.getJSONArray("information");
for (int i=0; i<userdetails.length(); i++)
{
JSONObject user = userdetails.getJSONObject(i);
String address = user.getString("id_module");
String name = user.getString("mot_de_passe");
String userid = user.getString("adresse_mac");
TextView url = (TextView) findViewById(R.id.url);
url.setText(userid);
}
}
catch (Exception e) {}
}