Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void goToSincronizar2(View view) {
- DatabaseHelper myDb;
- // al crear el objeto myDb ejecutamos las sentencias, para crear las tablas necesarias
- myDb = new DatabaseHelper(this);
- myDb.init();
- Cursor res = myDb.extraeconfig();
- String xUrl = "";
- String xUser = "";
- String xPass = "";
- String xCatalogo = "";
- if (res != null && res.getCount() > 0) {
- res.moveToFirst();
- xUrl = res.getString(res.getColumnIndex("dburl")) + res.getString(res.getColumnIndex("dbdatabase"));
- xUser = res.getString(res.getColumnIndex("dbuser"));
- xPass = res.getString(res.getColumnIndex("dbpass"));
- xCatalogo = "cFrigorificos";
- } else {
- Toast.makeText(this, "ERROR archivo de configuracion (swItsol.db)", Toast.LENGTH_LONG).show();
- }
- HashMap<String, String> params = new HashMap<>();
- params.put("xCatalogo", xCatalogo);
- params.put("xUrl", xUrl);
- params.put("xUser", xUser);
- params.put("xPass", xPass);
- final String XxCatalogo = xCatalogo;
- final String XxUrl = xUrl;
- final String XxUser = xUser;
- final String XxPass = xPass;
- JsonObjectRequest js = new JsonObjectRequest(
- Request.Method.POST,
- "http://192.168.0.10:8080/jinvmanz/wwwcatalogosMobiles/extraecatalogos.jsp",
- null,
- new Response.Listener<JSONObject>() {
- @Override
- public void onResponse(JSONObject response) {
- Log.d("tag", "User creation completed successfully");
- }
- },
- new Response.ErrorListener() {
- @Override
- public void onErrorResponse(VolleyError error) {
- Log.i("tag", "error 404 " + error.getMessage());
- }
- }) {
- @Override
- protected Map<String, String> getParams() throws AuthFailureError {
- HashMap<String, String> params = new HashMap<>();
- params.put("xCatalogo", XxCatalogo);
- params.put("xUrl", XxUrl);
- params.put("xUser", XxUser);
- params.put("xPass", XxPass);
- return params;
- }
- };
- RequestQueue queue = Volley.newRequestQueue(actMenu.this);
- queue.add(js);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement