List of usage examples for android.util Log v
public static int v(String tag, String msg)
From source file:com.safecell.networking.RulesAccountRequest.java
public HttpResponse ruleRequest() { HttpClient httpclient = new DefaultHttpClient(); QueryString queryString = new QueryString(); queryString.add("lat", "" + latitude); queryString.add("lng", "" + longitude); queryString.add("distance", "" + radius); String url = URLs.REMOTE_URL + "api/1/rules?" + queryString.getQuery(); // Log.v(TAG, "Rules URL:"+url); HttpGet httpget = new HttpGet(url); HttpResponse response;/*from www .j a v a2s. com*/ httpget.addHeader(HEADER, API_KEY); try { response = httpclient.execute(httpget); // Log.v("Safecell :"+"Rules Response", // response.getStatusLine().toString()); // Log.v("Safecell :"+"Response", response+"response"); if (response.getStatusLine().toString().equalsIgnoreCase("HTTP/1.1 200 OK")) { Log.v("Safecell :" + "Response", response + "response"); return response; } else { failureMessage = "Rule download failed because of an unexpected error."; Log.v("Safecell :" + "failureMessage", failureMessage); response = null; } } catch (Exception e) { failureMessage = "Rule download failed because of an unexpected error."; e.printStackTrace(); // Log.v("Safecell :"+"catch", "catch"); response = null; } return response; }
From source file:com.allegrorom.ota.GCMIntentService.java
@Override protected void onRegistered(Context ctx, String regID) { Log.v("OTA::GCMRegister", "GCM registered - ID=" + regID); ArrayList<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>(); params.add(new BasicNameValuePair("do", "register")); params.add(new BasicNameValuePair("reg_id", regID)); params.add(new BasicNameValuePair("device", android.os.Build.DEVICE.toLowerCase())); params.add(new BasicNameValuePair("rom_id", Utils.getRomID())); params.add(new BasicNameValuePair("device_id", ((TelephonyManager) getSystemService(TELEPHONY_SERVICE)).getDeviceId())); try {//from www . j ava 2 s . c o m HttpClient http = new DefaultHttpClient(); HttpPost req = new HttpPost(Config.GCM_REGISTER_URL); req.setEntity(new UrlEncodedFormEntity(params)); HttpResponse r = http.execute(req); int status = r.getStatusLine().getStatusCode(); HttpEntity e = r.getEntity(); if (status == 200) { String data = EntityUtils.toString(e); if (data.length() == 0) { Log.w("OTA::GCMRegister", "No response to registration"); return; } JSONObject json = new JSONObject(data); if (json.length() == 0) { Log.w("OTA::GCMRegister", "Empty response to registration"); return; } if (json.has("error")) { Log.e("OTA::GCMRegister", json.getString("error")); return; } RomInfo info = new RomInfo(json.getString("rom"), json.getString("version"), json.getString("changelog"), json.getString("url"), json.getString("md5"), Utils.parseDate(json.getString("date"))); final Config cfg = Config.getInstance(getApplicationContext()); if (Utils.isUpdate(info)) { cfg.storeUpdate(info); if (cfg.getShowNotif()) { Utils.showUpdateNotif(getApplicationContext(), info); } else { Log.v("OTA::GCMRegister", "got update response, notif not shown"); } } else { cfg.clearStoredUpdate(); } } else { if (e != null) e.consumeContent(); Log.w("OTA::GCMRegister", "registration response " + status); } } catch (Exception e) { e.printStackTrace(); } }
From source file:com.clearcenter.mobile_demo.mdAuthenticator.java
public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) { Log.v(TAG, "confirmCredentials()"); //return null; final Intent intent = new Intent(ctx, mdAuthenticatorActivity.class); intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response); final Bundle bundle = new Bundle(); bundle.putParcelable(AccountManager.KEY_INTENT, intent); return bundle; }
From source file:io.github.minime89.passbeam.keyboard.Keysyms.java
/** * Build all keysyms. This will call {@link Keysym#build(Converter)} for every keysym in * {@link #keysyms}. Any failed keysym build attempts will be ignored. * * @param converter The converter used for possible keycode, keysym and scancode lookups. *///from w w w .j av a 2 s.com public void build(Converter converter) { for (Keysym keysym : keysyms) { try { keysym.build(converter); } catch (Keysym.KeysymBuildException e) { Log.v(TAG, e.getMessage()); } } }
From source file:com.parking.auth.LoginUserAsyncTask.java
protected Boolean doInBackground(String... tokens) { try {// w w w . j a va 2 s.c om /** Don't follow redirects */ http_client.getParams().setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, true); HttpPost httppost = new HttpPost(ParkingConstants.serverUrl + "/loginServlet"); /** Add your data */ List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); nameValuePairs.add(new BasicNameValuePair("username", ParkingApplication.getAccount().name)); nameValuePairs.add(new BasicNameValuePair("isDevice", "true")); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response; response = http_client.execute(httppost); Log.v(TAG, "Respone is " + response.getStatusLine().getStatusCode()); Log.v(TAG, response.getStatusLine().toString()); if (response.getStatusLine().getStatusCode() == 200) { /** Extract JSON user message from user response */ ObjectMapper objectMapper = new ObjectMapper(); LicensePlateJsonObject licensePlate = objectMapper.readValue(response.getEntity().getContent(), LicensePlateJsonObject.class); result = true; AppPreferences.getInstance() .setLicensePlateString(licensePlate.getLicensePlateList().toUpperCase()); } } catch (Exception e) { e.printStackTrace(); result = false; } finally { http_client.getParams().setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, true); } return result; }
From source file:com.test.mytest.network.request.VolleyRequest.java
@Override protected Response<String> parseNetworkResponse(NetworkResponse response) { String parsed = null;/*from w w w . j a v a2 s.c om*/ //Log.v("222","response etag: "+response.headers.get("ETag")); Log.v("222", "statuscode: " + response.statusCode); if (response.statusCode == HttpStatus.SC_NOT_MODIFIED) { try { parsed = new String(entry.data, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } else { try { parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); } catch (UnsupportedEncodingException e) { parsed = new String(response.data); } } return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response)); }
From source file:fr.cph.stock.android.activity.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { Log.v(TAG, "MainActivity onCreate"); super.onCreate(savedInstanceState); setContentView(R.layout.main);//from ww w . j ava 2 s. c om Bundle b = getIntent().getExtras(); portfolio = b.getParcelable("portfolio"); ada = new MainListAdapter(this, portfolio); listView = (ListView) findViewById(R.id.mainList); listView.setAdapter(ada); listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { Intent intent; switch (position) { case 0: intent = new Intent(getBaseContext(), AccountActivity.class); intent.putExtra("portfolio", portfolio); startActivityForResult(intent, MainActivity.ACCOUNT_REQUEST); overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); break; case 1: intent = new Intent(getBaseContext(), EquityActivity.class); intent.putExtra("portfolio", portfolio); startActivityForResult(intent, MainActivity.EQUITY_REQUEST); overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); break; case 2: intent = new Intent(getBaseContext(), OverallActivity.class); intent.putExtra("portfolio", portfolio); startActivityForResult(intent, MainActivity.OVERALL_REQUEST); overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); break; } } }); ActionBar actionBar = getActionBar(); actionBar.setDisplayOptions( ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_CUSTOM); errorView = (TextView) findViewById(R.id.errorMessage); errorView.setOnClickListener(new ErrorMainOnClickListener(listView, errorView)); EasyTracker.getInstance().setContext(this); // Set context EasyTracker.getInstance().setContext(getApplicationContext()); // Instantiate the Tracker tracker = EasyTracker.getTracker(); }
From source file:com.auth0.api.AuthenticatedAPIClient.java
public void requestSmsCode(String phoneNumber, final BaseCallback<Void> callback) { String requestCodeUrl = getBaseURL() + "/api/v2/users"; Map<String, Object> params = ParameterBuilder.newBuilder().clearAll().setConnection("sms") .set("email_verified", false).set("phone_number", phoneNumber).asDictionary(); Log.v(AuthenticatedAPIClient.class.getName(), "Requesting SMS code for phone " + phoneNumber); HttpEntity entity = this.entityBuilder.newEntityFrom(params); this.client.post(null, requestCodeUrl, entity, APPLICATION_JSON, new AsyncHttpResponseHandler() { @Override/*from w ww . j a v a 2s. c om*/ public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) { callback.onSuccess(null); } @Override public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) { Log.e(TAG, "Failed to request SMS code", error); Map errorResponse = null; if (statusCode == 400 || statusCode == 401) { try { errorResponse = new ObjectMapper().readValue(responseBody, Map.class); Log.e(APIClient.class.getName(), "Login error " + errorResponse); } catch (IOException e) { Log.w(APIClient.class.getName(), "Failed to parse json error response", error); } } callback.onFailure( new APIClientException("Failed to request SMS code", error, statusCode, errorResponse)); } }); }
From source file:io.github.minime89.passbeam.keyboard.Scancodes.java
/** * Build all scancodes. This will call {@link Scancode#build(Converter)} for every scancode in * {@link #scancodes}. Any failed scancode build attempts will be ignored. * * @param converter The converter used for possible keycode, keysym and scancode lookups. *//* w ww . j ava 2s.c om*/ public void build(Converter converter) { for (Scancode scancode : scancodes) { try { scancode.build(converter); } catch (Scancode.ScancodeBuildException e) { Log.v(TAG, e.getMessage()); } } }
From source file:io.github.minime89.passbeam.keyboard.Keycodes.java
/** * Build all keycodes. This will call {@link Keycode#build(Converter)} for every keycode in * {@link #keycodes}. Any failed keycode build attempts will be ignored. * * @param converter The converter used for possible keycode, keysym and scancode lookups. *//*from www .ja va2 s.c om*/ public void build(Converter converter) { for (Keycode keycode : keycodes) { try { keycode.build(converter); } catch (Keycode.KeycodeBuildException e) { Log.v(TAG, e.getMessage()); } } }