[android-developers] Pair and connect Bluetooth Device with Android phone targeting API 14+

2015-06-03 Thread archfiend
New to Bluetooth and BT APIs in android.

Trying to pair a bluetooth gamepad controller [HID profile] to my device 
programatically:

Tried reflections after going through code of the Setting app:

//pairing
public boolean createBond(BluetoothDevice btDevice)
throws Exception
{
Class class1 = Class.forName("android.bluetooth.BluetoothDevice");
Method createBondMethod = class1.getMethod("createBond");
Boolean returnValue = (Boolean) createBondMethod.invoke(btDevice);
return returnValue.booleanValue();
}



--


//connecting   
public boolean createBTConnection(BluetoothProfile proxy, 
BluetoothDevice btDevice)
{
Boolean returnValue = false;
Class class1 = null;
try {
class1 = 
Class.forName("android.bluetooth.BluetoothInputDevice");
Method createConnectionMethod = class1.getMethod("connect", new 
Class[] {BluetoothDevice.class});
returnValue = (Boolean) createConnectionMethod.invoke(proxy, 
btDevice);
} catch (...) {}
return returnValue.booleanValue();
}

BluetoothProfile.ServiceListener mProfileListener = new 
BluetoothProfile.ServiceListener() {
@Override
public void onServiceConnected(int profile, BluetoothProfile proxy) 
{
//4 == BluetoothInputDevice
if (profile == 4) {
createBTConnection(proxy, btDevice);
//doesnot connect ):
...
}
}

@Override
public void onServiceDisconnected(int profile) {
...
}
};


--


Getting paired but not connected.

Any pointers appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Enabling Google+ login in two different developer console accounts for the same application

2015-06-03 Thread developer
Hi All,

We have published our application in Google Play using a developer console 
account.  This is the official account for our application.

Later, when one of our developers integrating Google+ login has enabled 
Google+ Login API in his own developer console account.  He registered our 
application package by providing SHA1 (generated with our application's 
signed key) in his account.  After the Google+ login feature implemented, 
we have also published later versions to Google Play using our official 
account only.

Now, we want to disable this Google+ login API for our application package 
from his account and rather we want to enable this Google+ login API from 
our official account by using the same SHA1(generated with our 
application's signed key).  Is this possible?  If yes, please guide me on 
how to do this and any existing users gets affected?

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.