自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 问答 (2)
  • 收藏
  • 关注

原创 Android把uri图片转为bitmap

直接粘贴就能用 private Bitmap ImageSizeCompress(Uri uri){ InputStream Stream = null; InputStream inputStream = null; try { //根据uri获取图片的流 inputStream = getContentResolver().openInputStream(uri); BitmapF

2021-03-12 14:44:58 3641 4

原创 Base64与bitmap之间相互转换

bitmap转Base64 public static String Bitmap2StrByBase64(Activity activity,Bitmap bit){ ByteArrayOutputStream bos=new ByteArrayOutputStream(); bit.compress(Bitmap.CompressFormat.JPEG, 40, bos);//参数100表示不压缩 byte[] bytes=bos.toByteArray

2021-07-08 17:35:03 2126

原创 安卓调用系统复制

注意只能复制文字不能复制图片,并可以复制到其他ip中 //复制 private void copy(String data) { // 获取系统剪贴板 ClipboardManager clipboard = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE); // 创建一个剪贴数据集,包含一个普通文本数据条目(需要复制的数据),其他的还有

2021-07-01 16:28:05 236

转载 drawable 转String

//直接拿来直接用就ok了 public synchronized String drawableToByte(Drawable drawable) { if (drawable != null) { Bitmap bitmap = Bitmap .createBitmap( drawable.getIntrinsicWidth(),

2021-07-01 11:56:53 293

转载 安卓逆向反编译

网上找的自己用了很好用 APKTOOLhttps://blog.csdn.net/ysc123shift/article/details/52985435

2021-06-20 16:57:37 93

原创 Android开发EventBus传值

简单的EvenBus传值//发送数据EventBus.getDefault().post(MessageWrap.getInstance(“要传的值默认String类型”));//EventBus注册在要接收的界面注册 EventBus.getDefault().register(this);//接收数据 @Subscribe(threadMode = ThreadMode.MAIN) public void GetMessage(MessageWrap message) {

2021-05-10 17:07:16 307

原创 Android读取手机上所有APP列表

可以读取APP包名,名字,icon图片,大家有需要直接粘贴就可以用 Intent intent = new Intent(); intent.setAction(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); PackageManager packageManager = getPackageManager(); List<ResolveInfo&

2021-03-12 15:00:57 1394

原创 Android为桌面创建快捷方式

最近公司让写一个可以给对应的APP创建对应的快捷方式的需求,网上搜了很多都是12年左右的,但是好像都不能用,下面有一篇,自测可以用,希望可以帮助到大家 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { ShortcutManager shortcutManager = (ShortcutManager)context.getSystemService(Context.SHORTCUT_SERVI

2021-03-12 14:55:56 219

转载 Android区分应用在前台还是后台运行

public static boolean isBackground(Context context) { ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); List<ActivityManager.RunningAppProcessInfo> appProcesses = activityManager

2021-02-26 11:02:30 286

转载 Android实现switchbutton选择器效果

在builder.gradle中引用第三方的类库:implementation 'com.github.zcweng:switch-button:0.0.3@aar'2.在xml中可以直接使用switchbutton控件,并且有多种颜色和效果选择:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" androi.

2021-02-01 15:36:28 653

原创 Android对已有APK进行分包并重新签名

用压缩文件打开自己要分包的apk在里面进行修改(分包需要换的东西比如渠道号,key等)修改完以后在压缩文件里面进行保存,一般都会自动保存,否则会出现问题保存完以后进行重新签名首先先打开cmd黑窗口在cmd里面进行重新签名jarsigner -verbose -keystore test.keystore -signedjar signed.apk MyAPK.apk mykeystore2.显示已签名说明已经签名完成jar 已签名。说明test.keystore 自己的签名.

2021-02-01 15:08:40 321 2

原创 Android引导用户打开位置权限

Android引导用户打开位置权限直接上代码吧,直接就可以用 private void initView() { LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); if (locationManager.isProviderEnabled(locationManager.GPS_PROVIDER)){

2021-02-01 14:41:22 1403

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除