Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
String header = Settings.PREFERENCES.getString(Settings.PHONE_PREF, null)+ ":"+ Settings.PREFERENCES.getString(Settings.PASSWORD_PREF, null);
Log.i("header" , header);
byte[] data64 = null;
try {
data64 = header.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
JSONObject json = new JSONObject();
try {
String datos = seleccion;
json.put("number", datos); //enviar string transformado
json.put("auth_token", Settings.PREFERENCES.getString(Settings.USER_AUTH_TOKEN, null));
Log.i("Datos-QR", datos);
} catch (JSONException e) {
e.printStackTrace();
}
String auth = Base64.encodeBytes(data64);
Log.i("URL NUMERO MESA", UrlApi.URL_BASE+ UrlApi.URL_CHECKIN+ Settings.PREFERENCES.getString(Settings.MODEL_PREF, null));
String response = RequestMethods.doMethodsWithResponse(UrlApi.URL_BASE+ UrlApi.URL_CHECKIN+ Settings.PREFERENCES.getString(Settings.MODEL_PREF, null), httpClient, json, "POST");
Log.i("Response Principal", response);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment