diff --git a/app/build.gradle b/app/build.gradle index 567ebda5..5be7dd13 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "no.nordicsemi.android.nrftoolbox" minSdkVersion 18 targetSdkVersion 29 - versionCode 74 - versionName "2.8.2" + versionCode 75 + versionName "2.8.3" resConfigs "en" vectorDrawables.useSupportLibrary = true @@ -50,7 +50,7 @@ dependencies { implementation 'no.nordicsemi.android.support.v18:scanner:1.4.3' // The DFU Library is imported automatically from jcenter: - implementation 'no.nordicsemi.android:dfu:1.9.1' + implementation 'no.nordicsemi.android:dfu:1.10.0' // if you desire to build the DFU Library, clone the // https://github.com/NordicSemiconductor/Android-DFU-Library project into DFULibrary folder, // add it as a module into the project structure and uncomment the following line @@ -60,7 +60,6 @@ dependencies { // Gson is needed for DFU to work. The DFU library dependency to Gson is internal and would // not be attached to APK. // See: https://github.com/NordicSemiconductor/Android-nRF-Toolbox/issues/86 - implementation 'com.google.code.gson:gson:2.8.6' // Import the BLE Common Library. // The BLE Common Library depends on BLE Library. It is enough to include the first one. diff --git a/app/src/main/java/no/nordicsemi/android/nrftoolbox/dfu/DfuActivity.java b/app/src/main/java/no/nordicsemi/android/nrftoolbox/dfu/DfuActivity.java index eaa01a34..40647ca1 100644 --- a/app/src/main/java/no/nordicsemi/android/nrftoolbox/dfu/DfuActivity.java +++ b/app/src/main/java/no/nordicsemi/android/nrftoolbox/dfu/DfuActivity.java @@ -539,16 +539,20 @@ public class DfuActivity extends AppCompatActivity implements LoaderCallbacks { initFilePath = null; initFileStreamUri = null; - }).setPositiveButton(R.string.yes, (dialog, which) -> { + }) + .setPositiveButton(R.string.yes, (dialog, which) -> { final Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType(DfuService.MIME_TYPE_OCTET_STREAM); intent.addCategory(Intent.CATEGORY_OPENABLE); startActivityForResult(intent, SELECT_INIT_FILE_REQ); - }).show(); + }) + .show(); } else { new AlertDialog.Builder(this).setTitle(R.string.dfu_file_scope_title).setCancelable(false) .setSingleChoiceItems(R.array.dfu_file_scope, 0, (dialog, which) -> { @@ -584,7 +588,10 @@ public class DfuActivity extends AppCompatActivity implements LoaderCallbacks { switch (which) { case 0: @@ -627,10 +635,14 @@ public class DfuActivity extends AppCompatActivity implements LoaderCallbacks openFileChooser()).setNeutralButton(R.string.dfu_file_info, (dialog, which) -> { - final ZipInfoFragment fragment = new ZipInfoFragment(); - fragment.show(getSupportFragmentManager(), "help_fragment"); - }).setNegativeButton(R.string.cancel, null).show(); + }) + .setPositiveButton(R.string.ok, (dialog, which) -> openFileChooser()) + .setNeutralButton(R.string.dfu_file_info, (dialog, which) -> { + final ZipInfoFragment fragment = new ZipInfoFragment(); + fragment.show(getSupportFragmentManager(), "help_fragment"); + }) + .setNegativeButton(R.string.cancel, null) + .show(); } private void openFileChooser() { @@ -647,15 +659,19 @@ public class DfuActivity extends AppCompatActivity implements LoaderCallbacks dialog.dismiss()).setPositiveButton(R.string.ok, (dialog, which) -> { + new AlertDialog.Builder(this) + .setTitle(R.string.dfu_alert_no_filebrowser_title) + .setView(customView) + .setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss()) + .setPositiveButton(R.string.ok, (dialog, which) -> { final int pos = appsList.getCheckedItemPosition(); if (pos >= 0) { final String query = getResources().getStringArray(R.array.dfu_app_file_browser_action)[pos]; final Intent storeIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(query)); startActivity(storeIntent); } - }).show(); + }) + .show(); } } @@ -703,6 +719,7 @@ public class DfuActivity extends AppCompatActivity implements LoaderCallbacksDFU nRF Toolbox DFU Proxy DFU Settings - DFU Library version 1.9.1 + DFU Library version 1.10.0 DEVICE FIRMWARE UPDATE -186dp @@ -47,7 +47,8 @@ SELECT FILE File Browser not found - File browser application has not been found on your device. Would you like to download one? + File browser application has not been found on + your device. Would you like to download one? Drive File Manager @@ -72,15 +73,19 @@ MBR size (by default 4096 bytes) Keep bond information External MCU DFU - Check this switch to ON if you want to perform a DFU operation without jumping to the bootloader mode on a device - with a DFU implementation from SDK 6.1 or older. To achieve the same result on any newer implementation the DFU Version characteristic should return value other than 0x0100. + Check this switch to ON if you want to + perform a DFU operation without jumping to the bootloader mode on a device with a DFU + implementation from SDK 6.1 or older. To achieve the same result on any newer implementation + the DFU Version characteristic should return value other than 0x0100. About DFU DFU documentation on Nordic\'s Developer Zone Information - During a DFU operation a lot of data packets are being sent to the target. The onCharacteristicWrite(...) - callback in Android API is invoked when the data has been written to the outgoing queue, not when physically sent. Packet receipt notifications were introduced to - prevent from overflowing the queue. Depending on the device model, disabling the notifications or setting the value to “high” (> ~300) may make the DFU process freeze - at some point on Android versions before Marshmallow. + During a DFU operation a lot of data packets + are being sent to the target. The onCharacteristicWrite(...) callback in Android API + is invoked when the data has been written to the outgoing queue, not when physically sent. + Packet receipt notifications were introduced to prevent from overflowing the queue. Depending + on the device model, disabling the notifications or setting the value to “high” (> ~300) + may make the DFU process freeze at some point on Android versions before Marshmallow. Select file type @@ -91,8 +96,9 @@ Init packet Do you want to select the Init packet file?\n - The Init packet file (*.dat) should contain the device type and revision, application version, list of supported Soft Devices and the firmware CRC - in binary format or, with old versions of the DFU bootloader, only the CRC (CRC-CCITT-16). + The Init packet file (*.dat) should contain the device type and revision, application version, + list of supported Soft Devices and the firmware CRC in binary format or, with old versions + of the DFU bootloader, only the CRC (CRC-CCITT-16). With the new version of the bootloader the extended Init packet is required. Select scope @@ -110,19 +116,23 @@ Uploading of the application has been canceled. Select file - A file browser application must be installed on the device before selecting the file. - \n\nThere are number of applications available on Google Play store, e.g. Total Commander or File Manager, that allow you to pick a file from internal memory of the device. To upload - a file from the Internet you may use e.g. Drive or Dropbox application. - \n\nYou will be asked to select an application if more than one is installed. A single application will be launched automatically. - \n\nSince Android KitKat you may use the preinstalled document picker application. Ensure Display advanced devices option is enabled in settings to use the Internal storage. - \n\nSample applications were copied to Nordic Semiconductor folder in the internal storage. + A file browser application must be installed on the device before + selecting the file.\n\nThere are number of applications available on Google Play store, + e.g. Total Commander or File Manager, that allow you to pick a file from internal memory + of the device. To upload a file from the Internet you may use e.g. Drive or Dropbox application. + \n\nYou will be asked to select an application if more than one is installed. A single + application will be launched automatically.\n\nSince Android KitKat you may use the + preinstalled document picker application. Ensure Show internal storage option is + enabled in the menu to use the Internal storage. - Starting from nRF Toolbox v1.12 the new Distribution packet (ZIP) is the recommended method for distributing firmware upgrades. - You can create the ZIP file using the nrf utility tool, which is part of Master Control Panel 3.8.0+. For more detailed information, see the DFU documentation. + Starting from nRF Toolbox v1.12 the new Distribution packet (ZIP) + is the recommended method for distributing firmware upgrades. You can create the ZIP file + using the nrf util tool (see GitHub). For more detailed information, see the DFU documentation. \n\nBackward compatibility - \nThe nRF Toolbox also supports all old file formats: HEX and BIN files, separate DAT files and ZIP files without a manifest file but with a fixed naming convention: - - The Device Firmware Update (DFU) app allows you to update the firmware of your Bluetooth LE device over-the-air (OTA). - It is compatible with Nordic Semiconductor nRF5 devices with DFU bootloader enabled. + \nThe nRF Toolbox also supports all old file formats: HEX and BIN files, separate DAT files + and ZIP files without a manifest file but with a fixed naming convention: + The Device Firmware Update (DFU) app allows you to update the + firmware of your Bluetooth LE device over-the-air (OTA). It is compatible with Nordic + Semiconductor nRF5 devices with DFU bootloader enabled. \n\nFor more information about the DFU, see the About DFU section in Settings.