0

Pictures of the link in the user name and password to login. Because the Json need to read the data. It is with Android, how do I do that ?

@Override protected String doInBackground(String... urls) {
return GET(urls[0]);
}
@Override protected void onPostExecute(String result) {
if(result == null) {
progress.show();
Log.i("Arduino Server ", "[ Server Bağlantısı Kuruluyor ]");
} else {
progress.dismiss();
Log.i("Arduino Server ", "[ Server Bağlantısı Kuruldu ]");
}

try {
JSONObject json = new JSONObject(result);
outlet10 = json.getString("outlet10").toString();
outlet11 = json.getString("outlet11").toString();
outlet12 = json.getString("outlet12").toString();
outlet13 = json.getString("outlet13").toString();
outlet14 = json.getString("outlet14").toString();
outlet15 = json.getString("outlet15").toString();

if (outlet10.equals("on")) { Switch1.setChecked(true);  }else{ Switch1.setChecked(false); }
if (outlet11.equals("on")) { Switch2.setChecked(true);  }else{ Switch2.setChecked(false); }
if (outlet12.equals("on")) { Switch3.setChecked(true);  }else{ Switch3.setChecked(false); }
if (outlet13.equals("on")) { Switch4.setChecked(true);  }else{ Switch4.setChecked(false); }
if (outlet14.equals("on")) { Switch5.setChecked(true);  }else{ Switch5.setChecked(false); }
if (outlet15.equals("on")) { Switch6.setChecked(true);  }else{ Switch6.setChecked(false); }

} catch (JSONException e) {
e.printStackTrace();
}
Log.i("Json Durumlar ", "Alındı...");
}
}

enter image description here enter image description here

Selçuk
  • 23
  • 3

1 Answers1

0

Bu linkteki örneğe bakabilir misin? yardımcı olabilir

birinci link ikinci link

Community
  • 1
  • 1
CompEng
  • 7,161
  • 16
  • 68
  • 122
  • Ersin bey, denedim ama login kısmını bir türlü geçemedim. şifreyi kaldırdığımda Outlet değerleri okuyabiliyorum ama sayfa güvenliksiz oluyor. – Selçuk Apr 08 '14 at 06:48
  • güncelledim cevabımı , iki tane yeni link koydum – CompEng Apr 08 '14 at 06:53
  • Ersin bey, deniyorum ama İlgili Activity aktif olunca program hata veriyor ve durduruldu diyor. Şifre alanını geçip durumları okuyamıyorum. ve Ayrıca Content = application/json – Selçuk Apr 08 '14 at 07:21
  • who can help I guess :(( – Selçuk May 30 '14 at 06:15