Code example for BluetoothAdapter

Methods: getScanMode

0
	public static void ensureDiscoverable(Context ctx, BluetoothAdapter btAdapter) {
		if (Util.isDebugBuild()) { 
			Log.d(TAG_GENERIC, "ensure discoverable");
		} 
 
		if (btAdapter.getScanMode() != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {
			Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
			discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 3600);
			ctx.startActivity(discoverableIntent);
		} 
	} 
 
	/** 
	 * Get this device's IP address 
	 *  
	 * @return the ip address of this device 
	 */ 
	public static InetAddress getLocalIpAddress() {
		try { 
			String addrToReturn;
Stop searching for code, let great code find you!  Add Codota to your java IDE