Log w - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Log w method.

This code example shows how to use the following methods:w, getMessage
	File f = new File(path, "temp_image.jpg");
	if (f.exists() == false) {
	    try { 
		f.createNewFile();
	    } catch (IOException e) {
		Log.w(TAG, e.getMessage(), e);
	    } 
	} 
	return f;
    } 
 
    public static File getAppCacheDir(Context context) {
	return new File(String.format(SDCARD_FOLDER_CACHE, context.getPackageName()));
    } 
 
    public static boolean hasImageCaptureBug() { 
	// list of known devices that have the bug 
	ArrayList<String> devices = new ArrayList<String>();
	devices.add("android-devphone1/dream_devphone/dream");
	devices.add("generic/sdk/generic");
7
CodeRank
This code example shows how to use the following methods:w, toString
            totalNumberOfFrame = mEndFrameNo - mStartFrameNo;
            avgFrameRate = getAverageFrameRate(totalNumberOfFrame, mDuration);
            writer.write(String.format("%s:%.2f\n",mTestCaseName,avgFrameRate));
            writer.close();
        } catch (IOException e) {
            Log.w(TAG, "Can't write sdcard log file", e);
        } finally { 
            try { 
                if (writer != null) writer.close();
            } catch (IOException e) {
                Log.e(TAG, "IOException " + e.toString());
            } 
        } 
    } 
 
    // Parse the output of the surfaceFlinge shell command call 
    private String getNumberOfFrames(String input){
        String noOfFrames = null;
        Matcher m = NO_OF_FRAMES_PATTERN.matcher(input);
        if (m.matches()){
6
CodeRank
This code example shows how to use the following methods:w, toString
            writer = new FileWriter(LOG_FILE, true); // true = append
            totalNumberOfFrame = sEndFrameNo - sStartFrameNo;
            avgFrameRate = getAverageFrameRate(totalNumberOfFrame, sDuration);
            writer.write(String.format("%s:%.2f\n", sTestCaseName, avgFrameRate));
        } catch (IOException e) {
            Log.w(TAG, "Can't write sdcard log file", e);
        } finally { 
            try { 
                if (writer != null)
                    writer.close();
            } catch (IOException e) {
                Log.e(TAG, "IOException " + e.toString());
            } 
        } 
    } 
 
    // Parse the output of the dumpsys shell command call 
    private String getNumberOfFrames(BufferedReader reader) throws IOException {
        String noOfFrames = null;
        String line = null;
6
CodeRank
This code example shows how to use the following methods:e, getMessage
		Log.e(TAG, e.getMessage(), e);
	} 
 
	@Override 
	public void onMalformedURLException(MalformedURLException e, final Object state) {
		Log.e(TAG, e.getMessage(), e);
	} 
} 
8
CodeRank
This code example shows how to use the following methods:d, getMessage
        try { 
            file = new RandomAccessFile(imagePath, "r");
            return BitmapFactory.decodeFileDescriptor(file.getFD(), null,
                    options);
        } catch (IOException e) {
            Log.d(TAG, e.getMessage(), e);
            return null; 
        } finally { 
            if (file != null)
                try { 
                    file.close();
                } catch (IOException e) {
                    Log.d(TAG, e.getMessage(), e);
                } 
        } 
    } 
 
    /** 
     * Get a bitmap from the image 
     * 
8
CodeRank
This code example shows how to use the following methods:e, getMessage
		FacebookEvents.onPostPublishingFailed(); 
	} 
 
	@Override 
	public void onMalformedURLException(MalformedURLException e, final Object state) {
		Log.e(TAG, e.getMessage(), e);
		FacebookEvents.onPostPublishingFailed(); 
	} 
} 
8
CodeRank
This code example shows how to use the following methods:e
            throw new DataException(e);
        } catch (SAXException e) {
            Log.e(TAG, "SAXException", e);
            throw new DataException(e);
        } catch (IOException e) {
            Log.e(TAG, "IOException", e);
            throw new DataException(e);
        } 
        return parser.mPersonList;
    } 
 
    private static class PersonHandler extends DefaultHandler {
 
        private StringBuilder mSb = new StringBuilder();
        public ArrayList<Person> mPersonList = new ArrayList<Person>();
        public Person mCurrentPerson = null;
 
        @Override 
        public void startElement(String namespaceURI, String localName, String qName,
                Attributes atts) throws SAXException {
7
CodeRank
This code example shows how to use the following methods:e, getMessage
        JSONObject obj = new JSONObject();
        try { 
            obj.put("level", batteryIntent.getIntExtra(android.os.BatteryManager.EXTRA_LEVEL, 0));
            obj.put("isPlugged", batteryIntent.getIntExtra(android.os.BatteryManager.EXTRA_PLUGGED, -1) > 0 ? true : false);
        } catch (JSONException e) {
            Log.e(LOG_TAG, e.getMessage(), e);
        } 
        return obj;
    } 
 
    /** 
     * Updates the JavaScript side whenever the battery changes 
     * 
     * @param batteryIntent the current battery information 
     * @return 
     */ 
    private void updateBatteryInfo(Intent batteryIntent) {
        sendUpdate(this.getBatteryInfo(batteryIntent), true);
    } 
 
7
CodeRank
This code example shows how to use the following methods:d, getMessage
        try { 
            file = new RandomAccessFile(imagePath, "r");
            return BitmapFactory.decodeFileDescriptor(file.getFD(), null,
                    options);
        } catch (IOException e) {
            Log.d(TAG, e.getMessage(), e);
            return null; 
        } finally { 
            if (file != null)
                try { 
                    file.close();
                } catch (IOException e) {
                    Log.d(TAG, e.getMessage(), e);
                } 
        } 
    } 
 
    /** 
     * Get size of image 
     * 
7
CodeRank
This code example shows how to use the following methods:e, getMessage
        // Forbidden being instantiated. 
    } 
 
    // FIXME: need to optimize this method. 
    private static boolean isLowMemory(SQLiteException e) {
        return e.getMessage().equals(SQLITE_EXCEPTION_DETAIL_MESSAGE);
    } 
 
    public static void checkSQLiteException(Context context, SQLiteException e) {
        if (isLowMemory(e)) {
            Toast.makeText(context, "Low Memory",
                    Toast.LENGTH_SHORT).show();
        } else { 
            throw e;
        } 
    } 
 
    public static Cursor query(Context context, ContentResolver resolver, Uri uri,
            String[] projection, String selection, String[] selectionArgs, String sortOrder) {
        try { 

6
CodeRank

Related Log w Questions & Answers:

Other Log w Examples

15:	      int[] appWidgetIds) {
16:	
17:	    Log.w(LOG, "onUpdate method called");
18:	    // Get all ids
19:	    ComponentName thisWidget = new ComponentName(context,

Read More

w Method Overview
See Code Examples for other Android Log Methods: