protected void loginfailed() { Toast.makeText(this, "Login failed", Toast.LENGTH_SHORT).show(); if (httpConnect != null) { httpConnect.stopThread(); httpConnect = null; } }
private void checkUser() { dlg = ProgressDialog.show(this, "Logining", "Please wait for a second"); email = emailaddress.getText().toString(); String passwds = passwd.getText().toString(); String url = ipadd + ":" + portstring + "/tracking/api/login"; JSONObject param = new JSONObject(); try { param.put("account.email", email); param.put("account.pwd", passwds); param.put("device.id", imei); param.put("device.name", devicename); param.put("device.model", devicemode); param.put("device.description", devicedescription); } catch (JSONException e) { e.printStackTrace(); } // try { // byte[] bytes = MessagePack.pack(param); // } catch (IOException e) { // e.printStackTrace(); // } httpConnect = new HttpNet(handler, url, param, 1); httpConnect.startHttp(); }
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { if (dlg != null && dlg.isShowing()) { dlg.dismiss(); dlg = null; } if (httpConnect != null) { httpConnect.stopThread(); httpConnect = null; } finish(); System.exit(0); } return false; }
protected void loginScc() { Toast.makeText(this, "Login Succed", Toast.LENGTH_SHORT).show(); if (httpConnect != null) { httpConnect.stopThread(); httpConnect = null; } Intent intent = new Intent(this, GetLine.class); Bundle map = new Bundle(); map.putString("sessionid", sessionid); map.putString("IPADDRESS", ipadd); map.putString("PORT", portstring); map.putString("MAIL", email); intent.putExtra("SESSIONID", map); startActivity(intent); }