├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable │ │ │ │ ├── linear_layout_bg.xml │ │ │ │ ├── checkbox_selector.xml │ │ │ │ ├── checkbox_unchecked.xml │ │ │ │ ├── checkbox_checked.xml │ │ │ │ ├── linear_layout_bottom_bg.xml │ │ │ │ ├── linear_layout_limian_bg.xml │ │ │ │ ├── button_check_bg.xml │ │ │ │ ├── linear_button_bg.xml │ │ │ │ ├── custom_progress_bar_horizontal.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── head_layout.xml │ │ │ │ ├── firmware_item.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── dialog_custom.xml │ │ │ │ ├── activity_ota.xml │ │ │ │ ├── device_item.xml │ │ │ │ └── activity_filelist.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── bw │ │ │ │ └── ydb │ │ │ │ ├── utils │ │ │ │ ├── config │ │ │ │ │ ├── UUIDDataBase.java │ │ │ │ │ ├── GattAttributes.java │ │ │ │ │ ├── Constants.java │ │ │ │ │ └── BroadCast.java │ │ │ │ ├── WriteStatus.java │ │ │ │ ├── tool │ │ │ │ │ └── BWDataParser.java │ │ │ │ └── BleManage.java │ │ │ │ ├── event │ │ │ │ ├── BleEvent.java │ │ │ │ └── ConnectEvent.java │ │ │ │ ├── model │ │ │ │ ├── OTAFileModel.java │ │ │ │ └── BleModel.java │ │ │ │ ├── ui │ │ │ │ ├── adapter │ │ │ │ │ ├── OTAFileListAdapter.java │ │ │ │ │ └── LeDeviceListAdapter.java │ │ │ │ └── activity │ │ │ │ │ ├── OTAActivity.java │ │ │ │ │ ├── FileListActivity.java │ │ │ │ │ └── MainActivity.java │ │ │ │ ├── widgets │ │ │ │ ├── TextProgressBar.java │ │ │ │ └── CustomsDialog.java │ │ │ │ └── data │ │ │ │ └── service │ │ │ │ └── BluetoothService.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── bw │ │ │ └── ydb │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── bw │ │ └── ydb │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── .idea ├── dictionaries │ └── rnd.xml ├── caches │ └── build_file_checksums.ser ├── vcs.xml ├── compiler.xml ├── gradle.xml ├── codeStyles │ └── Project.xml ├── jarRepositories.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── gradlew └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /.idea/dictionaries/rnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArdWang/YModemBleUpdate/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | YModemBleUpdate 3 | 4 | Confirm 5 | Cancel 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/linear_layout_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon May 16 09:07:04 CST 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/bw/ydb/utils/config/UUIDDataBase.java: -------------------------------------------------------------------------------- 1 | package com.bw.ydb.utils.config; 2 | 3 | import java.util.UUID; 4 | 5 | public class UUIDDataBase { 6 | public final static UUID UUID_OTA_UPDATE_CHARACTERISTIC = UUID 7 | .fromString(GattAttributes.BW_PROJECT_OTA_DATA); 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/bw/ydb/utils/WriteStatus.java: -------------------------------------------------------------------------------- 1 | package com.bw.ydb.utils; 2 | 3 | import com.clj.fastble.exception.BleException; 4 | 5 | public interface WriteStatus { 6 | 7 | void onSuccess(int current, int total, byte[] justWrite); 8 | 9 | void onFail(BleException exception); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/checkbox_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/bw/ydb/event/BleEvent.java: -------------------------------------------------------------------------------- 1 | package com.bw.ydb.event; 2 | 3 | import com.bw.ydb.model.BleModel; 4 | 5 | public class BleEvent { 6 | 7 | public BleEvent(BleModel model){ 8 | this.model = model; 9 | } 10 | 11 | public BleModel getModel() { 12 | return model; 13 | } 14 | 15 | public void setModel(BleModel model) { 16 | this.model = model; 17 | } 18 | 19 | private BleModel model; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /app/src/test/java/com/bw/ydb/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.bw.ydb; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/bw/ydb/utils/config/GattAttributes.java: -------------------------------------------------------------------------------- 1 | package com.bw.ydb.utils.config; 2 | 3 | public class GattAttributes { 4 | //温度类型 5 | public static final String TEMPERATURE_TYPE = "00002a1d-0000-1000-8000-00805f9b34fb"; 6 | //usual 7 | public static final String CLIENT_CHARACTERISTIC_CONFIG = "00002902-0000-1000-8000-00805f9b34fb"; 8 | //通过OTA发送数据到设备 更新设备的功能 9 | public static final String BW_PROJECT_OTA_DATA = "XXXXX-BB42-452D-B573-E0645F03C230"; 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/bw/ydb/event/ConnectEvent.java: -------------------------------------------------------------------------------- 1 | package com.bw.ydb.event; 2 | 3 | import com.bw.ydb.model.BleModel; 4 | 5 | import java.util.List; 6 | 7 | public class ConnectEvent { 8 | 9 | public ConnectEvent(List list){ 10 | this.list = list; 11 | } 12 | 13 | public List getList() { 14 | return list; 15 | } 16 | 17 | public void setList(List list) { 18 | this.list = list; 19 | } 20 | 21 | private List list; 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/checkbox_unchecked.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 11 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/checkbox_checked.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 11 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/linear_layout_bottom_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/bw/ydb/utils/config/Constants.java: -------------------------------------------------------------------------------- 1 | package com.bw.ydb.utils.config; 2 | 3 | public class Constants { 4 | public static final String EXTRA_CHARACTERISTIC_ERROR_MESSAGE = "com.bw.bwp.EXTRA_CHARACTERISTIC_ERROR_MESSAGE"; 5 | /** 6 | * OTA File Selection Extras 7 | * OTA文件选择 8 | */ 9 | public static final String REQ_FILE_COUNT = "REQ_FILE_COUNT"; 10 | public static final String SELECTION_FLAG = "SELECTION_FLAG"; 11 | public static final String ARRAYLIST_SELECTED_FILE_PATHS = "ARRAYLIST_SELECTED_FILE_PATHS"; 12 | public static final String ARRAYLIST_SELECTED_FILE_NAMES = "ARRAYLIST_SELECTED_FILE_NAMES"; 13 | 14 | public static final String BLE_MODEL = "BLE_MODEL"; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/linear_layout_limian_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_check_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/linear_button_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | 15 | android.useAndroidX=true 16 | android.enableJetifier=true 17 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/bw/ydb/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.bw.ydb; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.bw.ydb", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_progress_bar_horizontal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/bw/ydb/utils/tool/BWDataParser.java: -------------------------------------------------------------------------------- 1 | package com.bw.ydb.utils.tool; 2 | 3 | import android.bluetooth.BluetoothGattCharacteristic; 4 | import android.util.Log; 5 | 6 | public class BWDataParser { 7 | 8 | public static String getOtaData(BluetoothGattCharacteristic characteristic){ 9 | byte[] data = characteristic.getValue(); 10 | String qq = byteArrayToStr(data); 11 | Log.i("qq is ",qq); 12 | return qq; 13 | } 14 | 15 | //温度数据处理 16 | public static String getTempData(BluetoothGattCharacteristic characteristic){ 17 | byte[] data = characteristic.getValue(); 18 | String qq = byteArrayToStr(data); 19 | Log.i("qq is ",qq); 20 | return qq; 21 | } 22 | 23 | //数组转为string 24 | private static String byteArrayToStr(byte[] byteArray) { 25 | if (byteArray == null) { 26 | return null; 27 | } 28 | String str = new String(byteArray); 29 | return str; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/head_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 16 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/bw/ydb/utils/config/BroadCast.java: -------------------------------------------------------------------------------- 1 | package com.bw.ydb.utils.config; 2 | 3 | public class BroadCast { 4 | public final static String ACTION_GATT_CHARACTERISTIC_ERROR = 5 | "com.bw.bwp.action.ACTION_GATT_CHARACTERISTIC_ERROR"; 6 | public final static String ACTION_GATT_CONNECTED 7 | = "com.bw.bwp.action.ACTION_GATT_CONNECTED"; //连接 8 | public final static String ACTION_GATT_DISCONNECTED 9 | = "com.bw.bwp.action.ACTION_GATT_DISCONNECTED"; //断开链接 10 | public final static String ACTION_GATT_SERVICES_DISCOVERED 11 | = "com.bw.bwp.action.ACTION_GATT_SERVICES_DISCOVERED"; //发现设备 12 | public final static String ACTION_DATA_AVAILABLE 13 | = "com.bw.bwp.action.ACTION_DATA_AVAILABLE"; 14 | 15 | public final static String ACTION_OTA_DATA_AVAILABLE = 16 | "com.bw.bwp.action.ACTION_OTA_DATA_AVAILABLE"; 17 | 18 | public final static String ACTION_OTA_DATA="com.bw.bwp.action.ACTION_OTA_DATA"; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/firmware_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 11 | 12 | 13 | 17 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 30 5 | buildToolsVersion "30.0.3" 6 | 7 | defaultConfig { 8 | applicationId "com.bw.ydb" 9 | minSdkVersion 19 10 | targetSdkVersion 30 11 | versionCode 2 12 | versionName "1.0.2" 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | compileOptions { 22 | targetCompatibility JavaVersion.VERSION_1_8 23 | } 24 | } 25 | 26 | dependencies { 27 | implementation fileTree(dir: 'libs', include: ['*.jar']) 28 | implementation 'androidx.appcompat:appcompat:1.2.0' 29 | implementation 'com.google.android.material:material:1.3.0' 30 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 31 | implementation 'androidx.recyclerview:recyclerview:1.1.0' 32 | implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' 33 | testImplementation 'junit:junit:4.+' 34 | androidTestImplementation 'androidx.test.ext:junit:1.1.2' 35 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 36 | 37 | implementation 'com.github.ArdWang:YModemLib:2.0.1' 38 | 39 | // rxjava3.0 40 | implementation 'io.reactivex.rxjava3:rxjava:3.0.11-RC5' 41 | 42 | // 支持rxjava3.0 43 | implementation 'com.github.tbruyelle:rxpermissions:0.12' 44 | 45 | implementation 'com.github.Jasonchenlijian:FastBle:2.4.0' 46 | 47 | implementation 'org.greenrobot:eventbus:3.2.0' 48 | 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/bw/ydb/model/OTAFileModel.java: -------------------------------------------------------------------------------- 1 | package com.bw.ydb.model; 2 | 3 | /** 4 | * Data Model class for OTA File 5 | */ 6 | public class OTAFileModel { 7 | /** 8 | *File name 9 | */ 10 | private String mFileName = null; 11 | /** 12 | *File path 13 | */ 14 | private String mFilePath = null; 15 | /** 16 | * File parent 17 | */ 18 | private String mFileParent = null; 19 | /** 20 | *Selection Flag 21 | * 22 | */ 23 | private boolean mSelected = false; 24 | 25 | 26 | // Constructor 27 | public OTAFileModel(String fileName, String filePath, boolean selected, String fileParent) { 28 | super(); 29 | this.mFileName = fileName; 30 | this.mFilePath = filePath; 31 | this.mSelected = selected; 32 | this.mFileParent = fileParent; 33 | } 34 | 35 | public OTAFileModel() { 36 | super(); 37 | } 38 | 39 | public String getFileName() { 40 | return mFileName; 41 | } 42 | 43 | public String getmFileParent() { 44 | return mFileParent; 45 | } 46 | 47 | public void setmFileParent(String mFileParent) { 48 | this.mFileParent = mFileParent; 49 | } 50 | 51 | public void setFileName(String mFileName) { 52 | this.mFileName = mFileName; 53 | } 54 | 55 | public String getFilePath() { 56 | return mFilePath; 57 | } 58 | 59 | public void setName(String mFilePath) { 60 | this.mFilePath = mFilePath; 61 | } 62 | 63 | public boolean isSelected() { 64 | return mSelected; 65 | } 66 | 67 | public void setSelected(boolean selected) { 68 | this.mSelected = selected; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | 5 | #303F9F 6 | 7 | #FF4081 8 | 9 | #436EEE 10 | 11 | #436EEE 12 | 13 | #6495ED 14 | 15 | #FFFFFF 16 | 17 | #436EEE 18 | 19 | #EE0000 20 | 21 | #4D4D4D 22 | 23 | #EAEAEA 24 | 25 | #EDEDED 26 | 27 | #111111 28 | 29 | #999999 30 | 31 | #4169E1 32 | 33 | #00FF00 34 | 35 | #EEEE00 36 | 37 | #EFEFEF 38 | 39 | #ABABAB 40 | 41 | #0c377b 42 | #EFEFF4 43 | #701ABB00 44 | 45 | 46 | #B0B0B0 47 | #8F8F8F 48 | #949494 49 | #8B8B7A 50 | #8B8B83 51 | #878787 52 | #848484 53 | #7F7F7F 54 | #778899 55 | #707070 56 | 57 | 58 | #222222 59 | 60 | 61 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_custom.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 20 | 21 | 30 | 31 | 37 | 38 |