自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(70)
  • 资源 (2)
  • 收藏
  • 关注

原创 常用命令行

Linux 解压缩tar -zcvf 压缩文件名 .tar.gz 被压缩文件名tar -zxvf 压缩文件名.tar.gz查找find . -name "*.in" | xargs grep "thermcontact"

2021-05-19 16:21:22 93

原创 【Android】【Kotlin】Language Learning

ArrayListval arrayList: MutableList<String> = ArrayList()arrayList.add("ADVERTISE_TX_POWER_ULTRA_LOW")arrayList.add("ADVERTISE_TX_POWER_LOW")arrayList.add("ADVERTISE_TX_POWER_MEDIUM")arrayList.add("ADVERTISE_TX_POWER_HIGH")return arrayListval

2022-05-13 16:16:19 527

原创 【NFC】【S32 DS】Warning: Not all breakpoints couldbe written. Continue?

问题:打断点后,运行过程中会有如下提示:初衷是想取消这个提示框。结果:NXP的IDE允许最多打2个断点,如果超过2个断点后,就会弹出Warning提示框,目前解决方法就是减少断点。NXP (well: Freescale) decided to implement only 2 Hardware breakpointsin the L series (ARM Cortex-M0 would allow 1, 2, 3 or 4). So theKinetis L allows you on

2022-05-07 16:50:11 714

原创 【Android】【Repository】Build

Android Studio Version:使用自己的仓库:之前都是在build.gradle中添加:allprojects { repositories { jcenter() maven { url "https://jitpack.io" } maven { url "http://artifactory.xxx" credentials { usernam

2022-05-06 17:29:43 1036

原创 [Raspberry][Python] Command Record

安装npmcurl -sL https://deb.nodesource.com/setup_12.x | sudo bash -sudo apt-get install -y nodejs gcc g++ make pythonnode -vsudo npm i -g npm查看网络端口号,杀死对应进程//提示[Errno 98] Address already in usenetstat -nlp | grep :端口号ps -fA | grep pythonkill -9 pid

2022-05-06 09:43:29 363

原创 【Cloud】AWS Cognito Authentication

Amazon Cognito is an Amazon Web Services product that controls user authentication and access for mobile applications on internet-connected devices.Android example:添加AWS的库依赖: //AWS implementation ("com.amazonaws:aws-android-sdk-iot:$aws_version")

2022-04-01 14:14:30 2266

转载 【Android】【UI】使用 Image Asset Studio 创建应用图标

参考链接:Create app icons with Image Asset Studio

2022-03-29 16:58:49 229

原创 【Android】获取控件坐标值

获取手指触摸点的坐标 binding.view.setOnTouchListener { _, motionEvent -> if(motionEvent.action == MotionEvent.ACTION_MOVE) { binding.textShow.text = "x: " + motionEvent.x + " ,y: " + motionEvent.y } .

2022-03-29 16:56:16 3826

原创 【Android】屏幕适配

带着疑问学习:drawable, drawable-mdpi, drawable-hdpi, drawable-xhdpi, drawable-xxhdpi, drawable-xxxhdpi是什么意思?同样的图片放在不同的目录下,会有什么效果差异?内存是否会有影响在10802400下调整好的布局,到10801920下会被堆积,如何处理?dp值对不同分辨率手机的效果影响相关概念:屏幕尺寸手机屏幕对角线的物理尺寸。单位英寸(inch),一英寸大约 2.54cm。常见的手机屏幕尺寸有 4.7

2022-03-28 09:44:22 4004

原创 【Android】内存泄漏

现象:通过AndroidStudio的Profiler工具,抓取堆栈信息后,得到内存泄漏的反馈只知道是哪个文件泄漏了,但不知道什么原因导致的泄漏。什么是内存泄漏?一个对象用完后被毁掉了,但是他的引用还在,导致GC无法回收此对象占用的内存,于是导致内存泄漏。A memory leak occurs when an object’s reference is held on to after its purpose has been served. As a result, this preve

2022-03-25 15:39:05 1459

原创 【Android】【UI】MaterialDesign - Scrolling techniques

一、想要FloatingActionButton在两个layout中间的效果:<?xml version="1.0" encoding="utf-8"?><androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

2022-03-24 15:06:07 133

原创 【Android】【UI】BottomNavigationView 底部icon图标选中状态

设置如下item,当item被选中时,系统会给变更为colorPrimary所设置的颜色。 想取消颜色,而是显示成自己配置的被选中的图片<?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/navigation_home" androi

2022-03-21 14:38:14 2710

转载 【Android】【UI】SVG图片格式

拿到.svg格式文件后,直接放到android目录下是编译不过的。需通过以下方法转换成.xml文件:一. 在Drawable目录下,鼠标右键:二.选择Local file(SVG, PSD)参考链接:说说svg文件在android中的优势

2022-03-21 13:50:50 186

原创 【Android】【UI】EditTextPreference 输入类型限制

androidx之前的EditTextPreference的输入类型可以在 <EditTextPreference android:key="location" android:title="Location (ex: -4db)" android:numeric="signed" android:textColor="#009688" />android:

2022-03-14 13:07:17 2227

原创 【Android】【UI】PreferenceFragmentCompat

想要创建个SettingsFragment, 发现Android Studio有现成的:class SettingsFragment : PreferenceFragmentCompat() { companion object{ val TAG: String = SettingsFragment::class.java.simpleName } override fun onCreatePreferences(savedInstanceState: Bun

2022-03-11 10:20:32 1968

原创 【Android】【UI】AnimationDrawable

<ImageView android:id="@+id/img_flip_up" android:layout_width="50dp" android:layout_height="50dp" android:src="@drawable/flip_up" android:contentDescription="flip_up" />flip_up.xml<?xml version="1.0" encoding="utf-8"?>&l

2022-03-10 13:37:36 1628

原创 【Android】【UI】Text font

在res/font/目录下放.ttf文件(网上找或者印象笔记)在res/font/目录下创建arial.xml<?xml version="1.0" encoding="utf-8"?><font-family xmlns:android="http://schemas.android.com/apk/res/android"> <font android:fontStyle="italic" android:fontWeight=

2022-03-10 13:33:34 109

原创 【Android】【UI】Progress rotate animate

方法一:在drawable目录下创建loading_progress.xml<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <rotate android:drawable="@drawable/loader"

2022-03-09 17:01:18 528

原创 【Android】【UI】Gif Image

implementation files("libs/GifView.jar") <com.ant.liao.GifView android:id="@+id/gif2" android:layout_width="150dp" android:layout_height="150dp" android:layout_centerInParent="true" an

2022-03-09 16:48:48 222

原创 【Android】【UI】状态栏StatusBar

var window = this.window; window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); getWindow().decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; val controller = ViewCompat.getWindow...

2022-03-09 16:35:37 403

原创 【Android】【UI】AbstactFragment

创建一个抽象类的Fragment, 然后子Fragment复用抽象类abstract class AbstactFragment() : Fragment() { val viewModel: AbstactViewModel by inject() private lateinit var binding: AbstactFragmentBinding override fun onCreateView( inflater: LayoutInflater, c

2022-03-09 11:06:07 148

原创 【Android】【UI】屏幕分辨率

手机名称官方公布的分辨率和像素密度和尺寸metrics.widthPixelsmetrics.heightPixelsmetrics2.densitymetrics.densityDpi实际使用的drawableVivo X602376*1080 & 398PPI & 6.56英寸108023763.0480xxhdpiMI 102340*1080 & 386PPI & 6.67英寸108024002.75440xx...

2022-03-08 13:56:36 588

原创 【Android】【UI】图层列表 layer-list

在drawable目录下,鼠标右键,选择New->Drawable Resource File->图片素材如下:<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/issue_polygon" android:grav

2022-03-08 09:37:17 181

原创 【Android】【BLE】L2CAP

通常手机端与蓝牙外设进行BLE连接时,调用如下的API:private BluetoothDevice mDevice;private BluetoothGatt mBluetoothGatt;mBluetoothGatt = mDevice.connectGatt(mContext, false, mGattCallback);private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() { @Ov

2022-02-23 10:39:30 420

原创 【Android】字体设置 Text font

通过android:typeface属性来设置字体: <TextView android:id="@+id/textView15" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Fuel drive" android:textSize="16sp" android:type

2022-02-17 14:44:24 1831

转载 【转载】【Android】Splash animation effect

实现:1.build.gradle中添加库implementation 'com.airbnb.android:lottie:3.4.1'2.将图片放到drawable目录下:将动态json文件放到app\src\main\res\raw目录下3.在布局文件中添加如下: <ImageView android:id="@+id/img" android:layout_width="wrap_content" android:layout

2022-02-15 14:24:42 84

原创 【Android】Exception log print

try {} catch (Exception e) { //e.printStackTrace(); Log.e(LOG_TAG, "Exception: " + Log.getStackTraceString(e));}

2022-02-11 09:14:28 1400

原创 【Android】isServiceRunning

private boolean isServiceRunning() { ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)){ Log.d("Ti...

2022-02-10 09:20:09 1861

原创 BLE5.0 - Long-range mode

Long-range mode (Coded PHY)?https://www.jianshu.com/p/277813a059b1兼容4.2 - 1M PHY更高的通信速率 - 2M PHY更远的通信距离 - 1M CODED PHYAndroid 8.0 Oreo(API LEVEL 26)开始在BLE Manager里增加了5.0BLE相关方法,可以使用下面三个方法来鉴定你的手机对5.0BLE支持到什么程度。isLe2MPhySupported - Return true if LE 2M

2022-02-09 10:49:37 1480

原创 【20220105】ffmpeg

环境:Ubuntu 20.04.2 LTS (GNU/Linux 4.4.0-19041-Microsoft x86_64) - Ubuntu on Windows Subsystem for Linux (WSL)ubuntu下载安装ffmpeg下载$ wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/ffmpeg/7:4.4-6ubuntu5/ffmpeg_4.4.orig.tar.xz解压$ tar -xv

2022-01-06 16:59:06 163

原创 【20220104】BigInteger

对于二进制来说,最高位代表正负号,-0表示-128,+0表示032位系统int型4个字节:-(2的31次方) ~ (2的31次方) 减 1最大负数:10000000 00000000 00000000 00000000最大正数:01111111 11111111 11111111 111111110: 00000000 00000000 00000000 0000000064位系统同理,int型表示范围是:-(2的63次方) ~ (2的63次方) 减 1在Java

2022-01-05 14:41:56 274

原创 【Android】不同android平台的适配(权限和定位)

权限的适配后台定位权限申请ACCESS_BACKGROUND_LOCATION是在Android10之后加上的 private fun askRemoteParkingPermissions() { var permissionList: Array<String> = arrayOf( Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.AC.

2021-12-06 11:21:38 2061

原创 【Android】定时器打印Log

测试手机Xiaomi note3 with Anroid8.0.1Handle定时执行代码:Handler(Looper.getMainLooper()).post(object : Runnable { override fun run() { Utils.appendLog("Handler 10s interval") Handler(Looper.getMainLooper()).postDelayed(this, 10000) }})

2021-12-03 14:12:18 2382

原创 【Android】【后台运行-2】保活设置

参考连接:Android 保活设置适配Android 后台运行白名单,优雅实现保活How to start Power Manager of all android manufactures to enable background and push notification?2019-05-29 Android引导用户开启自启动权限

2021-12-03 09:59:12 438

原创 【Android】【后台运行-1】请求电池优化

先上代码AndroidManifest.xml中申请权限<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>Activity中实现:override fun onCreate(savedInstanceState: Bundle?) { ...... if (!isIgnoringBatteryOptimizations()) { re

2021-11-30 18:01:04 4228

原创 【IDE】【AndroidStudio】.gitignore 不生效的解决方案

将本地的.gradle和.idea目录删除.gitignore文件更新如下:*.iml.gradle/local.properties/.idea/*.DS_Store/build/captures/delivery/local.properties命令窗口执行下列指令git rm -r --cached .git add .git commit -m "[PROJ]:Update gitignore"参考连接:.gitignore 不生效的解决方案...

2021-11-26 10:12:50 496

转载 android利用adb修改手机的分辨率和dpi

在android开发过程中,适配更多的适配是必不可少的一步,而每次测试适配时,要么购买设配,要么模拟器,买设配太花钱,模拟器太占内存,不过幸好还可以通过修改手机的size(分辨率)和density来进行测试进入adb shellwm size 查看分辨率$ wm sizePhysical size: 2560x1600 默认的分辨率wm size 1920x1280 修改分辨率$ wm size 1920x1280 (小写的x)修改分辨率$ wm sizePhysical size: 25

2021-11-23 15:08:17 8841

原创 【Android】release 签名

点击Build Variants中的Active Build Variant中的变量状态,切换到release时,会异常,app处有个红叉,需给App添加签名 signingConfigs { release { keyAlias 'key0' keyPassword 'test' storeFile file('../test.jks') storePassword 'test'

2021-11-23 09:56:28 1598

原创 【Android】生成包名称

生成库文件 buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } libraryVariants.all { variant -> variant.outputs.all {

2021-11-22 16:54:28 1308

原创 【Android】外部文件存储

需要在AndroidManifest.xml的application域中添加以下字段:android:requestLegacyExternalStorage="true"AndroidManifest和PermissionHelp运行中都要申请权限: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="a

2021-11-12 16:43:59 842

ubuntu11.10(64位)虚拟linux系统下 ---修改编译android工程

ubuntu11.10(64位)虚拟linux系统下 ---修改编译android工程 工具是android应用签名app_signa

2012-06-04

android应用签名工具

ubuntu11.10(64位)虚拟linux系统下 ---修改编译android工程(应用签名工具)

2012-06-04

空空如也

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

TA关注的人

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