// To use these BluetoothAdapter methods, AndroidManifest.xml must have the 
following permission:
//<uses-permission android:name="android.permission.BLUETOOTH"/>

    
// Get the adapter
BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
btAdapter.disable();




// To use this WifiManager method, AndroidManifest.xml must have the 
following permission:
// <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
WifiManager wifiManager = (WifiManager) 
getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(false);

On Thursday, August 16, 2012 12:33:12 AM UTC-5, Jason Hsu wrote:
>
> I have an idea for an app.  In the interest of helping the user conserve 
> battery power, I want to provide the OPTION of disabling battery-draining 
> services like wifi, GPS, Bluetooth, and cellular.
>
> How do I implement this?  Are there good tutorials/examples that implement 
> such functionality?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to