Skip to content

Merge changes through release 3.0.7 to master #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 108 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
4e6f67c
Load MakeCode in a WebView. Downloads not handled yet.
microbit-sam Jul 30, 2019
428d023
parses fat binaries
microbit-sam May 26, 2020
b03e8bf
flash v1s
microbit-sam May 28, 2020
d94ca2c
remove Google Analytics
microbit-sam May 28, 2020
d722b95
Add Partial Flashing Service
microbit-sam Jun 2, 2020
0d8e879
v1 works
microbit-sam Jun 4, 2020
f30e7c0
change
microbit-sam Jun 9, 2020
9770055
Merge branch 'makecode-webview' into update-dfu-lib-sam-v1
microbit-sam Jun 9, 2020
5eb54e1
v1 partial flashing stable
microbit-sam Jun 9, 2020
51899d1
MakeCode download working correctly
microbit-sam Jun 10, 2020
cd0a16d
remove pf
microbit-sam Jun 10, 2020
8cfe174
fixup! remove pf
microbit-sam Jun 10, 2020
9cd693d
use up to date gif drawable
microbit-sam Jul 1, 2020
531f888
check for no paired microbits
microbit-sam Jul 7, 2020
bd7bed9
automatically flash from makecode. fixed some ble errors.. defo more …
microbit-sam Jul 7, 2020
053a866
use v2 makecode; don't DFU if partial flashing fails
microbit-sam Jul 8, 2020
f3ac6d4
bump version
microbit-sam Jul 9, 2020
acc8d18
set dialog button colors
microbit-sam Jul 13, 2020
4cf0ce7
modify messaging. add interstatial pop up
microbit-sam Jul 14, 2020
976d6a9
Makecode v3. Flashing fixes
microbit-sam Aug 24, 2020
68a5c97
renable pf
microbit-sam Aug 24, 2020
73b7c0b
fixup! renable pf
microbit-sam Aug 24, 2020
9491764
don't finish makecode activity when flashing
microbit-sam Aug 25, 2020
5ac6550
update version code
microbit-sam Aug 25, 2020
36cf218
initial v2 support
microbit-sam Oct 5, 2020
e61145a
support v2 microbits
microbit-sam Oct 14, 2020
d0f5062
delete bond. rebond.
microbit-sam Oct 26, 2020
f04bf0f
bump version code
microbit-sam Oct 26, 2020
b66073b
connect only when flashing; handle unknown board type
microbit-sam Nov 18, 2020
4a92c1d
Only pair don't connect
microbit-sam Nov 25, 2020
e4e231f
projectFilePath null check
microbit-sam Nov 30, 2020
7d58035
android 10 compat
microbit-sam Dec 8, 2020
73f556f
uPy support
microbit-sam Jan 4, 2021
a212a51
Android Studio: AGP 4.1.1 to 7.3.1
martinwork Dec 29, 2023
1597e8a
Use SDK 30
martinwork Jan 3, 2024
66104bf
Gather projects folder access into ProjectsHelper
martinwork Jan 3, 2024
8286e34
HomeActivity - use Projects Helper permissions code
martinwork Jan 3, 2024
8451004
ProjectActivity - use ProjectsHelper permissions code
martinwork Jan 3, 2024
bd79c9f
ProjectActivity - fix flashing bug - fail to unregister callbacks
martinwork Jan 3, 2024
384ef7a
PairingActivity - update pairing permission requests for Android 11
martinwork Jan 3, 2024
f75cc74
PairingActivity - reworked the pair connection method
martinwork Jan 3, 2024
7006e70
Target Android 12 SDK 31; compile SDK 34
martinwork Jan 4, 2024
3d0a777
targetSdk 33 Android 13
martinwork Jan 7, 2024
3030f8e
DFU - only message progress bar when value changes
martinwork Jan 7, 2024
f4de3ef
MakeCode - implement saving zip. console data and snapshot
martinwork Jan 7, 2024
f471cbe
MakeCode - implement Import File...Choose file
martinwork Jan 7, 2024
84e3a90
ProjectActivity - Bluetooth permission
martinwork Jan 8, 2024
be9365f
Can't check paired devices without permission
martinwork Jan 13, 2024
6be79d9
Remove experimental long click handler
martinwork Jan 13, 2024
47da2bf
Remove experimental import/export code
martinwork Jan 13, 2024
6f064b0
Flashing - avoid creating multiple receivers
martinwork Jan 13, 2024
46b9bbb
Flashing - get permissions before checking still paired
martinwork Jan 13, 2024
64c0f0b
Projects - continue using downloads folder on Android 10
martinwork Jan 14, 2024
5d48a99
Flashing ends in initiating Activity
martinwork Jan 14, 2024
a6d682d
Add irmHexUtils
martinwork Jan 23, 2024
143f5c9
Pairing updates
martinwork Jan 23, 2024
c8309bd
Flashing - reorgnise start with hex parsing once in background
martinwork Jan 23, 2024
09b0281
Merge pull request #37 from martinwork/from288
martinwork Jan 23, 2024
68afcfc
Version 51 3.0.1
martinwork Feb 14, 2024
4ecc3b0
Home - install new samples
martinwork Feb 20, 2024
ce52abb
Pairing - remove ACCESS_BACKGROUND_LOCATION
martinwork Feb 27, 2024
f7c8ea3
Pairing/Projects - disable connection
martinwork Feb 27, 2024
e7c92b1
Flashing pass BuildConfig.DEBUG to librairies
martinwork Feb 27, 2024
b7cba2d
Pairing - Change prompt When to If asked for a PIN, press button A
martinwork Feb 27, 2024
389a633
Project - fix partial flash launch
martinwork Feb 27, 2024
6aae70d
Pairing - separate BLE code into a new class
martinwork Feb 27, 2024
19d76d4
Projects - Added Import & Export via menu on SCRIPTS button
martinwork Feb 28, 2024
5437277
Enable Sharing a file from Files app
martinwork Feb 29, 2024
585979c
MakeCode - support for hex file import
martinwork Mar 1, 2024
b3c7ab7
Projects - add edit project button
martinwork Mar 3, 2024
e9cdfee
FileUtils - move file read/write code into FileUtils
martinwork Mar 3, 2024
bf28339
ProjectsHelper - helper functions fer import
martinwork Mar 3, 2024
c04e1c9
Projects - remove reconnection callback
martinwork Mar 3, 2024
ec50459
MakeCode - fix click handlers for back, download, save
martinwork Mar 3, 2024
1acc2f2
MakeCode/Projects - import, save, download
martinwork Mar 3, 2024
0daa359
Projects - remove background from permission prompt
martinwork Mar 12, 2024
4716964
irmHexUtils - fix V2 checksums
martinwork Mar 12, 2024
d535b56
irmHexUtils - add conversion to binary
martinwork Mar 12, 2024
021cda9
Projects - use BIN file for DFU
martinwork Mar 12, 2024
b9d4779
Version 3.0.2 (52)
martinwork Mar 12, 2024
c4f5e05
Accept suggested library upgrades
martinwork Mar 13, 2024
649081f
Merge pull request #38 from martinwork/from300
martinwork Mar 21, 2024
cc71512
Version 3.0.3 (53)
martinwork Mar 22, 2024
67b140b
Remove AD_ID permission
martinwork Mar 22, 2024
7f1f74f
Merge pull request #39 from martinwork/from300
martinwork Mar 22, 2024
18bc360
Version 3.0.4 (54) - Pairing - Add triple reset method
martinwork Mar 26, 2024
684af7a
Merge pull request #2 from martinwork/from300reset
martinwork Mar 26, 2024
18328fc
Merge pull request #40 from martinwork/from300
martinwork Mar 26, 2024
afdb08e
Projects - flash calls Pairing for Reset to BLE mode UI
martinwork Mar 26, 2024
d5caa32
Merge pull request #3 from martinwork/from300-flash-blemode
martinwork Mar 26, 2024
d189b83
Merge pull request #41 from martinwork/from300
martinwork Mar 26, 2024
bf71422
Pairing - fix PAIR NEW crash
martinwork Mar 27, 2024
b90cacc
Merge pull request #42 from martinwork/from300
martinwork Mar 27, 2024
e39d732
Projects - reduce flash/edit/delete button spacing
martinwork Mar 27, 2024
21f3266
Merge pull request #43 from martinwork/from300
martinwork Mar 27, 2024
d43c6b6
Projects/Pairing - fix permission and activity routing
martinwork Mar 30, 2024
c01138e
Merge pull request #44 from martinwork/from300
martinwork Mar 30, 2024
b30004c
Version 3.0.5 (55)
microbit-grace Apr 2, 2024
8c61ca0
Merge pull request #45 from microbit-foundation/upgrade-version
martinwork Apr 2, 2024
218ee64
Fix zip path traversal error
microbit-grace Apr 2, 2024
289b495
Version 3.0.6 (56)
microbit-grace Apr 2, 2024
b7fdb66
Remove unused camera plugin
microbit-grace Apr 2, 2024
1778a85
Continue instead of throw error
microbit-grace Apr 2, 2024
9407953
Add a comment
microbit-grace Apr 2, 2024
3e23716
Merge pull request #46 from microbit-foundation/install-samples
martinwork Apr 2, 2024
6b22d01
Merge pull request #47 from microbit-foundation/intent-error
martinwork Apr 2, 2024
87f8562
Version 3.0.7 (57)
martinwork Apr 3, 2024
f579e4a
Merge pull request #48 from martinwork/from300
martinwork Apr 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Android-DFU-Library"]
path = dfuLibrary
url = https://github.com/NordicSemiconductor/Android-DFU-Library
15 changes: 10 additions & 5 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

Binary file not shown.
2 changes: 0 additions & 2 deletions android-gif-drawable-1.1.13/build.gradle

This file was deleted.

28 changes: 16 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
compileSdk 34
defaultConfig {
applicationId "com.samsung.microbit"
minSdkVersion 19
targetSdkVersion 26
minSdkVersion 21
targetSdk 33
// When target SDK version is 30+,
// requestLegacyExternalStorage will continue to work for 29 Android 10
}
buildTypes {
release {
Expand All @@ -16,19 +17,22 @@ android {
}
productFlavors {
}
lintOptions {
namespace 'com.samsung.microbit'
lint {
abortOnError false
}
}

dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:23.1.0'
implementation 'com.android.support:design:23.1.0'
implementation project(':dfuLibrary')
implementation 'com.android.support:cardview-v7:23.1.0'
implementation 'com.android.support:recyclerview-v7:23.1.0'
implementation project(':android-gif-drawable-1.1.13')
implementation 'com.google.android.gms:play-services-analytics:9.2.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
implementation 'no.nordicsemi.android:dfu:2.4.1'
implementation project(':pfLibrary')
implementation 'com.google.android.gms:play-services-analytics:18.0.4'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
}
71 changes: 47 additions & 24 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,43 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.samsung.microbit"
android:versionCode="16"
android:versionName="2.4">
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="57"
android:versionName="3.0.7">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" android:protectionLevel="signature"/>
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" android:protectionLevel="signature"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30"/>
<!-- <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" android:maxSdkVersion="30"/>-->

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<!-- API 31 Needed only if your app looks for Bluetooth devices. -->
<!-- Include "neverForLocation" only if you can strongly assert that
your app never derives physical location from Bluetooth scan results. -->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
<!-- API 31 Needed only if your app communicates with already-paired Bluetooth devices. -->
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.flash" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.telephony" android:required="false"/>


<supports-screens android:normalScreens="true" />
<supports-screens android:largeScreens="true" />
<supports-screens android:xlargeScreens="true" />
Expand All @@ -52,7 +60,9 @@
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
android:theme="@style/AppTheme.NoActionBar"
android:requestLegacyExternalStorage="true">

<activity
android:name=".ui.activity.HomeActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
Expand All @@ -65,9 +75,10 @@
android:label="@string/app_name_without_colon"
android:configChanges="orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustResize"
android:launchMode="singleTask">
<!-- Intent filters for open micro:bit app, accord to user request -->
android:launchMode="singleTask"
android:exported="true">

<!-- Intent filters for open micro:bit app, accord to user request -->

<!-- This filter works, when request - open file from File Manager -->
<intent-filter>
Expand Down Expand Up @@ -104,6 +115,15 @@
android:scheme="content"/>
</intent-filter>

<!-- This filter works, when sharing a hex file from Files app -->
<!-- https://developer.android.com/training/sharing/receive#update-manifest -->
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:mimeType="application/octet-stream" />
</intent-filter>

</activity>
<activity
android:name=".ui.activity.NotificationActivity"
Expand All @@ -127,24 +147,18 @@
android:label="Audio Recorder"
android:launchMode="singleTask"
android:screenOrientation="portrait"/>
<activity
android:name=".ui.activity.CameraActivity_OldAPI"
android:label="Camera Microbit"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"/>
<activity
android:name=".ui.activity.HelpWebView"
android:configChanges="orientation|screenSize"
android:label="Help Webview"
android:launchMode="singleTask"
android:screenOrientation="portrait"/>
<activity
android:name=".ui.activity.CameraActivityPermissionChecker"
android:label="@string/title_activity_camera_activity_permission_checker"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"/>

android:name=".ui.activity.MakeCodeWebView"
android:configChanges="orientation|screenSize"
android:label="MakeCode Webview"
android:launchMode="singleTask"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<service
android:name=".service.DfuService"
android:enabled="true"/>
Expand All @@ -165,10 +179,17 @@
android:enabled="true"
android:exported="false"/>

<service
android:name=".service.PartialFlashingService"
android:enabled="true"
android:launchMode="singleInstance"
/>

<activity
android:name=".ui.activity.SplashScreenActivity"
android:screenOrientation="locked"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

Expand All @@ -182,6 +203,8 @@
<action android:name="com.samsung.microbit.core.SHOWFROMSERVICE"/>
</intent-filter>
</receiver>

</application>

<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
</manifest>
3 changes: 0 additions & 3 deletions app/src/main/java/com/samsung/microbit/MBApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import android.graphics.Typeface;
import android.util.Log;

import com.samsung.microbit.core.GoogleAnalyticsManager;

/**
* Represents a custom class of the app.
* Provides some resources that use along app modules,
Expand All @@ -26,7 +24,6 @@ public void onCreate() {
super.onCreate();
app = this;
initTypefaces();
GoogleAnalyticsManager.createInstance(this);

Log.d("MBApp", "App Created");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.samsung.microbit.core;

import android.util.Log;
import android.webkit.DownloadListener;

import com.samsung.microbit.utils.IOUtils;

Expand All @@ -12,8 +13,7 @@
import java.net.URL;
import java.net.URLConnection;

//TODO: consider to use somewhere or remove
public class DownloadManager {
public class DownloadManager implements DownloadListener {

volatile boolean cancelled = false;

Expand Down Expand Up @@ -44,4 +44,9 @@ public long download(String sourceUrl, String destinationFile) {

return objectSize;
}

@Override
public void onDownloadStart(String s, String s1, String s2, String s3, long l) {
Log.v(TAG, s + " " + s1 + " " + s2 + " " + s3 + " " + l);
}
}
Loading