-
Notifications
You must be signed in to change notification settings - Fork 19
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
Bluetooth SCO on Android 14 #1
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,17 @@ buildscript { | |
support_library_version = '25.3.1' | ||
} | ||
repositories { | ||
google() | ||
jcenter() | ||
mavenLocal() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:2.3.2' | ||
classpath 'com.android.tools.build:gradle:8.2.1' | ||
} | ||
} | ||
|
||
repositories { | ||
google() | ||
jcenter() | ||
mavenLocal() | ||
} | ||
|
@@ -24,26 +26,23 @@ def versionBuild = 0 | |
apply plugin: 'com.android.application' | ||
|
||
dependencies { | ||
compile "com.android.support:support-v4:$support_library_version" | ||
compile "com.android.support:appcompat-v7:$support_library_version" | ||
compile "com.android.support:design:$support_library_version" | ||
implementation 'androidx.appcompat:appcompat:1.6.1' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove those other libraries? |
||
} | ||
|
||
android { | ||
compileSdkVersion 24 | ||
buildToolsVersion '25.0.3' | ||
compileSdk 34 | ||
|
||
defaultConfig { | ||
minSdkVersion 19 | ||
targetSdkVersion 22 | ||
minSdkVersion 28 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you raise the |
||
targetSdkVersion 34 | ||
|
||
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild | ||
versionName "${versionMajor}.${versionMinor}.${versionPatch}" | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_7 | ||
targetCompatibility JavaVersion.VERSION_1_7 | ||
sourceCompatibility 11 | ||
targetCompatibility 11 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you raise the Java version to 11? |
||
} | ||
|
||
lintOptions { | ||
|
@@ -58,8 +57,7 @@ android { | |
zipAlignEnabled true | ||
} | ||
} | ||
} | ||
|
||
task wrapper(type: Wrapper) { | ||
gradleVersion = '3.5' | ||
namespace 'com.example.audiorecord' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does that do? |
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Thu Jun 08 09:08:50 CEST 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
package="com.example.audiorecord"> | ||
|
||
<uses-permission android:name="android.permission.RECORD_AUDIO" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
|
||
<!-- Both permissions are required for the Bluetooth HFP recording to work --> | ||
<uses-permission android:name="android.permission.BLUETOOTH" /> | ||
|
@@ -13,11 +12,14 @@ | |
android:icon="@drawable/launcher_icon" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".AudioRecordActivity"> | ||
<activity | ||
android:name=".BluetoothRecordActivity" | ||
android:exported="true"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert. Audio recording, which is demonstrated by |
||
<intent-filter android:label="@string/app_name"> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.example.audiorecord; | ||
|
||
import android.app.Activity; | ||
import android.content.Context; | ||
import android.content.pm.PackageManager; | ||
|
||
import androidx.core.app.ActivityCompat; | ||
|
||
public class RecordPermission { | ||
|
||
|
||
static final int PERMISSIONS_REQUEST_CODE_RECORD_AUDIO = 2024; | ||
|
||
static final String[] RECORDING_PERMISSIONS = { | ||
android.Manifest.permission.RECORD_AUDIO | ||
}; | ||
|
||
public static boolean checkRecordingPermission(Activity acti) { | ||
|
||
boolean hasPermissions = true; | ||
for (String permission : RECORDING_PERMISSIONS) { | ||
if (ActivityCompat.checkSelfPermission(acti.getApplicationContext(), permission) == PackageManager.PERMISSION_DENIED) { | ||
hasPermissions = false; | ||
} | ||
} | ||
|
||
return hasPermissions; | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you are at it, it might make sense to remove
jcenter()
(it no longer exists, see https://jfrog.com/blog/jcenter-sunset/) andmavenLocal()
and addmavenCentral()
instead.