原创 Android View 跟隨手指移動 最簡單實現方法

話不多說,上代碼: package com.test.movemyview; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; imp

原创 android 讀取指定路徑數據庫文件

private SQLiteDatabase openDatabase() { // String dbFd= "/data"+Environment.getDataDirectory().getAbsolutePat

原创 CentOS7 設置定時重啓

1.編輯配置 vi /etc/crontab 2.設置重啓時間 SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root # For details see man

原创 android 控件拖動並添加歸位動畫

用兩種簡單實現方式: 第一種: relBottom.setOnTouchListener(new View.OnTouchListener() { private int downX;

原创 關於Android Studio 3.5.2 真機調試是一直顯示 xxxx is waiting for the debugger to attach

由於修改Mac 系統的hosts 文件時換行錯誤如下: 127.0.0.1    localhost 255.255.255.255    broadcasthost ::1             localhost  正確修改爲:

原创 Java 隊列式 單線程循序執行 ExecutorService executorService= Executors.newSingleThreadExecutor();

  ExecutorService executorService = Executors.newSingleThreadExecutor(); executorService.execute(new Runnabl

原创 Android Google Play 內購代碼集成 implementation 'com.android.billingclient:billing:2.0.3'

1.引用資源 implementation 'com.android.billingclient:billing:2.0.3' 2.初始化,購買後會回調onPurchasesUpdated 方法 並調用消耗 方法 //ini

原创 android 發佈正式版時用Gradle移除日誌打印代碼(添加混淆配置)

buildTypes { release { //混淆 minifyEnabled true //移除無用的resource文件 shrinkResourc

原创 android 查看apk 簽名信息 和 查看 簽名文件 .jks 信息 命令行

1.查看apk 簽名信息 keytool -printcert -jarfile 你的apk文件路徑 2.查看.jks 文件簽名信息 keytool -list -keystore 你的.jks文件路徑  

原创 android 使用adb 查看 應用內存使用情況

查看連接的設備 adb devices 查看運行的進程 adb shell ps adb -s 設備號 shell ps 查看應用運行情況  adb shell dumpsys meminfo 包名 adb -s 設備號 she

原创 Mac Android Studio3.5.2 keypmap(Mac OS 10.5+) 默認常用快捷鍵使用說明

1.刪除行(Delete Line): Command + Delete 或 Command + Backspace 2.複製行(Duplicate Line or Selection):Command + D 3.移動行(Move Li

原创 關於 Bitmap.createScaledBitmap(); 重新生成新的bitmap 問題

異常信息: java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@a693a8f

原创 Mac ssh 密鑰錯誤導致無法連接

修改 known_hosts vi ~/.ssh/known_hosts 找到服務器ip,並刪除ip所在的行即可,顯示如下: 31.241.88.46 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItb

原创 Android Studio3.0 gradle 重命名apk

android{ compileSdkVersion 28 defaultConfig { applicationId "com.exemple.xx" minSdkVersion 1

原创 github clone 慢問題解決

git clone https://github.com/MyName/myjava.git 替換爲  git clone https://github.com.cnpmjs.org/MyName/myjava.git 也就是 githu