OKGO是OK HTTP 为底层的第三方
get post 上传都是String泛型 下载为File泛型 可以直接下载推片泛型为BitMap
可以在OKGO里直接更新UI 可以直接获取Progress进度
Gide
三级缓存 内存 sd卡 网络
clearMermoy 清除内存 clearDiskCache 清除sd卡 是一个耗时操作需要在子线程运行
可以加在任何形式的图片 例如Sd卡 网络 动态 视频
加载圆角
Glide.with(getContext()).load(“图片网址”).apply(new RequestOptions().placeholder(R.mipmap.ic_launcher).error(R.mipmap.ic_launcher).bitmapTransform(new RoundedCorners(50))).into(控件);
加载圆形
Glide.with(this)
.load(“网址”).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(控件)
设置占位符和错误图
placeholder error
蓝牙
一种无线传输数据 短距离进行交流的工具
权限
开启蓝牙
Intent intent=new Intent();
intent.setAction(BluetoothAdapter.ACTION_REQUEST_ENABLE);
intent.setAction(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
intent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION,200);
startActivityForResult(intent,100);
关闭蓝牙
manager= (BluetoothManager) getContext().getSystemService(getContext().BLUETOOTH_SERVICE);
adapter = manager.getAdapter();
adapter.disable();