自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(41)
  • 收藏
  • 关注

原创 Retrofit基本使用

1.在Build.Gradle中导入Retorfit的第三方依赖implementation 'com.squareup.retrofit2:retrofit:2.9.0'//更高版本请在Github上查看2.创建接口import okhttp3.ResponseBody;import retrofit2.Call;import retrofit2.http.Field;import retrofit2.http.FormUrlEncoded;import retrofit2.ht

2022-03-15 17:16:25 5438

原创 带进度条的Webview

public class ProgressWebView extends WebView { private ProgressBar mProgressBar; public ProgressWebView(Context context, AttributeSet attrs) { super(context, attrs); mProgressBar = new ProgressBar(context, null, ...

2022-03-09 11:27:46 178

原创 Android获取汉字首字母工具类

1.使用方法 String s=GetChineseFirstUtil.getSpells("你");2.工具类代码:import java.io.UnsupportedEncodingException;public class GetChineseFirstUtil { static final int GB_SP_DIFF = 160; static final int[] secPosValueList = { 1601, 1637, 1833, 2078, 2

2022-03-04 10:52:10 740 1

原创 EditText密码的可见与不可见

直接设置InputType是不可行的。需要用这个binding.userpassword.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); binding.userpassword.setTransformationMethod(PasswordTransformationMethod.getInstance());

2022-03-01 13:53:27 182

原创 保存bitmap到手机相册

前提是要获取到读写权限。private void saveBitmap(Bitmap bitmap) { String extStorageDirectory = Environment.getExternalStorageDirectory().toString(); OutputStream outStream = null; String filename;//声明文件名 //以保存时间为文件名 Date date

2022-02-08 15:05:28 777

原创 获取抖音账户的UserID

抖音网页版(退出自己的账户下) 搜索你想要的用户,点击主页。按F12,搜索secUid,secUid前边的数字就是,比如222076343312853806,今年是2022年,去掉22就是userid2076343312853806

2022-01-21 10:29:17 7739 4

原创 RMT-Relax APP隐私政策

隐私政策本政策仅适用于RMT-Relax产品及服务。更新日期:2021年12月14日生效日期:2021年12月14日RMT-Relax APP尊重并保护所有使用服务用户的个人隐私权。为了给您提供更准确、更有个性化的服务,RMT-Relax APP会按照本隐私权政策的规定使用和披露您的个人信息。但RMT-Relax APP将以高度的勤勉、审慎义务对待这些信息。除本隐私权政策另有规定外,在未征得您事先许可的情况下,RMT-Relax APP不会将这些信息对外披露或向第三方提供。RMT-Relax

2022-01-07 10:13:11 132

原创 Intent跳转指定APP和跳转浏览器

转载至【Android】在App内打开链接跳转到淘宝/天猫店铺页 - 简书1.判断手机上是否安装了淘宝/天猫App淘宝应用包名:com.taobao.taobao天猫应用包名:com.tmall.wireless判断方法: /** * 检查手机上是否安装了指定的软件 * * @param context context * @param pkgName 应用包名 * @return true:已安装;false:未安装 */ .

2021-12-31 09:21:55 1685

原创 Android加了动画不返回?加上这一句

在你的Theme里加上<item name="android:windowAnimationStyle">@android:style/Animation.Activity</item>

2021-12-22 09:53:00 1374

原创 OnTouchEvent检测手势放大缩小。

先在顶部: private double nLenStart = 0;后 int nCnt = event.getPointerCount(); if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_POINTER_DOWN && 2 == nCnt) { int xlen = Math.abs((int) event.

2021-12-17 15:02:23 317

原创 拼接合并两个byte数组

public static byte[] addBytes(byte[] data1, byte[] data2) { byte[] data3 = new byte[data1.length + data2.length]; System.arraycopy(data1, 0, data3, 0, data1.length); System.arraycopy(data2, 0, data3, data1.length, data2.length); re.

2021-12-08 14:41:06 1533

原创 拍照和保存图片

private void openCamera(){ File outputImage = new File(getExternalCacheDir(),getnormalmac(dev_mac)+".jpg"); try { if(outputImage.exists()){ outputImage.delete(); } outputImage.createNewFile(); } catch (IOEx..

2021-11-23 09:51:33 1577

原创 安卓蓝牙发送数据总是丢包?

记得在writecharacteristic.setValue(data);之后,data是那个byte数组加上这句话writecharacteristic.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE);如果加上这句话没反应,那就切换WRITE_TYPE。在BluetoothGattCharacteristic这个类里有三种,都试试就可以了。...

2021-11-19 17:16:08 2730

原创 防止多个按键同时按

在style里添加 <item name="android:splitMotionEvents">false</item>

2021-11-15 11:01:16 1452

原创 自定义AlertDialog

AlertDialog.Builder builder=new AlertDialog.Builder(this);builder.setView(R.layout.alertdialog_location_layout);builder.setCancelable(false);AlertDialog alertDialog = builder.create();alertDialog.show();alertDialog.getWindow().setBackgroundDrawableRe.

2021-11-09 09:13:26 1364

原创 Kotlin 笔记(四)

1.Kotlin语言的继承与重载的open关键字学习//所有的类,默认都是final修饰的,不能被继承和Java相反//open移除final修饰open class Person(private val name:String){ private fun showName()="人的姓名是【$name】" //Kt所有的函数,默认都是final修饰的 open fun myPrintln()=println(showName())}class Student(priv

2021-11-01 16:13:53 735

原创 Kotlin 笔记(三)

1.Kotlin语言的takeUnless内置函数//takeIf 和takeUnless 功能是相反的//name.takeIf {true/false} true返回本身 false返回null//name.takeUnless {true/false} true返回null false返回本身class Manager{ private var infoValue:String?=null fun getInfoValue()=infoValue fun setIn

2021-10-29 16:55:30 809

原创 Kotlin 笔记(二)

1.匿名函数的调用fun main(){ //获取整个字符串的长度 val length='Derry'.count() println(len) //结果是5 //获取r的长度(字符串里有几个r),匿名函数为“{}”所包含的 val len2="Derry".count(){ //count可以拿到"Derry"中的每一个字符赋值给it it == 'r' } println(len2) //结果是2}2.隐式返回参数fun

2021-10-27 16:13:29 1005

原创 Kotlin 笔记 (一)

1.初的认识fun main(){ println("hello world") //声明变量 //可读可改 变量名 类型 值 var name :String ="Derry" name="Lance" println(name) }2.数据类型 String 字符串 Char 单字符 Boolean 逻辑 Int 整形 D

2021-10-27 14:23:29 201

原创 Kotlin KTX 扩展库

1.SharedPreferences KTX扩展库getSharedPreferences("data", Context.MODE_PRIVATE).edit { putString("name", "Tom") putInt("age", 28) putBoolean("married", false)}2.ContentValues KTX扩展库val values = contentValuesOf("name" to "Game of Thrones", "author

2021-10-27 09:44:56 174

转载 ViewBinding 在自定义View中使用(Kotlin)

使用Binding.bind 方法。val root = View.inflate(context, R.layout.widget_core, this)binding = WidgetCoreBinding.bind(root)

2021-10-25 11:04:10 2531

原创 RecyclerView动态添加点击事件

Beanpackage com.me.recyclerviewtest;public class Bean { private String name; public Bean() { } public String getName() { return name; } public void setName(String name) { this.name = name; }}ListAdapt

2021-10-18 10:31:27 163

原创 AlertDiaglod和MaterialAlertDialog

仅供作者自己参考,勿喷。 if(view.equals(binding.btn1)){ AlertDialog alertDialog=new AlertDialog.Builder(MainActivity.this).create(); alertDialog.setIcon(R.drawable.ic_launcher_background); alertDialog.setTitle("哈哈"); alertDialog.set..

2021-10-13 14:23:52 202

原创 好用的安卓开源控件

NumberPickerGitHub - ShawnLin013/NumberPicker: The android library that provides a simple and customizable NumberPicker.

2021-09-28 09:12:30 124

原创 安卓隐私政策高亮点击

SpannableString spanString = new SpannableString(context.getString(R.string.list_read_dis_content));UnderlineSpan span2 = new UnderlineSpan(); spanString.setSpan(span2, 3, 12, Spannable.SPAN_EXCLUSIVE_INCLUSIVE); ClickableSpan clickableSpan=new C.

2021-09-16 14:04:14 63

原创 小米MIUI或其他手机黑暗深色模式部分控件失效无效

本人是初级安卓开发者。平时都是用小米6开发,最近在写一个带有深色模式的APP。mipmap放白色的图片资源,mipmap-night放暗色的图片。运行后,发现在小米6手机上运行正常。后来运行在小米11想看看大屏的效果。殊不知使用Context.getColor(R.xxx.xxxxxx)方法获取的颜色在深色模式下发生了频闪,我以为是MIUI的BUG然后进入另一个界面,我惊了。按键全部是白色模式下,没有发生变化。好奇的我拿同事的华为,VIVO,都试了试可以正常变色。怎么小米11就不行了,后

2021-09-11 17:16:50 2407

原创 AnimationDrawable使用简介

Drawable animation可以加载Drawable资源实现帧动画。AnimationDrawable是实现Drawable animations的基本类。推荐用XML文件的方法实现Drawable动画,不推荐在代码中实现。这种XML文件存放在工程中res/drawable/目录下。XML文件的指令(即属性)为动画播放的顺序和时间间隔。 在XML文件中<animation-list>元素为根节点,<item>节点定义了每一帧,表示一个drawable资源的帧和帧间...

2021-09-10 10:06:09 163

原创 通用Dialog style

<style name="dialogStyleBottom" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowFrame">@null</item> <!-- 边框 --> <item name="android:windowIsFloating">false</item> <!-- 是否浮现在activ.

2021-09-07 10:13:25 250

原创 Activity从底部进入,由上而下返回,解决跳转黑屏

在R.anim中创建in.xml,out.xmlin.xml<?xml version="1.0" encoding="utf-8"?><set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:duration="300" android:fromXDelta="0" android:fromYDelt

2021-09-03 10:03:02 267

原创 透明Dialog

<style name="dialog" parent="@android:style/Theme.Dialog"> <item name="android:windowFrame">@null</item> <item name="android:windowIsFloating">true</item> <item name="android:windowIsTranslucent"&gt...

2021-09-02 15:11:48 53

原创 ZoomImg

public static Bitmap zoomImg(Bitmap bm, int newWidth , int newHeight){ // 获得图片的宽高 int width = bm.getWidth(); int height = bm.getHeight(); // 计算缩放比例 float scaleWidth = ((float) newWidth) / width; float scaleHeight = ((float) newHeig.

2021-08-19 10:35:36 118

原创 RMT-Relax隐私政策

隐私政策 本软件尊重并保护所有使用服务用户的个人隐私权,为了给您提供更准确,更有个性化的服务,本软件会按照本隐私权政策的规定使用和披露您的个人信息。但本软件将以高度的勤勉、审慎义务对待这些信息。除本隐私权政策另有规定,在未征得您事先许可的情况下,本软件不会将这些信息对外披露或向第三方提供。本软件会不时更新本隐私权政策。您在同意本软件服务使用协议之时,即视为您已经同意本隐私权政策全部内容,本隐私权政策属于本软件服务使用协议不可分割的一部分。 1.适用范围a)在您使用本软件网络服...

2021-08-03 09:51:51 176

原创 跳转到应用的权限设置页面

public static void gotoAppDetailIntent(Activity activity) { Intent intent = new Intent(); intent.setAction(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.setData(Uri.parse("package:" + activity.getPackageNam...

2021-06-17 09:57:00 598

原创 慕岩传动隐私政策

本软件尊重并保护所有使用服务用户的个人隐私权,为了给您提供更准确,更有个性化的服务,本软件会按照本隐私权政策的规定使用和披露您的个人信息。但本软件将以高度的勤勉、审慎义务对待这些信息。除本隐私权政策另有规定,在未征得您事先许可的情况下,本软件不会将这些信息对外披露或向第三方提供。本软件会不时更新本隐私权政策。您在同意本软件服务使用协议之时,即视为您已经同意本隐私权政策全部内容,本隐私权政策属于本软件服务使用协议不可分割的一部分。\n1.适用范围\na)在您使用本软件网络服务,本软件自动接收并记...

2021-06-07 17:57:12 162

原创 慕岩传动技术支持网址(URL)

如果您在使用过程中有问题请留言或发邮件我。邮箱地址:[email protected]谢谢!If you have any questions, please leave a message or send me an email.Email:[email protected]————————————————版权声明:本文为CSDN博主「qq_37153603」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。原文链接:https://blog.cs

2021-06-07 17:55:15 155

原创 Android沉浸式状态栏

private void fullScreen(Activity activity) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { //5.x开始需要把颜色设置透明,否则导航栏会呈现系统默认的浅灰色 .

2021-05-24 14:18:02 45

原创 jcenter(),google()导入项目后编译不过?加上这三句话

uildscript { repositories {// jcenter()// google() maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' } maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven{ url 'http:.

2021-05-17 14:42:36 296

原创 安卓蓝牙设置接收订阅通知断开第二次连接不上或者自动断开status=8的解决办法。

最近在做蓝牙开发,发现订阅蓝牙通知后,第二次连接会出现连接不上的情况,BluetoothGattCharacteristic notifycharacteristic = service.getCharacteristic(GetDataUtils.characterReadUUID);//GetDataUtils.characterReadUUID为我司的订阅通知的UUID,为了方便我起名为read,其实应该起名为notifymBluetoothGatt.setCharacteristicNoti

2021-04-23 09:08:30 1507 2

原创 RMT-Relax Privacy policy

Privacy Policy The Software respects and protects the privacy of all users who use the Services. In order to provide you with a more accurate and personalized service. the Software will use and disclose your personal information in accordance with this.

2021-04-15 16:03:34 84

原创 发布安卓APP遇到三星应用商店发布提示android:debugable=true?

在AndroidManifest.xml中添加android:debugable=false仍然无效解决办法:平时都是直接在AndroidStudio的工具栏Build->Build APK这样是不行的,实际上这样打包以DEBUG方式打包的这时候点击Build->Generate Signed Bundle/APK 重新使用签名打包一个release版本在三星平台上传。release 版本在 你的项目->app->release中...

2021-04-06 14:10:11 370

空空如也

空空如也

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

TA关注的人

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