Xutils3网络请求的封装详解
封装了一个Xutil3的网络请求工具类,分享给大家,本人水平有限,不足之处欢迎指出。
使用前先配置xutils3:
1.gradle中添加
compile 'org.xutils:xutils:3.3.40'
2.自定义Application
/**
* Created by Joe on 2016/9/25.
*/
public class MyApp extends Application {
Override
public voi
代码如下:public class CommonUtil {
public static boolean hasSDCard() {
String status = Environment.getExternalStorageState(); return status.equals(Environment.MEDIA_MOUNTED); }
/** * 获取最大内存 * * return */ public static long getMaxMemory() {
re