Hi guys,
I thought turning Bluetooth On need a permission, but on my app running on Android 15, it did not ask for permission at all. Run it via Android Studio emulator, caused don't have device with Android 15.
Here are sample of codes
And here is the manifest
If Bluetooth is off, it will turn on automatically. I have device with Andro 10, app will asked permission to Turn On Bluetooth.
So, it is true, that on Android 15 and may be up or low, no need for a permission to turn on Bluetooth?
I thought turning Bluetooth On need a permission, but on my app running on Android 15, it did not ask for permission at all. Run it via Android Studio emulator, caused don't have device with Android 15.
Here are sample of codes
B4X:
Sub Class_Globals
Private Root As B4XView 'ignore
Private Tooth As Toggle
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("lyInp")
Tooth.Initialize
End Sub
Sub B4XPage_Appear
If Tooth.Bluetooth = False Then
ToastMessageShow("Turn Blutooth on", True)
Tooth.TurnBluetoothOn
End If
End Sub
And here is the manifest
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddPermission(android.permission.READ_EXTERNAL_STORAGE)
SetApplicationAttribute(android:usesCleartextTraffic, "true")
AddApplicationText(<meta-data
android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="barcode,,face" />
)
AddApplicationText(
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="$PACKAGE$.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
)
CreateResource(xml, provider_paths,
<files-path name="name" path="shared" />
)
AddPermission(android.permission.REQUEST_INSTALL_PACKAGES)
If Bluetooth is off, it will turn on automatically. I have device with Andro 10, app will asked permission to Turn On Bluetooth.
So, it is true, that on Android 15 and may be up or low, no need for a permission to turn on Bluetooth?