How to set permissions for Android Bluetooth
Solution 1
I'm not quite sure what the problem was here.
All I can say is that I reinstalled Eclipse and its plugins and now everything is working fine. Thanks for your help Mayra - I'll up-mark your answer because of your helpful and friendly approach.
Solution 2
The answer about what to include in your manifest.xml for bluetooth activity includes
<uses-feature android:name="android.hardware.bluetooth" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
The first three are of greater priority and as I'm sure you're aware there are different cases when each dependency may be required. Hope it helps with your setup!
Waqass Karim
Fat and happy. Geekwise, I'm mainly into C, Python, C#, C++ (in that order). In general I work on embedded real-time systems, although I also get to do sysadmin work on a debian server. At home I'm a Ubuntu fan, at work its mainly Win32.
Updated on July 09, 2022Comments
-
Waqass Karim almost 2 years
I'm new to Android development. I'm trying to get a simple HelloWorld app going on my (rooted) phone - and the app is trying to enable Bluetooth.
I've set the Bluetooth permissions in my manifest is as follows, but I'm getting a Permission Denial exception when I try to run the application on my phone via Eclipse:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.helloandroid" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:permission="android.permission.BLUETOOTH_ADMIN"> <activity android:name=".HelloAndroid" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-sdk android:targetSdkVersion="7" android:minSdkVersion="5"></uses-sdk> </manifest>
Is there something obvious I'm missing?