Skip to content

Commit 094edda

Browse files
committed
Merge branch 'bugfix/softap_connection' into 'master'
Improved SoftAP connection workflow and QR code scanning See merge request idf/esp-idf-provisioning-android!34
2 parents 403c787 + 4e8342f commit 094edda

File tree

93 files changed

+2673
-1516
lines changed

Some content is hidden

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

93 files changed

+2673
-1516
lines changed

app/build.gradle

+23-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
apply plugin: 'com.android.application'
22

3+
def getGitHash = { ->
4+
def stdout = new ByteArrayOutputStream()
5+
exec {
6+
commandLine 'git', 'rev-parse', '--short', 'HEAD'
7+
standardOutput = stdout
8+
}
9+
return stdout.toString().trim()
10+
}
11+
312
android {
413

5-
compileSdkVersion 28
14+
compileSdkVersion 29
615

716
defaultConfig {
817
applicationId "com.espressif.wifi_provisioning"
9-
minSdkVersion 24
10-
targetSdkVersion 28
18+
minSdkVersion 23
19+
targetSdkVersion 29
1120
versionCode 6
12-
versionName "2.0"
21+
versionName "2.0.1 - ${getGitHash()}"
1322
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1423
}
1524

@@ -22,8 +31,9 @@ android {
2231
resValue "string", "wifi_base_url", "192.168.4.1:80"
2332
resValue "string", "wifi_device_name_prefix", "PROV_"
2433
resValue "string", "ble_device_name_prefix", "PROV_"
25-
buildConfigField "boolean", "IS_QR_CODE_SUPPORTED", "true"
26-
buildConfigField "boolean", "IS_ALLOWED_FILTERING_BY_PREFIX", "true"
34+
buildConfigField "boolean", "isQrCodeSupported", "true"
35+
buildConfigField "boolean", "isSettingsAllowed", "true"
36+
buildConfigField "boolean", "isFilteringByPrefixAllowed", "true"
2737
}
2838

2939
debug {
@@ -32,8 +42,9 @@ android {
3242
resValue "string", "wifi_base_url", "192.168.4.1:80"
3343
resValue "string", "wifi_device_name_prefix", "PROV_"
3444
resValue "string", "ble_device_name_prefix", "PROV_"
35-
buildConfigField "boolean", "IS_QR_CODE_SUPPORTED", "true"
36-
buildConfigField "boolean", "IS_ALLOWED_FILTERING_BY_PREFIX", "true"
45+
buildConfigField "boolean", "isQrCodeSupported", "true"
46+
buildConfigField "boolean", "isSettingsAllowed", "true"
47+
buildConfigField "boolean", "isFilteringByPrefixAllowed", "true"
3748
}
3849
}
3950
}
@@ -43,14 +54,16 @@ dependencies {
4354
implementation 'androidx.appcompat:appcompat:1.1.0'
4455
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
4556
implementation 'com.google.android.material:material:1.0.0'
46-
implementation 'com.wang.avi:library:2.1.3'
47-
implementation 'org.greenrobot:eventbus:3.1.1'
4857
implementation 'androidx.preference:preference:1.1.1'
4958

5059
implementation 'com.google.protobuf:protobuf-lite:3.0.1'
5160
implementation 'com.google.crypto.tink:tink-android:1.1.0'
5261
implementation project(path: ':provisioning')
5362

63+
implementation 'com.wang.avi:library:2.1.3'
64+
implementation 'org.greenrobot:eventbus:3.1.1'
65+
implementation 'com.budiyev.android:code-scanner:2.1.0'
66+
5467
testImplementation 'junit:junit:4.12'
5568
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
5669
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

app/src/ble/res/drawable/ic_launcher_background.xml

-45
This file was deleted.

app/src/ble/res/drawable/ic_launcher_foreground.xml

-45
This file was deleted.

app/src/ble/res/mipmap-anydpi-v26/ic_launcher.xml

-5
This file was deleted.

app/src/ble/res/mipmap-anydpi-v26/ic_launcher_round.xml

-5
This file was deleted.
-5.28 KB
Binary file not shown.
Binary file not shown.
-5.57 KB
Binary file not shown.
-2.82 KB
Binary file not shown.
Binary file not shown.
-3.42 KB
Binary file not shown.
-6.54 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-12.2 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-15.6 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

app/src/ble/res/values/ic_launcher_background.xml

-4
This file was deleted.

app/src/ble/res/values/strings.xml

-5
This file was deleted.

app/src/main/AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
1313
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
1414
<uses-permission android:name="android.permission.VIBRATE" />
15+
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
1516

1617
<application
1718
android:allowBackup="true"
1819
android:icon="@mipmap/ic_launcher"
1920
android:label="@string/app_name"
20-
android:roundIcon="@mipmap/ic_launcher_round"
2121
android:supportsRtl="true"
2222
android:theme="@style/AppTheme"
2323
android:usesCleartextTraffic="true">
@@ -44,8 +44,8 @@
4444
android:screenOrientation="portrait"
4545
android:theme="@style/AppTheme.NoActionBar" />
4646
<activity
47-
android:name="com.espressif.ui.activities.WiFiProvisionLanding"
48-
android:label="@string/title_activity_provision_landing"
47+
android:name="com.espressif.ui.activities.WiFiConfigActivity"
48+
android:label="@string/title_activity_wifi_config"
4949
android:screenOrientation="portrait"
5050
android:theme="@style/AppTheme.NoActionBar" />
5151
<activity

app/src/main/java/com/espressif/AppConstants.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ public class AppConstants {
2626
public static final String KEY_WIFI_SSID = "ssid";
2727
public static final String KEY_WIFI_PASSWORD = "password";
2828
public static final String KEY_DEVICE_TYPES = "device_types";
29+
public static final String KEY_SECURITY_TYPE = "security_type";
2930

3031
public static final String ESP_PREFERENCES = "Esp_Preferences";
3132

32-
public static final String DEVICE_TYPE_WIFI = "wifi";
33+
public static final String DEVICE_TYPE_SOFTAP = "wifi";
3334
public static final String DEVICE_TYPE_BLE = "ble";
3435
public static final String DEVICE_TYPE_BOTH = "both";
36+
public static final String DEVICE_TYPE_DEFAULT = DEVICE_TYPE_BOTH;
3537
}

0 commit comments

Comments
 (0)