当前位置: 首页>>代码示例>>Java>>正文


Java LogUtils类代码示例

本文整理汇总了Java中com.lidroid.xutils.util.LogUtils的典型用法代码示例。如果您正苦于以下问题:Java LogUtils类的具体用法?Java LogUtils怎么用?Java LogUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LogUtils类属于com.lidroid.xutils.util包,在下文中一共展示了LogUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decodeSampledBitmapFromResource

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId, BitmapSize maxSize, Bitmap.Config config) {
    synchronized (lock) {
        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        options.inPurgeable = true;
        options.inInputShareable = true;
        BitmapFactory.decodeResource(res, resId, options);
        options.inSampleSize = calculateInSampleSize(options, maxSize.getWidth(), maxSize.getHeight());
        options.inJustDecodeBounds = false;
        if (config != null) {
            options.inPreferredConfig = config;
        }
        try {
            return BitmapFactory.decodeResource(res, resId, options);
        } catch (Throwable e) {
            LogUtils.e(e.getMessage(), e);
            return null;
        }
    }
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:21,代码来源:BitmapDecoder.java

示例2: decodeSampledBitmapFromFile

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
public static Bitmap decodeSampledBitmapFromFile(String filename, BitmapSize maxSize, Bitmap.Config config) {
    synchronized (lock) {
        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        options.inPurgeable = true;
        options.inInputShareable = true;
        BitmapFactory.decodeFile(filename, options);
        options.inSampleSize = calculateInSampleSize(options, maxSize.getWidth(), maxSize.getHeight());
        options.inJustDecodeBounds = false;
        if (config != null) {
            options.inPreferredConfig = config;
        }
        try {
            return BitmapFactory.decodeFile(filename, options);
        } catch (Throwable e) {
            LogUtils.e(e.getMessage(), e);
            return null;
        }
    }
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:21,代码来源:BitmapDecoder.java

示例3: decodeSampledBitmapFromDescriptor

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
public static Bitmap decodeSampledBitmapFromDescriptor(FileDescriptor fileDescriptor, BitmapSize maxSize, Bitmap.Config config) {
    synchronized (lock) {
        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true; // 只读头信息
        options.inPurgeable = true;
        options.inInputShareable = true;
        BitmapFactory.decodeFileDescriptor(fileDescriptor, null, options);
        //这个就是图片压缩倍数的参数
        options.inSampleSize = calculateInSampleSize(options, maxSize.getWidth(), maxSize.getHeight());
        options.inJustDecodeBounds = false;
        if (config != null) {
            options.inPreferredConfig = config;
        }
        try {
            return BitmapFactory.decodeFileDescriptor(fileDescriptor, null, options);
        } catch (Throwable e) {
            LogUtils.e(e.getMessage(), e);
            return null;
        }
    }
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:22,代码来源:BitmapDecoder.java

示例4: decodeSampledBitmapFromByteArray

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
public static Bitmap decodeSampledBitmapFromByteArray(byte[] data, BitmapSize maxSize, Bitmap.Config config) {
    synchronized (lock) {
        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        options.inPurgeable = true;
        options.inInputShareable = true;
        BitmapFactory.decodeByteArray(data, 0, data.length, options);
        options.inSampleSize = calculateInSampleSize(options, maxSize.getWidth(), maxSize.getHeight());
        options.inJustDecodeBounds = false;
        if (config != null) {
            options.inPreferredConfig = config;
        }
        try {
            return BitmapFactory.decodeByteArray(data, 0, data.length, options);
        } catch (Throwable e) {
            LogUtils.e(e.getMessage(), e);
            return null;
        }
    }
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:21,代码来源:BitmapDecoder.java

示例5: initDiskCache

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
/**
 * Initializes the disk cache.  Note that this includes disk access so this should not be
 * executed on the main/UI thread. By default an ImageCache does not initialize the disk
 * cache when it is created, instead you should call initDiskCache() to initialize it on a
 * background thread.
 */
public void initDiskCache() {
    // Set up disk cache
    synchronized (mDiskCacheLock) {
        if (globalConfig.isDiskCacheEnabled() && (mDiskLruCache == null || mDiskLruCache.isClosed())) {
            File diskCacheDir = new File(globalConfig.getDiskCachePath());
            if (diskCacheDir.exists() || diskCacheDir.mkdirs()) {
                long availableSpace = OtherUtils.getAvailableSpace(diskCacheDir);
                long diskCacheSize = globalConfig.getDiskCacheSize();
                diskCacheSize = availableSpace > diskCacheSize ? diskCacheSize : availableSpace;
                try {
                    mDiskLruCache = LruDiskCache.open(diskCacheDir, 1, 1, diskCacheSize);
                    mDiskLruCache.setFileNameGenerator(globalConfig.getFileNameGenerator());
                    LogUtils.d("create disk cache success");
                } catch (Throwable e) {
                    mDiskLruCache = null;
                    LogUtils.e("create disk cache error", e);
                }
            }
        }
    }
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:28,代码来源:BitmapCache.java

示例6: getColumnGetMethod

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
public static Method getColumnGetMethod(Class<?> entityType, Field field) {
    String fieldName = field.getName();
    Method getMethod = null;
    if (field.getType() == boolean.class) {
        getMethod = getBooleanColumnGetMethod(entityType, fieldName);
    }
    if (getMethod == null) {
        String methodName = "get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
        try {
            getMethod = entityType.getDeclaredMethod(methodName);
        } catch (NoSuchMethodException e) {
            LogUtils.d(methodName + " not exist");
        }
    }

    if (getMethod == null && !Object.class.equals(entityType.getSuperclass())) {
        return getColumnGetMethod(entityType.getSuperclass(), field);
    }
    return getMethod;
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:21,代码来源:ColumnUtils.java

示例7: getColumnSetMethod

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
public static Method getColumnSetMethod(Class<?> entityType, Field field) {
    String fieldName = field.getName();
    Method setMethod = null;
    if (field.getType() == boolean.class) {
        setMethod = getBooleanColumnSetMethod(entityType, field);
    }
    if (setMethod == null) {
        String methodName = "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
        try {
            setMethod = entityType.getDeclaredMethod(methodName, field.getType());
        } catch (NoSuchMethodException e) {
            LogUtils.d(methodName + " not exist");
        }
    }

    if (setMethod == null && !Object.class.equals(entityType.getSuperclass())) {
        return getColumnSetMethod(entityType.getSuperclass(), field);
    }
    return setMethod;
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:21,代码来源:ColumnUtils.java

示例8: decodeSampledBitmapFromDescriptor

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
public static Bitmap decodeSampledBitmapFromDescriptor(FileDescriptor fileDescriptor, BitmapSize maxSize, Bitmap.Config config) {
    synchronized (lock) {
        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        options.inPurgeable = true;
        options.inInputShareable = true;
        BitmapFactory.decodeFileDescriptor(fileDescriptor, null, options);
        options.inSampleSize = calculateInSampleSize(options, maxSize.getWidth(), maxSize.getHeight());
        options.inJustDecodeBounds = false;
        if (config != null) {
            options.inPreferredConfig = config;
        }
        try {
            return BitmapFactory.decodeFileDescriptor(fileDescriptor, null, options);
        } catch (Throwable e) {
            LogUtils.e(e.getMessage(), e);
            return null;
        }
    }
}
 
开发者ID:android-quick-dev,项目名称:AndroidDevFramework,代码行数:21,代码来源:BitmapDecoder.java

示例9: BookDownloadManager

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
public BookDownloadManager(Context appContext) {
	FileUtils fileUtils = new FileUtils(appContext);
	bookSavePath = fileUtils.getStorageDirectory();
	// ColumnConverterFactory.registerColumnConverter(HttpHandler.State.class,
	// new HttpHandlerStateConverter());
	mContext = appContext;
	db = DbUtils.create(mContext, "Book");
	db.configAllowTransaction(true);
	try {
		downloadInfoList = (ArrayList<BookDownloadInfo>) db
				.findAll(BookDownloadInfo.class);
	} catch (DbException e) {
		LogUtils.e(e.getMessage(), e);
	}
	if (downloadInfoList == null) {
		downloadInfoList = new ArrayList<BookDownloadInfo>();
	}
}
 
开发者ID:justingboy,项目名称:CouldBooks,代码行数:19,代码来源:BookDownloadManager.java

示例10: onLoading

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
@Override
public void onLoading(long total, long current, boolean isUploading) {
	HttpHandler<File> handler = BookDownloadInfo.getHandler();
	if (handler != null) {
		BookDownloadInfo.setState(handler.getState());
	}
	BookDownloadInfo.setFileLength(total);
	BookDownloadInfo.setProgress(current);
	try {
		db.saveOrUpdate(BookDownloadInfo);
	} catch (DbException e) {
		LogUtils.e(e.getMessage(), e);
	}
	if (baseCallBack != null) {
		baseCallBack.onLoading(total, current, isUploading);
	}
}
 
开发者ID:justingboy,项目名称:CouldBooks,代码行数:18,代码来源:BookDownloadManager.java

示例11: onLoading

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
@Override
public void onLoading(long total, long current, boolean isUploading) {
    HttpHandler<File> handler = downloadInfo.getHandler();
    if (handler != null) {
        downloadInfo.setState(handler.getState());
    }
    downloadInfo.setFileLength(total);
    downloadInfo.setProgress(current);
    try {
        db.saveOrUpdate(downloadInfo);
    } catch (DbException e) {
        LogUtils.e(e.getMessage(), e);
    }
    if (baseCallBack != null) {
        baseCallBack.onLoading(total, current, isUploading);
    }
}
 
开发者ID:Frank-Zhu,项目名称:AndroidAppCodeFramework,代码行数:18,代码来源:DownloadManager.java

示例12: getJsonByUrl

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
/**
 * GET请求
 * @param str 请求地址
 * @return json数据
 */
public static String getJsonByUrl(String str){
	String url = "http://"+ Params.ipAddress + str;
	try {
		ResponseStream responseStream = httpUtils.sendSync(HttpMethod.GET,url);
		LogUtils.i("StatusCode :"+responseStream.getStatusCode());
		if(responseStream.getStatusCode()==200){
			return responseStream.readString(); 
		}
	} catch (Exception e) {
		e.printStackTrace();
		LogUtils.i(e.getMessage());
		return null;
	}
	return null;
}
 
开发者ID:384401056,项目名称:itheima,代码行数:21,代码来源:HttpTools.java

示例13: postImgFile

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
/**
 * 上传图片
 * @param str 请求地址
 * @param list 图片文件对象列表
 * @return
 */
public static int postImgFile(String str,List<File> list){
	for(File event: list){
		String url = "http://"+ Params.ipAddress + str;
		try {
			RequestParams params = new RequestParams("UTF-8");
			params.addBodyParameter("file", new File(event.getPath()));
			ResponseStream responseStream = httpUtils.sendSync(HttpMethod.POST, url, params);
			if(responseStream.getStatusCode()==200){
				LogUtils.i(responseStream.readString());
			}
		} catch (Exception e) {
			e.printStackTrace();
			return 0;
		}
	}
	return 1;
}
 
开发者ID:384401056,项目名称:itheima,代码行数:24,代码来源:HttpTools.java

示例14: initUsbMuxd

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
public void initUsbMuxd(final Context context){
    if(!RootTools.isProcessRunning(usbmuxdd)){
        IDeviceHelper.getInstance().installBinary(context);

        CommandCapture command = new CommandCapture(0,
                exportLib(context),
                getBinPath(context, usbmuxdd + " -v")){
            @Override
            protected void output(int id, String line) {
                super.output(id, line);
                LogUtils.e(line);
            }
        };
        runCommand(command);
    }else{
        LogUtils.e("usbmuxd is running...");
    }
}
 
开发者ID:olunx,项目名称:xMan,代码行数:19,代码来源:IDeviceHelper.java

示例15: getDeviceId

import com.lidroid.xutils.util.LogUtils; //导入依赖的package包/类
public StringBuffer getDeviceId(final Context context){
    final StringBuffer sb = new StringBuffer();
    CommandCapture command = new CommandCapture(0,
            exportLib(context),
            getBinPath(context, ideviceid + " -l")){
        @Override
        protected void output(int id, String line) {
            super.output(id, line);
            sb.append(line);
            sb.append("\n");
        }
    };
    runCommand(command);
    LogUtils.e(sb.toString());
    return sb;
}
 
开发者ID:olunx,项目名称:xMan,代码行数:17,代码来源:IDeviceHelper.java


注:本文中的com.lidroid.xutils.util.LogUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。