List of usage examples for android.util Log v
public static int v(String tag, String msg)
From source file:com.amytech.android.library.utils.asynchttp.RangeFileAsyncHttpResponseHandler.java
@Override public void sendResponseMessage(HttpResponse response) throws IOException { if (!Thread.currentThread().isInterrupted()) { StatusLine status = response.getStatusLine(); if (status.getStatusCode() == HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE) { // already finished if (!Thread.currentThread().isInterrupted()) sendSuccessMessage(status.getStatusCode(), response.getAllHeaders(), null); } else if (status.getStatusCode() >= 300) { if (!Thread.currentThread().isInterrupted()) sendFailureMessage(status.getStatusCode(), response.getAllHeaders(), null, new HttpResponseException(status.getStatusCode(), status.getReasonPhrase())); } else {/* ww w. j a va 2 s.c om*/ if (!Thread.currentThread().isInterrupted()) { Header header = response.getFirstHeader(AsyncHttpClient.HEADER_CONTENT_RANGE); if (header == null) { append = false; current = 0; } else { Log.v(LOG_TAG, AsyncHttpClient.HEADER_CONTENT_RANGE + ": " + header.getValue()); } sendSuccessMessage(status.getStatusCode(), response.getAllHeaders(), getResponseData(response.getEntity())); } } } }
From source file:fr.cph.stock.android.activity.AccountActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { Log.v(TAG, "Account Activity onCreate"); super.onCreate(savedInstanceState); setContentView(R.layout.account_activity); Bundle b = getIntent().getExtras();/*from w ww. j a v a 2 s . c o m*/ portfolio = b.getParcelable("portfolio"); errorView = (TextView) findViewById(R.id.errorMessage); totalValueView = (TextView) findViewById(R.id.totalValue); totalGainView = (TextView) findViewById(R.id.totalGain); totalPlusMinusValueView = (TextView) findViewById(R.id.totalPlusMinusValue); lastUpateView = (TextView) findViewById(R.id.lastUpdate); liquidityView = (TextView) findViewById(R.id.liquidity); yieldYearView = (TextView) findViewById(R.id.yieldYear); shareValueView = (TextView) findViewById(R.id.shareValue); gainView = (TextView) findViewById(R.id.gain2); perfView = (TextView) findViewById(R.id.perf); yieldView = (TextView) findViewById(R.id.yieldPerf); taxesView = (TextView) findViewById(R.id.taxes); RelativeLayout accLayout = (RelativeLayout) findViewById(R.id.accountsLayout); TextView recent = new TextView(getApplicationContext()); textViews = new ArrayList<TextView>(); int id = 1; int nameID = 100; int viewId1 = 500; int currencyId = 1000; for (int i = 0; i < portfolio.getAccounts().size(); i++) { Account account = portfolio.getAccounts().get(i); TextView currentAccountNameTextView = new TextView(getApplicationContext()); currentAccountNameTextView.setText(account.getName()); currentAccountNameTextView.setTextColor(Color.GRAY); currentAccountNameTextView.setId(nameID); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams((int) LayoutParams.WRAP_CONTENT, (int) LayoutParams.WRAP_CONTENT); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } params.addRule(RelativeLayout.ALIGN_PARENT_LEFT); currentAccountNameTextView.setLayoutParams(params); accLayout.addView(currentAccountNameTextView, params); textViews.add(currentAccountNameTextView); View viewPoint1 = new View(getApplicationContext()); viewPoint1.setId(viewId1); viewPoint1.setBackgroundColor(getResources().getColor(R.color.grey_light)); params = new RelativeLayout.LayoutParams((int) LayoutParams.MATCH_PARENT, 2); params.addRule(RelativeLayout.RIGHT_OF, nameID); params.addRule(RelativeLayout.LEFT_OF, currencyId); params.setMargins(0, Util.convertDpToPxl(15, getApplicationContext()), 0, 0); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } viewPoint1.setLayoutParams(params); accLayout.addView(viewPoint1, params); TextView currentCurrencyTextView = new TextView(getApplicationContext()); currentCurrencyTextView.setText(account.getCurrency()); currentCurrencyTextView.setTextColor(Color.GRAY); currentCurrencyTextView.setId(currencyId); params = new RelativeLayout.LayoutParams((int) LayoutParams.WRAP_CONTENT, (int) LayoutParams.WRAP_CONTENT); params.addRule(RelativeLayout.CENTER_HORIZONTAL); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } currentCurrencyTextView.setLayoutParams(params); accLayout.addView(currentCurrencyTextView, params); textViews.add(currentCurrencyTextView); View viewPoint2 = new View(getApplicationContext()); viewPoint2.setBackgroundColor(getResources().getColor(R.color.grey_light)); params = new RelativeLayout.LayoutParams((int) LayoutParams.MATCH_PARENT, 2); params.addRule(RelativeLayout.RIGHT_OF, currencyId); params.addRule(RelativeLayout.LEFT_OF, id); params.setMargins(0, Util.convertDpToPxl(15, getApplicationContext()), 0, 0); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } viewPoint2.setLayoutParams(params); accLayout.addView(viewPoint2, params); TextView currentTextView = new TextView(getApplicationContext()); currentTextView.setText(account.getLiquidity()); currentTextView.setTextColor(Color.GRAY); currentTextView.setId(id); params = new RelativeLayout.LayoutParams((int) LayoutParams.WRAP_CONTENT, (int) LayoutParams.WRAP_CONTENT); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); currentTextView.setLayoutParams(params); recent = currentTextView; accLayout.addView(currentTextView, params); textViews.add(currentTextView); id++; nameID++; viewId1++; currencyId++; } buildUi(false); // Set context EasyTracker.getInstance().setContext(getApplicationContext()); // Instantiate the Tracker tracker = EasyTracker.getTracker(); }
From source file:net.evecom.androidecssp.activity.EventListActivity.java
/** * //from w w w . j a v a 2 s . co m */ private void initlist() { new Thread(new Runnable() { @Override public void run() { Message message = new Message(); try { resutArray = connServerForResultPost("jfs/ecssp/mobile/eventCtr/getEnentList", null); } catch (ClientProtocolException e) { message.what = MESSAGETYPE_02; Log.e("mars", e.getMessage()); } catch (IOException e) { message.what = MESSAGETYPE_02; Log.e("mars", e.getMessage()); } if (resutArray.length() > 0) { try { eventInfos = getObjsInfo(resutArray); if (null == eventInfos) { message.what = MESSAGETYPE_02; } else { message.what = MESSAGETYPE_01; } } catch (JSONException e) { message.what = MESSAGETYPE_02; Log.e("mars", e.getMessage()); } } else { message.what = MESSAGETYPE_02; } Log.v("mars", resutArray); eventListHandler.sendMessage(message); } }).start(); }
From source file:br.com.hotforms.StatusBarManager.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 a v a 2 s. co 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 ("_ready".equals(action)) { boolean statusBarVisible = (window.getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0; callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, statusBarVisible)); } else if ("show".equals(action)) { this.cordova.getActivity().runOnUiThread(new Runnable() { @Override public void run() { window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); } }); return true; } else if ("hide".equals(action)) { this.cordova.getActivity().runOnUiThread(new Runnable() { @Override public void run() { window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); if (currentapiVersion >= android.os.Build.VERSION_CODES.LOLLIPOP) { window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.clearFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN); } } }); return true; } else if ("setTranslucent".equals(action)) { if (currentapiVersion >= android.os.Build.VERSION_CODES.KITKAT) { this.cordova.getActivity().runOnUiThread(new Runnable() { @Override public void run() { window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); if (currentapiVersion >= android.os.Build.VERSION_CODES.LOLLIPOP) { window.clearFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN); } window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); } }); return true; } else { return false; } } else if ("setTransparent".equals(action)) { if (currentapiVersion >= android.os.Build.VERSION_CODES.LOLLIPOP) { this.cordova.getActivity().runOnUiThread(new Runnable() { @Override public void run() { window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN); } }); return true; } else { return false; } } else if ("setColor".equals(action)) { if (currentapiVersion >= android.os.Build.VERSION_CODES.LOLLIPOP) { this.setColor(args.getInt(0), args.getInt(1), args.getInt(2)); return true; } else { return false; } } return false; }
From source file:com.clearcenter.mobile_demo.mdAuthenticator.java
public Bundle editProperties(AccountAuthenticatorResponse response, String accountType) { Log.v(TAG, "editProperties()"); throw new UnsupportedOperationException(); }
From source file:eu.trentorise.smartcampus.ac.network.RemoteConnector.java
public static TokenData validateAccessCode(String service, String code, String clientId, String clientSecret, String scope, String redirectUri) throws AACException { final HttpResponse resp; Log.i(TAG, "validating code: " + code); // String url = service + PATH_TOKEN+"?grant_type=authorization_code&code="+code+"&client_id="+clientId +"&client_secret="+clientSecret+"&redirect_uri="+redirectUri; // if (scope != null) url+= "&scope="+scope; final HttpPost post = new HttpPost(service + PATH_TOKEN); ArrayList<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("grant_type", "authorization_code")); params.add(new BasicNameValuePair("code", code)); params.add(new BasicNameValuePair("client_id", clientId)); params.add(new BasicNameValuePair("client_secret", clientSecret)); params.add(new BasicNameValuePair("redirect_uri", redirectUri)); if (scope != null) params.add(new BasicNameValuePair("scope", scope)); post.setHeader("Accept", "application/json"); try {//from www . ja va 2 s . c om post.setEntity(new UrlEncodedFormEntity(params)); resp = getHttpClient().execute(post); final String response = EntityUtils.toString(resp.getEntity()); if (resp.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { TokenData data = TokenData.valueOf(response); Log.v(TAG, "Successful authentication"); return data; } Log.e(TAG, "Error validating " + resp.getStatusLine()); throw new AACException("Error validating " + resp.getStatusLine()); } catch (final Exception e) { Log.e(TAG, "Exception when getting authtoken", e); throw new AACException(e); } finally { Log.v(TAG, "getAuthtoken completing"); } }
From source file:org.mythtv.client.MainApplication.java
@Override public void onCreate() { Log.v(TAG, "onCreate : enter"); super.onCreate(); //init Image Loader initImageLoader(getApplicationContext()); //Initialize DAO Helpers EtagDaoHelper.getInstance();//from w w w. ja v a 2 s .c om LocationProfileDaoHelper.getInstance(); ChannelDaoHelper.getInstance(); FrontendDaoHelper.getInstance(); LiveStreamDaoHelper.getInstance(); RecordingDaoHelper.getInstance(); PlaybackProfileDaoHelper.getInstance(); ProgramGuideDaoHelper.getInstance(); ProgramGroupDaoHelper.getInstance(); RecordedDaoHelper.getInstance(); UpcomingDaoHelper.getInstance(); //Initialize Helpers NetworkHelper.getInstance(); RunningServiceHelper.getInstance(); ProgramHelper.getInstance().init(this); MenuHelper.getInstance(); String systemClock = Settings.System.getString(getApplicationContext().getContentResolver(), Settings.System.TIME_12_24); if (null != systemClock) { this.clockType = systemClock; } String dateFormatOrder = Settings.System.getString(getContentResolver(), Settings.System.DATE_FORMAT); if (null != dateFormatOrder) { String format = new String(dateFormatOrder); if (format.equals("Mdy")) { this.dateFormat = "MM-dd-yyyy"; } else if (format.equals("dMy")) { this.dateFormat = "dd-MM-yyyy"; } else if (format.equals("yMd")) { this.dateFormat = "yyyy-MM-dd"; } } mObjectMapper = new ObjectMapper(); mObjectMapper.registerModule(new JodaModule()); Log.v(TAG, "onCreate : exit"); }
From source file:fr.eoidb.util.ImageDownloader.java
@SuppressWarnings("unchecked") public void loadImageCache(Context context) { if (BuildConfig.DEBUG) Log.v(LOG_TAG, "Loading image cache..."); File cacheFile = new File(context.getCacheDir(), cacheFileName); if (cacheFile.exists() && cacheFile.length() > 0) { ObjectInputStream ois = null; try {/*from ww w . j a v a 2 s . c o m*/ HashMap<String, String> cacheDescription = new HashMap<String, String>(); ois = new ObjectInputStream(new FileInputStream(cacheFile)); cacheDescription = (HashMap<String, String>) ois.readObject(); for (Entry<String, String> cacheDescEntry : cacheDescription.entrySet()) { loadSingleCacheFile(cacheDescEntry.getKey(), context); } } catch (StreamCorruptedException e) { Log.e(LOG_TAG, e.getMessage(), e); } catch (FileNotFoundException e) { Log.e(LOG_TAG, e.getMessage(), e); } catch (EOFException e) { //delete the corrupted cache file Log.w(LOG_TAG, "Deleting the corrupted cache file.", e); cacheFile.delete(); } catch (IOException e) { Log.e(LOG_TAG, e.getMessage(), e); } catch (ClassNotFoundException e) { Log.e(LOG_TAG, e.getMessage(), e); } finally { if (ois != null) { try { ois.close(); } catch (IOException e) { Log.e(LOG_TAG, e.getMessage(), e); } } } } }
From source file:com.funzio.pure2D.atlas.JsonAtlas.java
protected void load(final InputStream stream, final float scale) throws IOException, JSONException { Log.v(TAG, "load()"); final StringBuilder sb = new StringBuilder(); while (stream.available() > 0) { final byte[] bytes = new byte[stream.available()]; stream.read(bytes);//from w ww . j a va 2s. co m sb.append(new String(bytes)); } stream.close(); parse(sb.toString(), scale); }
From source file:fr.eoidb.util.AndroidUrlDownloader.java
@Override public InputStream urlToInputStream(Context context, String url) throws DownloadException { if (!isNetworkAvailable(context)) { throw new DownloadException("No internet connection!"); }//from w ww . j a v a 2s . com try { HttpParams httpParameters = new BasicHttpParams(); // Set the timeout in milliseconds until a connection is established. // The default value is zero, that means the timeout is not used. int timeoutConnection = 3000; HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection); // Set the default socket timeout (SO_TIMEOUT) // in milliseconds which is the timeout for waiting for data. int timeoutSocket = 5000; HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket); HttpClient httpclient = new DefaultHttpClient(httpParameters); HttpGet httpget = new HttpGet(url); httpget.addHeader("Accept-Encoding", "gzip"); HttpResponse response; response = httpclient.execute(httpget); Log.v(LOG_TAG, response.getStatusLine().toString()); HttpEntity entity = response.getEntity(); final int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != HttpStatus.SC_OK) { String message = "Error " + statusCode + " while retrieving url " + url; Log.w("AndroidUrlDownloader", message); throw new DownloadException(message); } if (entity != null) { InputStream instream = entity.getContent(); Header contentEncoding = response.getFirstHeader("Content-Encoding"); if (contentEncoding != null && contentEncoding.getValue().equalsIgnoreCase("gzip")) { Log.v(LOG_TAG, "Accepting gzip for url : " + url); instream = new GZIPInputStream(instream); } return instream; } } catch (IllegalStateException e) { throw new DownloadException(e); } catch (IOException e) { throw new DownloadException(e); } return null; }