List of usage examples for android.util Log v
public static int v(String tag, String msg)
From source file:com.funzio.pure2D.particles.nova.NovaLoader.java
/** * Load a specific Nova file, asynchronously. Note: some old Android version required to call this on UI Thread first off. * /*from w ww . ja v a 2 s . c o m*/ * @param assets * @param filePath */ public void loadAsync(final AssetManager assets, final String filePath) { Log.v(TAG, "loadAsync(): " + filePath); final AsyncTaskExecuter<Task> executer = new AsyncTaskExecuter<Task>(); // start loading executer.executeOnPool(new RunnableTask(new Runnable() { @Override public void run() { load(assets, filePath); } })); }
From source file:org.openschedule.api.impl.EventTemplate.java
public Event getEvent(String shortName) { Log.v(TAG, "getEvent : enter"); if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "getEvent : shortName=" + shortName); }/*from w w w . j a v a 2 s .co m*/ Event event = restTemplate.getForObject(buildUri("public/" + shortName), Event.class); Log.v(TAG, "getEvent : event=" + event.toString()); Log.v(TAG, "getEvent : exit"); return event; }
From source file:fr.cph.stock.android.activity.LoginActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { Log.v(TAG, "LoginActivity onCreate"); super.onCreate(savedInstanceState); // Remove title bar //this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.login_activity); // Set up the login form. mLoginView = (EditText) findViewById(R.id.email); errorView = (TextView) findViewById(R.id.login_error); mPasswordView = (EditText) findViewById(R.id.password); mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override//ww w . jav a2s . c o m public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) { if (id == R.id.login || id == EditorInfo.IME_NULL) { attemptLogin(); return true; } return false; } }); checkBox = (CheckBox) findViewById(R.id.checkbox); mLoginFormView = findViewById(R.id.login_form); mLoginStatusView = findViewById(R.id.login_status); mLoginStatusMessageView = (TextView) findViewById(R.id.login_status_message); findViewById(R.id.sign_in_button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { attemptLogin(); } }); EasyTracker.getInstance().setContext(this); }
From source file:com.example.touchdbtest.CouchbaseUtils.java
public static void Destroy() { Log.v(TAG, "onDestroy"); if (context != null) context.unbindService(couchServiceConnection); // clean up our http client connection manager if (httpClient != null) { httpClient.shutdown();/* w w w .ja va 2 s . c om*/ } }
From source file:com.oakley.fon.util.HttpUtils.java
public static HttpResult getUrl(String url, int maxRetries) throws IOException { String result = null;/*from w ww .j a va2 s . co m*/ int retries = 0; HttpContext localContext = new BasicHttpContext(); DefaultHttpClient httpclient = getHttpClient(); HttpGet httpget = new HttpGet(url); while (retries <= maxRetries && result == null) { try { retries++; HttpEntity entity = httpclient.execute(httpget, localContext).getEntity(); if (entity != null) { result = EntityUtils.toString(entity).trim(); } } catch (SocketException se) { if (retries > maxRetries) { throw se; } else { Log.v(TAG, "SocketException, retrying " + retries); } } } return new HttpResult(result, (BasicHttpResponse) localContext.getAttribute("http.response"), ((HttpHost) localContext.getAttribute("http.target_host")).toURI()); }
From source file:org.vuphone.assassins.android.http.HTTPPoster.java
public static void doLandMineRemove(LandMine lm) { final HttpPost post = new HttpPost(VUphone.SERVER + PATH); post.addHeader("Content-Type", "application/x-www-form-urlencoded"); StringBuffer params = new StringBuffer(); params.append("type=landMineRemove&lat=" + lm.getLatitude() + "&lon=" + lm.getLongitude()); Log.v(VUphone.tag, pre + "Created parameter string: " + params); post.setEntity(new ByteArrayEntity(params.toString().getBytes())); // Do it// w w w.j a v a 2s. c o m Log.i(VUphone.tag, pre + "Executing post to " + VUphone.SERVER + PATH); HttpResponse resp = null; try { resp = c.execute(post); ByteArrayOutputStream bao = new ByteArrayOutputStream(); resp.getEntity().writeTo(bao); Log.d(VUphone.tag, pre + "Response from server: " + new String(bao.toByteArray())); } catch (ClientProtocolException e) { Log.e(VUphone.tag, pre + "ClientProtocolException executing post: " + e.getMessage()); } catch (IOException e) { Log.e(VUphone.tag, pre + "IOException writing to ByteArrayOutputStream: " + e.getMessage()); } catch (Exception e) { Log.e(VUphone.tag, pre + "Other Exception of type:" + e.getClass()); Log.e(VUphone.tag, pre + "The message is: " + e.getMessage()); } }
From source file:br.com.hotforms.FacebookHash.java
/** * Executes the request and returns PluginResult. * * @param action The action to execute. * @param args JSONArry of arguments for the plugin. * @param callbackContext The callback id used when calling back into JavaScript. * @return True if the action was valid, false otherwise. *//*from www. j av a2s.c o m*/ @Override public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext) throws JSONException { Log.v(TAG, "Executing action: " + action); final Activity activity = this.cordova.getActivity(); final Window window = activity.getWindow(); if ("getHash".equals(action)) { try { String packageName = activity.getClass().getPackage().getName(); PackageManager packageManager = activity.getPackageManager(); PackageInfo info = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES); for (Signature signature : info.signatures) { MessageDigest md = MessageDigest.getInstance("SHA"); md.update(signature.toByteArray()); String hash = Base64.encodeToString(md.digest(), Base64.DEFAULT); String result = String.format("{ FacebookHash : \"%s\", PackageName : \"%s\"}", hash.trim(), packageName); callbackContext.success(result); } } catch (NameNotFoundException e) { callbackContext.error(e.getMessage()); } catch (NoSuchAlgorithmException e) { callbackContext.error(e.getMessage()); } return true; } return false; }
From source file:com.example.danstormont.sunshine.app.FetchWeatherTask.java
/** * Helper method to handle insertion of a new location in the weather database. * * @param locationSetting The location string used to request updates from the server. * @param cityName A human-readable city name, e.g "Mountain View" * @param lat the latitude of the city//from w w w . jav a 2s . co m * @param lon the longitude of the city * @return the row ID of the added location. */ private long addLocation(String locationSetting, String cityName, double lat, double lon) { Log.v(LOG_TAG, "inserting " + cityName + ", with coord: " + lat + ", " + lon); // First, check if the location with this city name exists in the db Cursor cursor = mContext.getContentResolver().query(LocationEntry.CONTENT_URI, new String[] { LocationEntry._ID }, LocationEntry.COLUMN_LOCATION_SETTING + " = ?", new String[] { locationSetting }, null); if (cursor.moveToFirst()) { int locationIdIndex = cursor.getColumnIndex(LocationEntry._ID); return cursor.getLong(locationIdIndex); } else { ContentValues locationValues = new ContentValues(); locationValues.put(LocationEntry.COLUMN_LOCATION_SETTING, locationSetting); locationValues.put(LocationEntry.COLUMN_CITY_NAME, cityName); locationValues.put(LocationEntry.COLUMN_COORD_LAT, lat); locationValues.put(LocationEntry.COLUMN_COORD_LONG, lon); Uri locationInsertUri = mContext.getContentResolver().insert(LocationEntry.CONTENT_URI, locationValues); return ContentUris.parseId(locationInsertUri); } }
From source file:com.emuneee.speeedreader.test.ArticleUtilsTestCase.java
/** * Test the ability to get a reading list from Google Reader */// www . j a va2s. c o m public void testParseArticles() { HttpURLConnection urlConnection; String response; Collection readingList; int n = 50; try { urlConnection = HttpUtils.getUrlConnection( "http://www.google.com/reader/api/0/stream/contents/user/-/state/com.google/reading-list?n=" + n, mToken); assertNotNull(urlConnection); response = HttpUtils.processHttpRequest(urlConnection); Log.v(TAG, response); assertNotNull(response); assertEquals(true, response.length() > 0); readingList = ArticleUtils.parseArticles(response); assertNotNull(readingList); assertNotNull(readingList.getArticles()); assertEquals(n, readingList.getArticles().size()); } catch (IOException e) { Log.w(TAG, e.getMessage()); assertTrue(false); } catch (JSONException e) { Log.w(TAG, e.getMessage()); assertTrue(false); } }