diff --git a/README.md b/README.md new file mode 100644 index 0000000..3dad17d --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +### tools +[![](https://jitpack.io/v/mirkowu/tools.svg)](https://jitpack.io/#mirkowu/tools) + + + +### 使用 + +``` +implementation "com.github.mirkowu.tools:lib_ble:$ext.tools_version" //蓝牙ble +implementation "com.github.mirkowu.mvm:lib_util:$ext.mvm_version" //log工具 +``` +[mvm项目](https://github.com/MirkoWu/MVM) + +### 功能 +- [x] 蓝牙ble +- [x] 等 diff --git a/app/build.gradle b/app/build.gradle index 75011ff..96770b9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -54,6 +54,8 @@ dependencies { implementation "com.github.mirkowu.mvm:lib_widget:$ext.mvm_version" implementation "com.github.mirkowu.mvm:lib_util:$ext.mvm_version" implementation "com.github.mirkowu.mvm:lib_screen:$ext.mvm_version" + +// implementation "com.github.mirkowu.tools:lib_ble:$ext.tools_version" implementation project(':lib_ble') } \ No newline at end of file diff --git a/app/src/main/java/com/mirkowu/mvm/ble/BleActivity.kt b/app/src/main/java/com/mirkowu/mvm/ble/BleActivity.kt index 5dfe738..1966827 100644 --- a/app/src/main/java/com/mirkowu/mvm/ble/BleActivity.kt +++ b/app/src/main/java/com/mirkowu/mvm/ble/BleActivity.kt @@ -118,7 +118,7 @@ class BleActivity : BaseActivity() { override fun onPermissionShowRationale( requestCode: Int, - permissions: Array? + permissions: Array ) { ToastUtils.showShort("检测到GPS/位置服务功能未开启,请开启 111111") startLeScan() diff --git a/app/src/main/java/com/mirkowu/mvm/ble/SearchBleActivity.kt b/app/src/main/java/com/mirkowu/mvm/ble/SearchBleActivity.kt index df3e3a9..9a79e67 100644 --- a/app/src/main/java/com/mirkowu/mvm/ble/SearchBleActivity.kt +++ b/app/src/main/java/com/mirkowu/mvm/ble/SearchBleActivity.kt @@ -108,7 +108,7 @@ class SearchBleActivity : BaseActivity() { override fun onPermissionShowRationale( requestCode: Int, - permissions: Array? + permissions: Array ) { ToastUtils.showShort("检测到GPS/位置服务功能未开启,请开启 111111") startLeScan() diff --git a/build.gradle b/build.gradle index 7b50e0c..457f2e6 100644 --- a/build.gradle +++ b/build.gradle @@ -33,9 +33,10 @@ task clean(type: Delete) { ext { minSdkVersion = 21 targetSdkVersion = 29 - compileSdkVersion = 29 + compileSdkVersion = 30 - mvm_version = '1.0.19' + mvm_version = '1.0.20' + tools_version = '1.0.0' appcompat_version = '1.3.0' core_ktx_version = '1.5.0' lifecycle_version = '2.3.1' diff --git a/lib_ble/build.gradle b/lib_ble/build.gradle index f6bbc6d..87f7853 100644 --- a/lib_ble/build.gradle +++ b/lib_ble/build.gradle @@ -30,5 +30,4 @@ dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "androidx.appcompat:appcompat:$ext.appcompat_version" implementation "com.github.mirkowu.mvm:lib_util:$ext.mvm_version" - implementation "com.github.mirkowu.mvm:lib_widget:$ext.mvm_version" } \ No newline at end of file diff --git a/lib_ble/src/main/java/com/mirkowu/lib_ble/BLEService.java b/lib_ble/src/main/java/com/mirkowu/lib_ble/BLEService.java index 68809ed..a331290 100644 --- a/lib_ble/src/main/java/com/mirkowu/lib_ble/BLEService.java +++ b/lib_ble/src/main/java/com/mirkowu/lib_ble/BLEService.java @@ -36,7 +36,6 @@ import com.mirkowu.lib_util.LogUtil; import java.util.List; -import java.util.UUID; /** * Service for managing connection and data communication with a GATT server hosted on a @@ -76,8 +75,8 @@ public class BLEService extends Service { // public final static UUID UUID_NOTIFY = // UUID.fromString("00002a00-0000-1000-8000-00805f9b34fb"); // - private String UUID_SERVICE="00001800-0000-1000-8000-00805f9b34fb"; - private String UUID_NOTIFY="00002a00-0000-1000-8000-00805f9b34fb"; + private String UUID_SERVICE = "00001800-0000-1000-8000-00805f9b34fb"; + private String UUID_NOTIFY = "00002a00-0000-1000-8000-00805f9b34fb"; public BluetoothGattCharacteristic mNotifyCharacteristic;