Skip to content

Commit caba429

Browse files
Merge pull request #50 from microbit-foundation/from300
Recent releases have been made from the `from300` branch. Merge that branch back to master. Since #49 master contains only documentation changes since the merge-base commit with `from300` so this will result in an equivalent build to 3.0.7 from master. See notes on #49
2 parents 3e15c6b + f579e4a commit caba429

File tree

102 files changed

+5412
-8148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+5412
-8148
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "Android-DFU-Library"]
2+
path = dfuLibrary
3+
url = https://github.com/NordicSemiconductor/Android-DFU-Library

.idea/gradle.xml

Lines changed: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.
Binary file not shown.

android-gif-drawable-1.1.13/build.gradle

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/build.gradle

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 26
5-
buildToolsVersion '28.0.3'
4+
compileSdk 34
65
defaultConfig {
76
applicationId "com.samsung.microbit"
8-
minSdkVersion 19
9-
targetSdkVersion 26
7+
minSdkVersion 21
8+
targetSdk 33
9+
// When target SDK version is 30+,
10+
// requestLegacyExternalStorage will continue to work for 29 Android 10
1011
}
1112
buildTypes {
1213
release {
@@ -16,19 +17,22 @@ android {
1617
}
1718
productFlavors {
1819
}
19-
lintOptions {
20+
namespace 'com.samsung.microbit'
21+
lint {
2022
abortOnError false
2123
}
2224
}
2325

2426
dependencies {
2527
testImplementation 'junit:junit:4.12'
26-
implementation 'com.android.support:appcompat-v7:23.1.0'
27-
implementation 'com.android.support:design:23.1.0'
28-
implementation project(':dfuLibrary')
29-
implementation 'com.android.support:cardview-v7:23.1.0'
30-
implementation 'com.android.support:recyclerview-v7:23.1.0'
31-
implementation project(':android-gif-drawable-1.1.13')
32-
implementation 'com.google.android.gms:play-services-analytics:9.2.0'
28+
implementation 'androidx.appcompat:appcompat:1.6.1'
29+
implementation 'com.google.android.material:material:1.11.0'
30+
implementation 'androidx.cardview:cardview:1.0.0'
31+
implementation 'androidx.recyclerview:recyclerview:1.3.2'
32+
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
33+
implementation 'no.nordicsemi.android:dfu:2.4.1'
34+
implementation project(':pfLibrary')
35+
implementation 'com.google.android.gms:play-services-analytics:18.0.4'
3336
implementation 'com.google.code.gson:gson:2.8.2'
37+
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
3438
}

app/src/main/AndroidManifest.xml

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,43 @@
1414
limitations under the License.
1515
-->
1616
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
17-
package="com.samsung.microbit"
18-
android:versionCode="16"
19-
android:versionName="2.4">
17+
xmlns:tools="http://schemas.android.com/tools"
18+
android:versionCode="57"
19+
android:versionName="3.0.7">
2020

2121
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
2222
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
2323
<uses-permission android:name="android.permission.INTERNET"/>
24-
<uses-permission android:name="android.permission.BLUETOOTH"/>
25-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
26-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
27-
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
24+
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
25+
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30"/>
26+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
27+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
2828
<uses-permission android:name="android.permission.VIBRATE"/>
2929
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
3030
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" android:protectionLevel="signature"/>
3131
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" android:protectionLevel="signature"/>
3232
<uses-permission android:name="android.permission.WAKE_LOCK"/>
3333
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
3434
<uses-permission android:name="android.permission.CAMERA"/>
35+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
3536

37+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30"/>
38+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30"/>
39+
<!-- <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" android:maxSdkVersion="30"/>-->
3640

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

3948
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
4049
<uses-feature android:name="android.hardware.camera" android:required="false"/>
4150
<uses-feature android:name="android.hardware.camera.flash" android:required="false"/>
4251
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
4352
<uses-feature android:name="android.hardware.telephony" android:required="false"/>
4453

45-
4654
<supports-screens android:normalScreens="true" />
4755
<supports-screens android:largeScreens="true" />
4856
<supports-screens android:xlargeScreens="true" />
@@ -52,7 +60,9 @@
5260
android:hardwareAccelerated="true"
5361
android:icon="@mipmap/ic_launcher"
5462
android:label="@string/app_name"
55-
android:theme="@style/AppTheme.NoActionBar">
63+
android:theme="@style/AppTheme.NoActionBar"
64+
android:requestLegacyExternalStorage="true">
65+
5666
<activity
5767
android:name=".ui.activity.HomeActivity"
5868
android:configChanges="orientation|screenSize|keyboardHidden"
@@ -65,9 +75,10 @@
6575
android:label="@string/app_name_without_colon"
6676
android:configChanges="orientation|screenSize|keyboardHidden"
6777
android:windowSoftInputMode="adjustResize"
68-
android:launchMode="singleTask">
69-
<!-- Intent filters for open micro:bit app, accord to user request -->
78+
android:launchMode="singleTask"
79+
android:exported="true">
7080

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

7283
<!-- This filter works, when request - open file from File Manager -->
7384
<intent-filter>
@@ -104,6 +115,15 @@
104115
android:scheme="content"/>
105116
</intent-filter>
106117

118+
<!-- This filter works, when sharing a hex file from Files app -->
119+
<!-- https://developer.android.com/training/sharing/receive#update-manifest -->
120+
<intent-filter>
121+
<action android:name="android.intent.action.SEND"/>
122+
<category android:name="android.intent.category.DEFAULT"/>
123+
<category android:name="android.intent.category.BROWSABLE"/>
124+
<data android:mimeType="application/octet-stream" />
125+
</intent-filter>
126+
107127
</activity>
108128
<activity
109129
android:name=".ui.activity.NotificationActivity"
@@ -127,24 +147,18 @@
127147
android:label="Audio Recorder"
128148
android:launchMode="singleTask"
129149
android:screenOrientation="portrait"/>
130-
<activity
131-
android:name=".ui.activity.CameraActivity_OldAPI"
132-
android:label="Camera Microbit"
133-
android:launchMode="singleTask"
134-
android:screenOrientation="portrait"
135-
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"/>
136150
<activity
137151
android:name=".ui.activity.HelpWebView"
138152
android:configChanges="orientation|screenSize"
139153
android:label="Help Webview"
140154
android:launchMode="singleTask"
141155
android:screenOrientation="portrait"/>
142156
<activity
143-
android:name=".ui.activity.CameraActivityPermissionChecker"
144-
android:label="@string/title_activity_camera_activity_permission_checker"
145-
android:screenOrientation="portrait"
146-
android:theme="@style/AppTheme.NoActionBar"/>
147-
157+
android:name=".ui.activity.MakeCodeWebView"
158+
android:configChanges="orientation|screenSize"
159+
android:label="MakeCode Webview"
160+
android:launchMode="singleTask"
161+
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
148162
<service
149163
android:name=".service.DfuService"
150164
android:enabled="true"/>
@@ -165,10 +179,17 @@
165179
android:enabled="true"
166180
android:exported="false"/>
167181

182+
<service
183+
android:name=".service.PartialFlashingService"
184+
android:enabled="true"
185+
android:launchMode="singleInstance"
186+
/>
187+
168188
<activity
169189
android:name=".ui.activity.SplashScreenActivity"
170190
android:screenOrientation="locked"
171-
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
191+
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
192+
android:exported="true">
172193
<intent-filter>
173194
<action android:name="android.intent.action.MAIN"/>
174195

@@ -182,6 +203,8 @@
182203
<action android:name="com.samsung.microbit.core.SHOWFROMSERVICE"/>
183204
</intent-filter>
184205
</receiver>
206+
185207
</application>
186208

209+
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
187210
</manifest>

app/src/main/java/com/samsung/microbit/MBApp.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import android.graphics.Typeface;
55
import android.util.Log;
66

7-
import com.samsung.microbit.core.GoogleAnalyticsManager;
8-
97
/**
108
* Represents a custom class of the app.
119
* Provides some resources that use along app modules,
@@ -26,7 +24,6 @@ public void onCreate() {
2624
super.onCreate();
2725
app = this;
2826
initTypefaces();
29-
GoogleAnalyticsManager.createInstance(this);
3027

3128
Log.d("MBApp", "App Created");
3229
}

app/src/main/java/com/samsung/microbit/core/DownloadManager.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.samsung.microbit.core;
22

33
import android.util.Log;
4+
import android.webkit.DownloadListener;
45

56
import com.samsung.microbit.utils.IOUtils;
67

@@ -12,8 +13,7 @@
1213
import java.net.URL;
1314
import java.net.URLConnection;
1415

15-
//TODO: consider to use somewhere or remove
16-
public class DownloadManager {
16+
public class DownloadManager implements DownloadListener {
1717

1818
volatile boolean cancelled = false;
1919

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

4545
return objectSize;
4646
}
47+
48+
@Override
49+
public void onDownloadStart(String s, String s1, String s2, String s3, long l) {
50+
Log.v(TAG, s + " " + s1 + " " + s2 + " " + s3 + " " + l);
51+
}
4752
}

0 commit comments

Comments
 (0)