3

I need to turn off the gsm network at my application but enable bluetooth. I know how to change to airplane mode Toggle airplane mode in Android, but is there a way to keep the bluetooth on (I know that them both working on radio signals), I think it's possible on android 4 cause I saw some application that doing it like "Auto Airplane".

I've tried the code below with no help:

Settings.System.putInt(context.getContentResolver(),
                Settings.System.AIRPLANE_MODE_ON,1);
Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
intent.putExtra("state", 1);
context.sendBroadcast(intent);

BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothAdapter.enable();

thank's, david

jwfearn
  • 28,781
  • 28
  • 95
  • 122
BoazGarty
  • 1,410
  • 4
  • 18
  • 38

2 Answers2

0

This shouldn't be possible since airplane mode is design to cut down every signal, which TMHO should includes Bluetooth.

http://en.wikipedia.org/wiki/Airplane_mode

AsTeR
  • 7,247
  • 14
  • 60
  • 99
0

with BLUETOOTH_ADMIN permission It's working, but the Bluethooth section is disabled from the phone settings, the phone is visible to other devics.

BoazGarty
  • 1,410
  • 4
  • 18
  • 38