Skip to content

Commit

Permalink
Merge pull request #183 from martinohanlon/dev
Browse files Browse the repository at this point in the history
Android v 2.2.1
  • Loading branch information
Martin O'Hanlon authored Jan 3, 2023
2 parents f018472 + 360733d commit 208163e
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 39 deletions.
4 changes: 2 additions & 2 deletions clients/android/.idea/gradle.xml

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

2 changes: 1 addition & 1 deletion clients/android/.idea/misc.xml

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

9 changes: 0 additions & 9 deletions clients/android/.idea/modules.xml

This file was deleted.

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

This file was deleted.

25 changes: 17 additions & 8 deletions clients/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
buildToolsVersion '29.0.2'
compileSdkVersion 33
defaultConfig {
applicationId "com.stuffaboutcode.bluedot"
minSdkVersion 14
targetSdkVersion 29
versionCode 8
versionName "2.1.0"
targetSdkVersion 33
versionCode 10
versionName "2.2.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -21,11 +20,21 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.preference:preference:1.1.0-alpha05'
implementation 'androidx.preference:preference:1.2.0'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.12'
}

configurations {

all {

exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'

}

}
Binary file modified clients/android/app/release/app-release.aab
Binary file not shown.
Binary file modified clients/android/app/release/app-release.apk
Binary file not shown.
20 changes: 20 additions & 0 deletions clients/android/app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.stuffaboutcode.bluedot",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 10,
"versionName": "2.2.1",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}
1 change: 0 additions & 1 deletion clients/android/app/release/output.json

This file was deleted.

10 changes: 8 additions & 2 deletions clients/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.stuffaboutcode.bluedot">

<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />/>
<uses-permission android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />

<application
android:allowBackup="true"
Expand All @@ -13,6 +17,7 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:exported="true"
android:name=".SettingsActivity"
android:label="@string/title_activity_settings"
android:parentActivityName=".Devices">
Expand All @@ -21,6 +26,7 @@
android:value="com.stuffaboutcode.bluedot.Devices" />
</activity>
<activity
android:exported="true"
android:name=".Devices"
android:configChanges="orientation|screenSize">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.stuffaboutcode.bluedot;

import androidx.appcompat.app.AppCompatActivity;

import android.content.pm.PackageManager;
import android.os.Bundle;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
Expand All @@ -16,8 +18,11 @@
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

import androidx.core.app.ActivityCompat;
import androidx.preference.PreferenceManager;
import android.content.SharedPreferences;
import android.Manifest;

import java.util.Set;
import java.util.ArrayList;
Expand All @@ -34,13 +39,33 @@ public class Devices
public static String EXTRA_ADDRESS = "device_address";
public static String EXTRA_NAME = "device_name";

private static String[] PERMISSIONS = {
Manifest.permission.BLUETOOTH_SCAN,
Manifest.permission.BLUETOOTH_CONNECT,

};

private void checkPermissions(){
int permission = ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_CONNECT);
if (permission != PackageManager.PERMISSION_GRANTED) {
// We don't have permission so prompt the user
ActivityCompat.requestPermissions(
this,
PERMISSIONS,
1
);
}
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_devices);

devicelist = (ListView)findViewById(R.id.listView);

checkPermissions();

//if the device has bluetooth
myBluetooth = BluetoothAdapter.getDefaultAdapter();

Expand Down
2 changes: 1 addition & 1 deletion clients/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.android.tools.build:gradle:7.3.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
6 changes: 3 additions & 3 deletions clients/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Dec 27 12:07:06 GMT 2019
#Fri Dec 23 09:57:24 GMT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
10 changes: 10 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ Alpha - initial testing
Android app
-----------

10 (2.2.1) - 2022-01-03
~~~~~~~~~~~~~~~~~~~~~~~~

* Android 12+ fixes

9 (2.2) - 2022-12-23
~~~~~~~~~~~~~~~~~~~~~~~~

* Android SDK and API version uplift (due to google play store minimum requirements change)

8 (2.1) - 2020-12-28
~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 208163e

Please sign in to comment.