views:

47

answers:

2

Hi,

Iam getting this error on my log

07-06 06:22:07.419: ERROR/AndroidRuntime(2618): java.lang.SecurityException: SECURE PERMISSION: Neither user 10070 nor current process has android.permission.WRITE_SECURE_SETTINGS.

I used like this

in activity file

private static final String SECURE_SETTINGS = android.Manifest.permission.WRITE_SECURE_SETTINGS;
mContext.enforceCallingOrSelfPermission(SECURE_SETTINGS,
        "BLUETOOTH_ADMIN permission");

in manifest file

<uses-permission android:name="android.permission.WRITE_SETTINGS" />  
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />

Why it is giving error.

Please give me solution for this?

Regards, Rajendar Are.

A: 

The WRITE_SECURE_SETTINGS permission is not available to apps which aren't part of the firmware because secure settings are designed to be secured against modification by third party apps.

Al Sutton
How can i useandroid.provider.Settings.Secure.putInt(getContentResolver(), android.provider.Settings.Secure.BLUETOOTH_ON,1); this statement in my code without permissions?
Rajendar
A: 

You can only read this settings if your phone doesn't have root access. To enable bluetooth you can use this references http://developer.android.com/guide/topics/wireless/bluetooth.html.

However, this is above sdk5... I'm not really sure if it is a good idea to use bluetooth with sdk3. I also wanted to do an app which uses bluetooth and I had to switch my target level to above 2.0.1 because bluetooth below this sdk is not supported very well.

Roflcoptr
Iam using firmware version 1.7.7 .In Google i observer this version has some DUN and PAN problemsa and wifi failures.So.first of all i will upgrade my firmware vesion and will use the latest Android SDK version for developement. Thanks
Rajendar