[android-developers] Bluetooth OOB Pairing: Problem when using a Heart Rate Profile

2019-10-10 Thread Olivier L
I'm doing Out Of Band (= OOB) Bluetooth Pairing through NFC. 
I have a Bluetooth LE Device which has an NFC tag containing the 
information for OOB Pairing. When the user taps the NFC tag with its 
smartphone, it should do the Bluetooth pairing between the device and the 
phone. When the pairing is done, we want our application to be started and 
to display the data received through Bluetooth (ex: a Heart Rate graph).
The Android Application uses a Broadcast Receiver to monitor the event 
BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED. By this way, it can be 
notified when a Bluetooth device is connected. If this BT device has the 
expected name, it will open the application.

I’m contacting you today because it works well if my Bluetooth Device 
implements a HID Profile but it doesn't work if I use another profile like 
a Heart Rate Profile (we have tested many profiles). I don't know if this 
is a bug or if it is intended.

As a workaround, I have put the 2 profiles (HID + Heart Rate) in my 
Bluetooth device and then it works. When I tap the NFC tag, the Bluetooth 
connection is setup (it uses the OOB information contained in the tag), my 
application is started and it starts displaying the Heart Rate Data.

Is it a normal that OOB Pairing doesn’t work if I use a profile like Heart 
Rate profile?

For my tests, I‘ve used a Pixel 3 phone with Android 9 and a Nexus 6P with 
Android 8.1

Thank you

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/87b93fe0-34c1-4d56-bf79-2b3666e960f4%40googlegroups.com.


[android-developers] Bluetooth

2017-08-09 Thread westpoint16835
There are currently issues with certain GM vehicles primarily 2014-2016 GMC 
Acadia and Buick Enclave. The main areas are voice recognition not 
recognizing contact names and contact lists not displaying on the vehicle 
screen which happens unexpectedly and is not so intermittent. I am posting 
the message on this list to see if I can get a response or a a method to 
escalate the problem. Phones being paired range from 2 years ago to the 
latest including Galaxy S8. If anyone may have a solution I can provide 
more information.

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/1bc2834e-d86f-4967-9b91-c4c9436e1c48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth At commands

2017-01-31 Thread Ivan Kuzlo
i'm writing app for detect battery level of Bluetooth device(headset) 
i want to listen Bluetooth data c and get data from it
many many Bluetooth headsets sent to device their battery level
<
01-31 21:56:43.059 21082-7393/com.android.bluetooth E/bt-rfcomm: 
PORT_DataInd, p_port:0xa2d0d8c4, p_data_co_callback is null
01-31 21:56:43.060 21082-7393/com.android.bluetooth D/bt-btif: 
bta_ag_hdl_event: p_scb 0xa2d15024 
01-31 21:56:43.060 21082-7393/com.android.bluetooth D/bt-btif: AG evt (hdl 
0x0001): State 2, Event 0x050b
01-31 21:56:43.060 21082-7361/com.android.bluetooth D/bt-btif: 
btif_hf_upstreams_evt: event=BTA_AG_AT_UNAT_EVT
01-31 21:56:43.062 21082-7373/com.android.bluetooth D/HeadsetStateMachine: 
Connected process message: 101, size: 1
01-31 21:56:43.062 21082-7373/com.android.bluetooth D/HeadsetStateMachine: 
event type: 15event device : 20:74:CF:06:48:2F
01-31 21:56:43.062 21082-7373/com.android.bluetooth E/HeadsetStateMachine: 
processVendorSpecificAt: unsupported command: +IPHONEACCEV=2,1,4,2,0
01-31 21:56:43.062 21082-7373/com.android.bluetooth D/bt-btif: BTHF: 
at_response
01-31 21:56:43.066 21082-7393/com.android.bluetooth D/bt-btif: 
bta_ag_api_result: p_scb 0xa2d15024 
01-31 21:56:43.066 21082-7393/com.android.bluetooth D/bt-btif: AG evt (hdl 
0x0001): State 2, Event 0x0506
01-31 21:56:43.066 21082-7393/com.android.bluetooth D/bt-btif: 
bta_ag_hfp_result : res = 20
 
i'm interesting in  +IPHONEACCEV=2,1,4,2,0
but i cant get it anywhere
how i can do this?


-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/c9f1e152-3bcb-457e-a24c-464cc2aad26f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth Low Energy (4.0) on android 4.4 device.

2016-10-14 Thread Александр Сергеевич Джус
Hello, I want to use Bluetooth 4.0 to connect the Vert device. The problem 
is,that I have android 4.4, but your official example is based on android 
6.0.  I rebuilded this  example to work on my device, it starts  with 
problems (I can connect and  get BleService(s)/BleCharacteristic(s), but 
haracteristic.getValue("...") always null ).  So can you say what is wrong, 
and what should I do to get Vert's values ?  

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/e074ac4d-faca-40c5-9518-84d635707fd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] bluetooth connect() randomly refuses to connect and gives a timeout / throws exception.

2016-09-26 Thread Bernd Porr
I'm connecting to an RN42 bluetooth module which does a standard rfcomm 
protocol with the standard SPP UID.

The problem is that connect times out sometimes and sometimes it doesn't.

How to 'reproduce':

1) do a standard connect() to get a socket
2) connect() times out and throws an exception
3) wait a bit (1 - 10 sec)
4) do another connect() and it works

It doesn't matter if it's a secure, insecure or the secret hidden API call 
to connect() without uuid.

Sometimes it works straight away and then perhaps for a day but the API 
certainly "feels" when I present the program to a potential customer and it 
decides not to connect. ;)

Here is my code which mininises it by essentially just trying connect() a 
couple of times. Ugly, but it works sort of. Adding a delay, trying to 
connect again and usually it works at the 2nd attempt but sometimes even 
all attempts fail. Then I restart the program and it works at the 1st or 
2nd attempt. I know that loads of people report the same problem and some 
have theories that it's only on an HTC but not on other devices etc. I can 
confirm the problem is on both a Nexus 7 and on a Sony Z3. Both run 6.0.1 
and API 23.

Any feedback would be very welcome so that I can get rid of this cascase of 
connects. 

Best
/Bernd

if (bluetoothDevice == null) return;
// Get a BluetoothSocket to connect with the given BluetoothDevice
try {
mmSocket = 
bluetoothDevice.createInsecureRfcommSocketToServiceRecord(uuid);
} catch (Exception ex) {
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Could not get rfComm socket:", ex);
}
try {
mmSocket.close();
} catch (Exception closeExeption) {
}
;
mmSocket = null;
messageListener.haveMessage(MESSAGE_ERROR);
return;
}

if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "Got rfComm socket!");
}

try {
sleep(100);
} catch (Exception esleep) {
}
;

if (mmSocket != null) {
try {
if (mmSocket != null) {
mmSocket.connect();
}
} catch (IOException connectException) {

// connection failed
messageListener.haveMessage(MESSAGE_RETRY);

try {
mmSocket.close();
} catch (IOException e1) {}

// let's just wait a bit
try {
sleep(100);
} catch (InterruptedException e1) {}

// let's try to connect
try {
if (mmSocket != null) {
mmSocket.connect();
}
} catch (IOException e2) {

try {
sleep(100);
} catch (InterruptedException e3) {
}

try {
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Last resort: we try the hidden API");
}
mmSocket.close();
mmSocket = null;
Method createMethod = bluetoothDevice.getClass().
getMethod("createInsecureRfcommSocket", new 
Class[]{int.class});
mmSocket = (BluetoothSocket) 
createMethod.invoke(bluetoothDevice, 1);
} catch (Exception e) {
if (Log.isLoggable(TAG, Log.ERROR)) {
Log.e(TAG, "Could not get non-UUID based bluetooth 
socket!", e);
}
mmSocket = null;
return;
}

try {
sleep(100);
} catch (InterruptedException e3) {
}

try {
if (mmSocket != null) {
mmSocket.connect();
}
} catch (IOException e4) {

try {
mmSocket.close();
mmSocket = null;
} catch (IOException e) {
}

connectionEstablished = false;
fatalError = true;
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Could not establish connection to Attys: " +
e4.getMessage());
}
messageListener.haveMessage(MESSAGE_ERROR);

return;
}
}
}
connectionEstablished = true;
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "Connected to socket!");
}
}
}





/Bernd

-- 
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.
To post to this group, send email to 

[android-developers] Bluetooth headset management with VOIP App using OpenSL ES

2016-07-29 Thread Claude Chausse-ccr
I am working on a VOIP application that is doing audio Streaming using 
openSL. 

I cannot get any bluetooth Headset audio to work properly. 

AudioManager mode is set to MODE_IN_COMMUNICATION, I request audio focus 
with AudioManager.STREAM_VOICE_CALL, OpenSL playback configuration stream 
type is set to SL_ANDROID_STREAM_VOICE, and the recording preset is 
configured with SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION.

I also use device optimal samplingrate and buffersize. 

Everything works fine in speaker mode, with wired headset but when I 
connect a bluetooth headset I usually get audio playback for the microphone 
(input stream) is not working.  

For bluetooth, I call startBluetoothSco() when I detect a headset using 
BroadcastReceiver. (I also tried to use setBluetoothScoOn(true) but I am 
not sure I understand what it means. 

When I connect a Watch it is even worst because the Because I get Audio 
state to connect and immediatly after it disconnects and I get no audio 
even in playback. 

I am really out of ideas to fix that. 

Anyone has made a Voip App that is able to properly manage audio headsets 
dynamic changes. 


-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/bb2ce3ae-d90a-4d7e-baf8-e1f2b17cc0bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth iPhone MFI registration android equivalent for auto launch

2016-07-11 Thread HugeRay
Hi all,

Apple has a registration process that allows bluetooth accessories to start 
associated apps on pairing. In other words, there is no need for the user 
to manually start the app. All the user needs to do is pair the bluetooth 
accessory and the associated app auto launches. Is there an Android 
equivalent?

As I understand it, all Android apps are in a "stopped" state when first 
installed and requires the user to manually launch the app as no broadcast 
receivers are invoked in this state. So, there's no way of starting the app 
through an intent filter unless the app is already running.

Thank you in advance.

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/1d1d1cd1-7f1d-42ca-9642-c078529fc4eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth pair table size

2016-06-16 Thread ed
I am writing an Android phone application that will only talk to one BLE 
device at a time. It will, however, be used over a wide physical area and 
there could be many paired/bonded devices, even if only one is accessed at 
a time. Is there a size limit to the table used to store information about 
these devices?

Ed

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/8f94b7be-c50c-4b9e-8d00-7c87a6f0a8fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth Discoverability Issue

2016-06-16 Thread AdamK
Hey All,

I seem to be having some issue with the following code, following some 
tutorials on you tube and following the android Bluetooth documentation I 
have created the following which works except that it does not find any 
Bluetooth devices?

package com.company.bluetoothconnect;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import java.lang.reflect.Method;
import java.util.Set;

public class Main extends AppCompatActivity {
/** Called when the activity is first Created. */
protected static final int DISCOVERY_REQUEST = 1;

public TextView statusUpdate;
public Button connect;
public Button disconnect;

String toastText = "";

private BluetoothAdapter btAdapter;
private BluetoothDevice remoteDevice;

BroadcastReceiver bluetoothState = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
//String prevSateExtra=BluetoothAdapter.EXTRA_PREVIOUS_STATE;
String stateExtra= BluetoothAdapter.EXTRA_STATE;
int state = intent.getIntExtra(stateExtra, -1);
//int previousState = intent.getIntExtra(prevSateExtra, -1);

switch (state){
case(BluetoothAdapter.STATE_TURNING_ON):
{
toastText = "Bluetooth Turning On";
Toast.makeText(Main.this, toastText, 
Toast.LENGTH_SHORT).show();
break;
}
case (BluetoothAdapter.STATE_ON) :
{
toastText = "Bluetooth On";
Toast.makeText(Main.this, toastText, 
Toast.LENGTH_SHORT).show();
setupUI();
break;
}
case (BluetoothAdapter.STATE_TURNING_OFF) :
{
toastText = "Bluetooth turning off";
Toast.makeText(Main.this, toastText, 
Toast.LENGTH_SHORT).show();
break;
}
case (BluetoothAdapter.STATE_OFF) :
{
toastText = "Bluetooth off";
Toast.makeText(Main.this, toastText, 
Toast.LENGTH_SHORT).show();
break;
}
}
}
};

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setupUI();
}//end onCreate

@Override
protected void onStop()
{
unregisterReceiver(bluetoothState);
unregisterReceiver(discoveryResult);
super.onStop();
}

private void setupUI() {
//get references
final TextView statusUpdate =(TextView) findViewById(R.id.result);
final Button connect =(Button) findViewById(R.id.btnConnect);
final Button disconnect =(Button) findViewById(R.id.btnDisconnect);

//set visibility
connect.setVisibility(View.GONE);
disconnect.setVisibility(View.GONE);
btAdapter = BluetoothAdapter.getDefaultAdapter();

if(btAdapter.isEnabled()){
String address = btAdapter.getAddress();
String name = btAdapter.getName();
String statusText = name + " : " + address;

statusUpdate.setText(statusText);
disconnect.setVisibility(View.VISIBLE);
} else {
connect.setVisibility(View.VISIBLE);
statusUpdate.setText("Bluetooth is not on");
}

connect.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent discoverableIntent = new 
Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);

discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);
startActivityForResult(discoverableIntent, DISCOVERY_REQUEST);
}
});//end connect onClickListner

disconnect.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
btAdapter.disable();
disconnect.setVisibility(View.GONE);
connect.setVisibility(View.VISIBLE);
statusUpdate.setText("BlueTooth Off");
}
});//end disconnect onClickListner
}//end setupUI

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent 
data) {

[android-developers] Bluetooth scan for available devices

2016-06-14 Thread 'nick oliver' via Android Developers
I am trying to scan for available devices but the scan does not seem to 
find any devices. The app works and displays using Toast when the discovery 
starts and finishes but doesnt show a device, the turning on & off of BT 
works as well as displaying the paired devices.. I know there are available 
devices as the scan in settings show that they are there. I followed quite 
a few tutorials (this is my 6th attempt) and each of them come out with 
something similar which doesnt work. I have been to the play store and 
downloaded 8 different bluetooth scanners and only 50% of them actually 
worked.

I am using a Samsung S6 for testing and development. My goal is to find and 
connect to certain devices for communication and control but i want to be 
able to scan for them first.
Can anyone spot/see anything in the code which could cause it not to work 
or something I have missed?

MainActivity.java

public class MainActivity extends Activity {
private Button bluetoothOn;
private Button bluetoothOff;
private Button bluetoothScan;
private Button bluetoothPaired;
private BluetoothAdapter myBluetoothAdapter;
private ArrayAdapter btArrayAdapter;
private ListView listDevicesFound;
private SetpairedDevices;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

bluetoothOn= (Button)findViewById(R.id.btnOn);
bluetoothOff= (Button)findViewById(R.id.btnOff);
bluetoothPaired = (Button)findViewById(R.id.btnPaired);
bluetoothScan = (Button)findViewById(R.id.btnScan);

listDevicesFound = (ListView)findViewById(R.id.devicesfound);
btArrayAdapter = new ArrayAdapter(MainActivity.this, 
android.R.layout.simple_list_item_1);
btArrayAdapter.setNotifyOnChange(true);
myBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
listDevicesFound.setAdapter(btArrayAdapter);

registerReceiver(myBluetoothReceiver, new 
IntentFilter(BluetoothDevice.ACTION_FOUND));
}

public void scanonClick(View v) {
// TODO Auto-generated method stub
btArrayAdapter.clear();
myBluetoothAdapter.startDiscovery();
}

public void btonClick(View v) {
// TODO Auto-generated method stub
if (!myBluetoothAdapter.isEnabled()) {
Intent turnOn = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(turnOn, 0);
Toast.makeText(getApplicationContext(),"Turned on"
,Toast.LENGTH_LONG).show();
}
else {
Toast.makeText(getApplicationContext(), "Already on",
Toast.LENGTH_LONG).show();
}
}

public void btoffClick(View v) {
// TODO Auto-generated method stub
myBluetoothAdapter.disable();
Toast.makeText(getApplicationContext(),"Turned off" ,
Toast.LENGTH_LONG).show();
}

public void paironClick(View v) {
// TODO Auto-generated method stub
pairedDevices = myBluetoothAdapter.getBondedDevices();

@SuppressWarnings("rawtypes")
ArrayList list = new ArrayList();
for(BluetoothDevice bt : pairedDevices)
list.add(bt.getName());

Toast.makeText(getApplicationContext(),"Showing Paired Devices",
Toast.LENGTH_SHORT).show();
@SuppressWarnings("rawtypes")
final ArrayAdapter adapter = new 
ArrayAdapter(MainActivity.this,android.R.layout.simple_list_item_1, list);
listDevicesFound.setAdapter(adapter);
}

private final BroadcastReceiver myBluetoothReceiver = new BroadcastReceiver(){

@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
String action = intent.getAction();
if(BluetoothDevice.ACTION_FOUND.equals(action)) {
BluetoothDevice device = 
intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
btArrayAdapter.add(device.getName() + "\n" + device.getAddress());
btArrayAdapter.notifyDataSetChanged();
Toast.makeText(getApplicationContext(), "Run 
G",Toast.LENGTH_LONG).show();
}
}};

@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
unregisterReceiver(myBluetoothReceiver);
}
}



-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/1f34cb3e-5782-4ca5-ad76-3d62e465ac68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth scanning not returning results (On self made app)

2016-06-10 Thread tartaarsap


I've been having some problems getting Bluetooth to scan for devices with 
my Samsung Galaxy s5. (I have added my code in the attachment file )

I'm on Android 6.0 and have set up permissions for my app to scan like so:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
// Android M Permission check
if 
(this.checkSelfPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION) 
!= PackageManager.PERMISSION_GRANTED) {
final AlertDialog.Builder builder = new 
AlertDialog.Builder(this);
builder.setTitle("This app needs location access");
builder.setMessage("Please grant location access so this app 
can devices.");
builder.setPositiveButton(android.R.string.ok, null);
builder.setOnDismissListener(new 
DialogInterface.OnDismissListener() {

public void onDismiss(DialogInterface dialog) {
requestPermissions(new 
String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, 
PERMISSION_REQUEST_COARSE_LOCATION);
}
});

builder.show();
}

I assume this is working correctly because I got the pop-up asking for 
permissions which I accepted.

My scan function:

private void scanLeDevice(final boolean enable) {
if (enable) {
// Stops scanning after a pre-defined scan period.
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
mScanning = false;
Log.i("start" , "Stopping scan...");
mBluetoothLeScanner.stopScan(mScanCallback);
}
}, SCAN_PERIOD);

mScanning = true;
Log.i("start" , "Starting scan...");
mBluetoothLeScanner.startScan(mScanCallback);
} else {
mScanning = false;
mBluetoothLeScanner.stopScan(mScanCallback);
}

}

Now it stops and starts scanning correctly since Logcat is giving me logs. 
But it's just not finding any devices which is really weird because I'm 
sitting next to my laptop and a second phone both with Bluetooth enabled.

Here's my callback by the way, if anyone is interested:

Private ScanCallback mScanCallback = new ScanCallback() {

@Override
public void onScanResult(int callbackType, ScanResult result) {
System.out.println("BLE// onScanResult");
Log.i("callbackType", String.valueOf(callbackType));
Log.i("result", result.toString());
BluetoothDevice btDevice = result.getDevice();
}

@Override
public void onBatchScanResults(List results) {
System.out.println("BLE// onBatchScanResults");
for (ScanResult sr : results) {
Log.i("ScanResult - Results", sr.toString());
}
}

@Override
public void onScanFailed(int errorCode) {
System.out.println("BLE// onScanFailed");
Log.e("Scan Failed", "Error Code: " + errorCode);
}};

Now as you can see the scan is not failing since Logcat is not giving me a 
scan failed log, but apperantly its also not finding any devices...

Logcat:

06-07 17:13:02.622 16802-16802/com.example.joey.findmycar I/start: Starting 
scan...06-07 17:13:02.802 16802-16802/com.example.joey.findmycar 
W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode 
(without mOwningView)06-07 17:13:02.882 16802-16802/com.example.joey.findmycar 
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@c8fddba 
time:69966657106-07 17:13:14.632 16802-16802/com.example.joey.findmycar 
I/start: Stopping scan...

I've added the correct permissions to my Manifest:



I've tried almost every possibility and am starting to think the Bluetooth 
on my phone might be broken somehow, which is weird because I can manually 
detect and connect to devices in the Android settings.

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/bbfb7bfc-9e79-41ea-bf0a-d87effc761e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


bluetoothscanner
Description: Binary data


[android-developers] Bluetooth scanning not returning results (On self made app)

2016-06-10 Thread tartaarsap

0down votefavorite 


I've been having some problems getting Bluetooth to scan for devices with 
my Samsung Galaxy s5.

I'm on Android 6.0 and have set up permissions for my app to scan like so:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
// Android M Permission check
if 
(this.checkSelfPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION) 
!= PackageManager.PERMISSION_GRANTED) {
final AlertDialog.Builder builder = new 
AlertDialog.Builder(this);
builder.setTitle("This app needs location access");
builder.setMessage("Please grant location access so this app 
can devices.");
builder.setPositiveButton(android.R.string.ok, null);
builder.setOnDismissListener(new 
DialogInterface.OnDismissListener() {

public void onDismiss(DialogInterface dialog) {
requestPermissions(new 
String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, 
PERMISSION_REQUEST_COARSE_LOCATION);
}
});

builder.show();
}

I assume this is working correctly because I got the pop-up asking for 
permissions which I accepted.

My scan function:

private void scanLeDevice(final boolean enable) {
if (enable) {
// Stops scanning after a pre-defined scan period.
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
mScanning = false;
Log.i("start" , "Stopping scan...");
mBluetoothLeScanner.stopScan(mScanCallback);
}
}, SCAN_PERIOD);

mScanning = true;
Log.i("start" , "Starting scan...");
mBluetoothLeScanner.startScan(mScanCallback);
} else {
mScanning = false;
mBluetoothLeScanner.stopScan(mScanCallback);
}

}

Now it stops and starts scanning correctly since Logcat is giving me logs. 
But it's just not finding any devices which is really weird because I'm 
sitting next to my laptop and a second phone both with Bluetooth enabled.

Here's my callback by the way, if anyone is interested:

Private ScanCallback mScanCallback = new ScanCallback() {

@Override
public void onScanResult(int callbackType, ScanResult result) {
System.out.println("BLE// onScanResult");
Log.i("callbackType", String.valueOf(callbackType));
Log.i("result", result.toString());
BluetoothDevice btDevice = result.getDevice();
}

@Override
public void onBatchScanResults(List results) {
System.out.println("BLE// onBatchScanResults");
for (ScanResult sr : results) {
Log.i("ScanResult - Results", sr.toString());
}
}

@Override
public void onScanFailed(int errorCode) {
System.out.println("BLE// onScanFailed");
Log.e("Scan Failed", "Error Code: " + errorCode);
}};

Now as you can see the scan is not failing since Logcat is not giving me a 
scan failed log, but apperantly its also not finding any devices...

Logcat:

06-07 17:13:02.622 16802-16802/com.example.joey.findmycar I/start: Starting 
scan...06-07 17:13:02.802 16802-16802/com.example.joey.findmycar 
W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode 
(without mOwningView)06-07 17:13:02.882 16802-16802/com.example.joey.findmycar 
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@c8fddba 
time:69966657106-07 17:13:14.632 16802-16802/com.example.joey.findmycar 
I/start: Stopping scan...

I've added the correct permissions to my Manifest:



I've tried almost every possibility and am starting to think the Bluetooth 
on my phone might be broken somehow, which is weird because I can manually 
detect and connect to devices in the Android settings.

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/15efd8a7-aba9-4389-87f7-080393727a29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth streaming and browsing media

2016-06-09 Thread Mike D
I'm writing a new media app that plays music from the Internet, and I'm 
trying to use this app in my new car which supports Android Auto and also 
Bluetooth audio streaming.  On my head unit, I have a media button that 
enables the bluetooth stream.  I can play music in my app and it plays 
through the head unit just fine.  My problem is that the display on my head 
unit has a 'Browse' button, and when I select it, I'm assuming it should 
show me a listing of the songs that the player knows about.  Instead I just 
get a 'No content' message.

I'm now thinking that my assumption is incorrect and that there is no way 
to browse the media over Bluetooth.  Is that correct?

When I hook up via USB and launch Android Auto, my player appears and I can 
browse the media through Android Auto just fine.  I just wish Android Auto 
could work wirelessly because I hate having the USB cable connected all the 
time.  It's a hazard while driving and, having to spend 2 hours in the car 
every day, it's sort of hard on the phone battery since it's constantly 
draining and charging during those times. (And my Samsung GS6 doesn't have 
an easily replaceable battery, boo!)

So, my question is, is it possible to browse media files over Bluetooth? 
 Or am I chasing an impossible dream?

Thanks for any and all assistance.

Mike

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/285f312e-2600-4d2d-b39e-e42b520fff22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth LE Characteristics and Services Design Question

2016-04-13 Thread quique123
Im building an Android app to interface Arduino with a BLE module from 
HMSoft10.

I found a tutorial online for an android app and it takes care of the 
connectivity and it uses 3 seekbars to send information from the android 
app to the BLE module.  So far because the app sends 3 values, 1 for each 
seek bar, the class has an array declared as int[]:

private int[] RGBFrame = {0,0,0};
// Then it creates variables to hold the values
private SeekBar mRed,mGreen,mBlue;
//Then it accesses those components from the view
mRed = (SeekBar) findViewById(R.id.seekRed);
mGreen = (SeekBar) findViewById(R.id.seekGreen);
mBlue = (SeekBar) findViewById(R.id.seekBlue);
//Finally it sends the component's value to a method that parses the data
readSeek(mRed,0);
readSeek(mGreen,1);
readSeek(mBlue,2);



Because I need to increase the seek bars to a total of 6 (one for each pwm 
pin), I redeclared the array as:

private int[] RGBFrame = {0,0,0,0,0,0};


But now I need to also account for 12 buttons for the 12 pins without PWM. 
 Although I could add 12 more items to that array, it might get confusing. 
 So I was thinking of a creating a second array for the buttons.  But this 
would mean I need a new BLE characteristic to be able to accomodate the 
other data array, right?

Im considering declaring a new characteristic in order to write the second 
array for the buttons, to my device.  So here is what I know, the 
SampleGattAttributes.java defines my Device, Services and Characteristics 
like so:

public class SampleGattAttributes {
private static HashMap attributes = new HashMap();
//Our device config UUID string???  

public static String CLIENT_CHARACTERISTIC_CONFIG = 
"2902--1000-8000-00805f9b34fb";
//Our device UUID string???
public static String HM_10_CONF = "ffe0--1000-8000-00805f9b34fb";

//Our characteristic UUID string
public static String HM_RX_TX = "ffe1--1000-8000-00805f9b34fb";

static {
// Sample Services.
attributes.put("ffe0--1000-8000-00805f9b34fb", "HM 10 Serial");
attributes.put("1800--1000-8000-00805f9b34fb", "Device 
Information Service");

// Sample Characteristics.
attributes.put(HM_RX_TX,"RX/TX data");
attributes.put("2a29--1000-8000-00805f9b34fb", "Manufacturer 
Name String");
}

public static String lookup(String uuid, String defaultName) {
String name = attributes.get(uuid);
return name == null ? defaultName : name;
}
}


Im unclear as to what all the UUIDs are for.  I know I should have one for 
the BLE module, one for a Service and one for a characteristic. I see that 
the Charactersitic UUID is static coded.  But Im not sure what the other 2 
statically declared UUIDs are.  Then the code creates 2 service UUIDs and 2 
characteristic UUIDs.

Q1.  What are the CLIENT_CHARACTERISTIC_CONFIG & HM_10_CONF UUIDs?
Q2.  Are the 2 UUIDs for services completely unrelated, or are they in 
pairs for a reason?
Q3.  What would I need to do to create another characteristic to 
communicate the buttons array since the seeks bar array is moving data via 
HM_RX_TX.

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/f5ff0743-9e6e-49c5-9564-53691e52936e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] bluetooth api

2016-04-02 Thread sardar khan
can you please send me the logcat details about the errors..so i can figure
out what the problem is

On Sat, Apr 2, 2016 at 8:57 PM, fbm fatma 
wrote:

> hi all, i want to display the list of bounded devices with the android
> bluetooth api , but i don't know why in this code when i run it in my
> device no toast is displayed by the way toast will conatain name of each
> device  .who  can help me ? and thx in advance :)
> this is the code
>
> package com.example.fatma.cst;
> import android.bluetooth.BluetoothAdapter;import 
> android.bluetooth.BluetoothDevice;import android.content.Intent;import 
> android.os.Bundle;import android.support.v7.app.AppCompatActivity;import 
> android.widget.TextView;import android.widget.Toast;
> import java.util.Set;import java.util.Vector;
> public class MainActivity extends AppCompatActivity {
> TextView txt = null;
> private static final int REQUEST_ENABLE_BT = 1;
>
> @Override
> protected void onCreate(Bundle savedInstanceState) {
>
> final Vector mArrayAdapter = null;
> super.onCreate(savedInstanceState);
> setContentView(R.layout.activity_main);
>
> BluetoothAdapter 
> bluetoothAdapter=BluetoothAdapter.getDefaultAdapter();
>
> if(bluetoothAdapter==null){
> Toast t=new Toast(this);
> t.setText("Sorry your phone do not support Bluetooth");
> t.show();
> }
> else
> {
> if (!bluetoothAdapter.isEnabled()) {
> Intent enableBtIntent = new 
> Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
> startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
> }
>
> if(REQUEST_ENABLE_BT!=0) {
>
>
>
> /* bluetoothAdapter.startDiscovery();
> BroadcastReceiver mReceiver = new BroadcastReceiver() {
> public void onReceive(Context context, Intent intent) {
> String action = intent.getAction();
>
> //Finding devices
> if (BluetoothDevice.ACTION_FOUND.equals(action)) {
> // Get the BluetoothDevice object from the Intent
> BluetoothDevice device = 
> intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
> // Add the name and address to an array adapter 
> to show in a ListView
> mArrayAdapter.add(device.getName() + "\n" + 
> device.getAddress());
>
>
>
> }
> }
>
> };*/
>
> //IntentFilter filter = new 
> IntentFilter(BluetoothDevice.ACTION_FOUND);
>// registerReceiver(mReceiver, filter);
>Set devices;
>
> devices = bluetoothAdapter.getBondedDevices();
> for (BluetoothDevice blueDevice : devices) {
> Toast.makeText(this, "Device = " + blueDevice.getName(), 
> Toast.LENGTH_SHORT).show();
> }
> }
> }
>
>
> }
> }
>
> --
> 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.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/323e3772-1a94-49f4-9357-a4e3afbde332%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CABHzXARRDR%2Bo-mH0cEbkAeJzDfL7B8Cc%3DfEHQtXv3D%3DtToQGzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] bluetooth api

2016-04-02 Thread fbm fatma
hi all, i want to display the list of bounded devices with the android 
bluetooth api , but i don't know why in this code when i run it in my 
device no toast is displayed by the way toast will conatain name of each 
device  .who  can help me ? and thx in advance :) 
this is the code 

package com.example.fatma.cst;
import android.bluetooth.BluetoothAdapter;import 
android.bluetooth.BluetoothDevice;import android.content.Intent;import 
android.os.Bundle;import android.support.v7.app.AppCompatActivity;import 
android.widget.TextView;import android.widget.Toast;
import java.util.Set;import java.util.Vector;
public class MainActivity extends AppCompatActivity {
TextView txt = null;
private static final int REQUEST_ENABLE_BT = 1;

@Override
protected void onCreate(Bundle savedInstanceState) {

final Vector mArrayAdapter = null;
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

BluetoothAdapter bluetoothAdapter=BluetoothAdapter.getDefaultAdapter();

if(bluetoothAdapter==null){
Toast t=new Toast(this);
t.setText("Sorry your phone do not support Bluetooth");
t.show();
}
else
{
if (!bluetoothAdapter.isEnabled()) {
Intent enableBtIntent = new 
Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}

if(REQUEST_ENABLE_BT!=0) {



/* bluetoothAdapter.startDiscovery();
BroadcastReceiver mReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();

//Finding devices
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
// Get the BluetoothDevice object from the Intent
BluetoothDevice device = 
intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
// Add the name and address to an array adapter to 
show in a ListView
mArrayAdapter.add(device.getName() + "\n" + 
device.getAddress());



}
}

};*/

//IntentFilter filter = new 
IntentFilter(BluetoothDevice.ACTION_FOUND);
   // registerReceiver(mReceiver, filter);
   Set devices;

devices = bluetoothAdapter.getBondedDevices();
for (BluetoothDevice blueDevice : devices) {
Toast.makeText(this, "Device = " + blueDevice.getName(), 
Toast.LENGTH_SHORT).show();
}
}
}


}
}

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/323e3772-1a94-49f4-9357-a4e3afbde332%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth Chat App

2016-04-02 Thread Rimish Bansod
1) How to Pair device without asking pairing code?
2) How to set Pairing code a fix number whenever user tries to pair a 
device he will enter a fix number and pairing number should only be enter 
at whoever initiated the connection.

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/67e0a994-a1c9-4bc8-983a-97eb6eb2d368%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth OBEX OPP - Receving file list from bluetooth paired device

2016-03-19 Thread Jibin Najeeb
I am trying to receive available media contents from the paired device. I 
heard this can be done through obex.
Could any body help me how to achieve this by providing samples, documents 
etc.
How to include bluez library in android project?

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/36e28094-41ca-4e55-abf3-767f8293f6a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth App For Robot Control

2016-03-19 Thread Rimish Bansod
Hello Sir,
I am developing bluetooth app for robot control
I just use your sample code for bluetooth chat from android studio it works 
fine for two android device but with robot it does not work
In robot we use same receiver as android phone. Do you have another sample 
for bluetooth app controlling robot with source code

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/ff09050c-0222-4cc1-b82b-bcd0485e594e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth connectivity with Robot

2016-03-18 Thread Rimish Bansod
I have studied android development bluetooth tutorial and sample bluetooth 
chat applicaton.
I just want to know how to do bluetooth connection with robot. Is there any 
different class for this like for Headset or Health Device Profile.
Because when i tried bluetooth chat application for robot. It was not 
connecting to Robot device. 

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/20757a48-5df1-4baf-99ee-297fa737da56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth connection problem between Raspberry and Android

2016-03-15 Thread 'Fiddendoerp' via Android Developers
Hey there,

maybe someone can help me, I posted on stackoverflow as well, but it is 
urgent and I can not find a solution or a command on recently posted 
problems/solvings.

The Problem: 

After connecting a raspberry pi and an android app we can send data over 
the created socket. But if the socket closes, by any way, (leaving app or 
bluetoothadapter turns off) the connection can not be rebuild. Is there 
anyone who knows an answer?

Best regards

Jan

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/e5ecc903-ac5a-42f6-b3c7-03a7930c3ae8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth Sniffer

2016-03-03 Thread Dirk Bellstaedt
Hi,
Is it possbile to listen to the System Bluetooth Socket to Sniff all In- 
and Outgoing Bluetooth Packages?
Or to listen to a single Bluetooth Connection of a device?
Best Regards

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/ee0af530-b7d5-40b3-bbc1-194ea7f207ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] bluetooth: paired bluetooth devices list

2016-02-15 Thread borzack
Hi All,
I need know where android save the paired bluetooht list.
The reason is that I've two devices where one of this can receive info 
about second device only by wifi/sms but no by bluetooth, so I can pair 
them only managing the paired devices bluetooth list.
Someone can help me?

thanks in advanced

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/0f595e0a-463c-481a-8441-f158f9f3a6a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth OBDII communication with pires library

2016-01-21 Thread Anthony Shepherd
I'm out of ideas as to what is wrong with this. I'm trying to send and 
receive data from my Bluetooth ELM327. Torque works, and I've used a 
terminal app to send commands and that also returns correct results. So I 
don't get what I'm doing wrong here. This is the thread that handles all of 
it. I'm using Pires java OBDlibrary, found here 


I'm getting back a "?" for all of the initialization commands, but when I 
start looping the VINcommand it starts returning "OK" and at one point I 
was able to actually get the VINcorrectly, but I had to loop a bunch of 
times to get it.

The connection is being made as a socket is returned. Commands are sent(per 
the library) in the format `"AT L0"` and as such

out.write((cmd + "\r").getBytes());
out.flush();


I have tried putting the parent send and receive commands in separate 
blocking threads using Thread.join() and that didn't change anything. I've 
tried a delay up to 1500ms using Thread.sleep.

I'm not sure what else to try, so any help you can give is greatly 
appreciated. Thanks in advance!

Here's my code for the thread called from the UI-thread:
   
 public class spawnThread implements Runnable {
protected BlockingQueue jobsQueue = new LinkedBlockingQueue
<>();
protected Long queueCounter = 0L;
protected BluetoothSocket sock = null;
protected ArrayList process_list;
protected Handler main_handler;
protected setting_objs temp_objs = new setting_objs();
protected BluetoothDevice bt_device;
protected boolean initialized = false;
protected boolean can_continue = true;


public spawnThread(Handler handler, BluetoothDevice bt_device, ArrayList
 list) {
this.jobsQueue = new LinkedBlockingQueue<>();
this.queueCounter = 0L;
this.bt_device = bt_device;
this.process_list = list;
this.main_handler = handler;
}
public void run() {


while (!Thread.interrupted() && can_continue) {
if(sock == null){
bluetooth_init();
}
if(!initialized && can_continue){
init_commands();
}
if(can_continue){
testing_commands();
}
}
}


private void bluetooth_init(){
UUID uuid = UUID.fromString("1101--1000-8000-00805F9B34FB");
try {
sock = bt_device.createRfcommSocketToServiceRecord(uuid);
sock.connect();
} catch (IOException e) {
e.printStackTrace();
can_continue = false;
}
}


private void init_commands(){


ArrayList init_objs = temp_objs.init_array;


for (obj init_cmd:init_objs
 ) {
queueJob(init_cmd);
}


try {
executeQueue();
} catch (InterruptedException e) {
e.printStackTrace();
}
}


private void testing_commands(){
String vin = "";
obj vin_obj = temp_objs.find_by_value("VIN");
for(int j = 0; j < 15; j++){


queueJob(vin_obj);
try {
executeQueue();
} catch (InterruptedException e) {
e.printStackTrace();
}
vin = vin_obj.command.getFormattedResult();
Log.d("vin count: " + String.valueOf(j)+ " ", vin);
}
}
private void queueJob(obj current) {
queueCounter++;
current.getCommand_job().setId(queueCounter);
try {
jobsQueue.put(current);
} catch (InterruptedException e) {
current.getCommand_job().setState(ObdCommandJob.
ObdCommandJobState.QUEUE_ERROR);
Log.e("OBD LOG", "Failed to queue job.");
}
}


private void executeQueue() throws InterruptedException {
while (jobsQueue.size() > 0) {
ObdCommandJob job = null;
obj job_obj = null;


try {
job_obj = jobsQueue.take();
job =  job_obj.getCommand_job();
job.setState(ObdCommandJob.ObdCommandJobState.RUNNING);

if (sock.isConnected()) {
job.getCommand().run(sock.getInputStream(), sock.
getOutputStream());
//send data to be bundled.
if(job_obj != null){
bundle_data(job_obj);
}
} else {
job.setState(ObdCommandJob.ObdCommandJobState.
EXECUTION_ERROR);
Log.e("OBD LOG", "Can't run command on a closed 
socket.");
}
} catch (InterruptedException i) {
Thread.currentThread().interrupt();
} catch (UnsupportedCommandException u) {
if (job != null) {
job.setState(ObdCommandJob.ObdCommandJobState.

[android-developers] Bluetooth Simple Secure Pairing in Android 6.0 not working

2015-12-30 Thread Ankur Agrawal


I am making a Bluetooth capable device using TI's CC2564 module. Before 
updating to Android 6.0, I could pair my phone (Nexus 5) with the device 
using Simple Secure Pairing (SSP) with no issues. Ever since I updated to 
Android 6.0, my phone would not pair with the device.

The debug terminal attached to CC2564 module shows that a link key is 
generated, but Android does not show it in its list of paired devices, as 
it used to with Android 5.0. I tried another phone running Android 4.1, and 
my Bluetooth capable laptop, and both pair with the device.

Also, if I change settings in CC2564 to pair using a PIN code, then my 
phone does pair with it. My question is, has something changed in Android 
6.0 in terms of SSP functionality? 

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/41db406c-c30d-4dd2-b0f4-19500b7d0fd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth pairing request although it was previously paired

2015-12-09 Thread rukiman
In the Samsung galaxy note 3, I have paired a bluetooth device. It is 
paired sucessfully.

In my app I simply run this code in a thread to look for the bluetooth 
device I am interested in and connect automatically to it.

Usually everything works well. But occasionally I will get an unwanted 
Bluetooth Pairing request dialog popup. When this happened, I went to the 
bluetooth settings and I can see the state is "pairing". My question is why 
does an already paired device go into pairing again? And what can I do to 
stop this from happening or get rid of that dialog? I don't want the user 
to have to confirm to anything.


private void open() throws IOException {
>close();
>try {
>  if (android.os.Build.VERSION.SDK_INT >= 
> android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {
>mSocket = mDevice.createInsecureRfcommSocketToServiceRecord(
> SPP_UUID);
>  } else {
>mSocket = mDevice.createRfcommSocketToServiceRecord(SPP_UUID);
>  }
>  mSocket.connect();
>  mIn = new DataInputStream(mSocket.getInputStream());
>  mOut = new DataOutputStream(mSocket.getOutputStream());
>} catch (IOException ex) {
> close();
> throw ex;
>}
> }



public void run() {

BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();

int sleepDelay;

while(mFlag) {

sleepDelay = BLUETOOTH_RETRY_DISCOVERY_TIME;

Log.e(TAG, "discovering scanner");  

if(adapter.isEnabled()) {

Set pairedDevices = 
adapter.getBondedDevices();

if (pairedDevices.size() > 0) {

for (BluetoothDevice device : pairedDevices) {

if(device.getName().startsWith("MY")) {

mPairedDevice = device.getName();

sleepDelay = BLUETOOTH_RETRY_CONNECTION_TIME
;

mDevice = device;

if(adapter.isDiscovering()) {

adapter.cancelDiscovery();

}

try {   

open();

 

Log.e(TAG, "found bluetooth device and 
connected ok");

  

// make sure this is the last thing to 
be done no more scanner interaction after this

synchronized(mConnectThread) {

mConnectThread = null;

}

return;

} catch (Exception e) {


notifyUIIfNecessary(getContext().getResources().getString(R.string.
bluetoothscanner_turnon2));

closeConnection();

}

}

}

} else {

mPairedDevice = "";


notifyUIIfNecessary(getContext().getResources().getString(R.string.
bluetoothscanner_notpaired));

}

} else {


notifyUIIfNecessary(getContext().getResources().getString(R.string.
bluetoothscanner_adapterdisabled));

}

try {

sleep(sleepDelay);

} catch (InterruptedException e) {

}

}

}

}

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/7cc14962-3c92-4f9b-b2f3-fd5fab9aaa6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth

2015-12-03 Thread Justen Farnsworth
 How come every Android ZTEzmax2 note3 galaxy 6 edge  when I Bluetooth pair to 
my car stereo which is a Honda Civic Si 15 I don't get artist information or 
steering wheel controls all it does is play music and it says no device 
connected this is every device running 5.1 or higher my galaxy 3 4.4.4 didn't 
have this problem can we fix this problem or give me a solution

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/d6b20259-1164-4ee4-a427-5dbeb19c3189%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth PAN DNS name to pull from DHCP server or router rather than have the android create its own?

2015-12-02 Thread Rod Kashani


Hey All,

So I have a bluetooth pan on a raspberry pi which gives an ip and Internet 
connection to an android, in this case the S6 edge. I am given an ip 
address, however I can't communicate with other devices on the network. I 
do receive Internet though. It seems the android is assigning itself a dns 
hostname, which separates itself from the rest of the network. I could be 
wrong, but when laptops connect to the same pan network, they are given the 
dhcp information from the router and they can communicate over the network 
with the ip's being given to them from the bluetooth access point.

The laptops have a hostname of TP-link_D5DE and the android has 
android_9xx

Can the android adopt dhcp hostname info via Bluetooth pan? Can I change 
this name? Is it possible without root if so?

I understand there was somewhat of an issue with dhcp "hooks" back in the 
day where the bluetooth controller couldn't retrieve this information but I 
read that on a forum which was a few years old and also read it was fixed 
on newer versions of android.

Thanks!

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/cd9dd1c7-0d49-4777-9ceb-3713788b5431%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Bluetooth Low Energy support on lollipop and previous

2015-01-28 Thread Tony Pitman
I have an app that currently supports bluetooth low energy on pre-lollipop. 
I am using things like startLeScan to do the central role.

I noticed that Lollipop introduces new apis and that the old ones are 
deprecated.

I am having one problem in particular that may be related. When I call 
startLeScan with no UUIDs it finds my devices. If I pass in the UUID of the 
same device that it found it doesn't work.

This works fine on a pre-lollipop device.

Could this be that the api is deprecated and I need to use the new 
startScan on lollipop? If that is the case how do I do this in the same 
application?

When I browse to the documentation on the web site for startScan it warns 
me that it is only available in SDK 21. Does this mean if I use it then my 
app won't work on pre- SDK 21 devices or does the sdk take care of that for 
me?

Sorry to seem like a noob, but this is the first time I have encountered 
something like this.

-- 
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] Bluetooth devices connected list - getConnectedDevices()

2014-09-20 Thread Dave Truby
This call is for bluetooth low energy connections. Are you sure you have a low 
energy device connected? It looks like you are connecting a mouse, I'm not sure 
that is a low energy device.

-- 
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] Bluetooth devices connected list - getConnectedDevices()

2014-09-19 Thread pedr0
I am developing an application which runs on a API 18 device.

This snippet of code gives me back a empty list : 

public static boolean isBTMouseAttached(Context context)   


  
{   


 
Log.i(Mumble, isBTMouseAttached);   


 
BluetoothManager mBluetoothManager = (BluetoothManager) context.
getSystemService(Context.BLUETOOTH_SERVICE);   

  
for (BluetoothDevice item : mBluetoothManager.
getConnectedDevices(BluetoothProfile.GATT)) 

   
{   


 
Log.i(Mumble, Name :  + item.getName());   


  
if (deviceIsExternalMouse(item))   


  
return true;   


  
}   


 
return false;   


 
}  

Someone has any idea about why ?

-- 
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] Bluetooth OOB Handover via NFC without User Confirmation

2014-08-06 Thread Bender
Hi,

I'm trying to realize an Android-Beam-like behaviour between an Android 
Smartphone and a Linux Host. The Android Smartphone (Galaxy Note 3, Android 
4.4.2) touches an NFC Dongle connected to the Linux Host and exchanges 
Bluetooth carrier data via NFC so it then can connect to a Bluetooth 
Dongle, also connected to the Linux host.

Now the problem is, that the Android Smartphone always asks the User (me) 
if I really want to pair with the Bluetooth Dongle. In Android Beam between 
two Android mobiles, this user confirmation doesn't show up, the user only 
has to click the content (i.e. the picture) to send it (and this is the 
behaviour I'm trying to get to). I'm using the nfctool to sniff the 
incoming Handshake Request message by the Android mobile (see 
http://pastebin.com/Dr0D0nqn ). According to the Bluetooth Secure Simple 
Pairing Using NFC document by the NFC Forum (see 
http://members.nfc-forum.org/resources/AppDocs/NFCForum_AD_BTSSP_1_0.pdf 
page 19) this Handshake Request should contain a Simple Pairing Hash and a 
Simple Pairing Randomizer, which are both missing in the Handshake Request 
by Android.

So my questions are:

 * First of all, is Android Beam using Secure Simple Pairing with OOB at 
all, or another mechanism?
 * If it is using SSP, why are the SSP Hash and Randomizer missing in the 
HR message? Could this be the reason, why my pairing needs user 
confirmation?
 * If Android is using another mechanism, how do the HR messages roughly 
look like? Do they use a special type name (other than 
application/vnd.bluetooth.ep.oob) or anything else in their Handshake 
Request, which circumvents the user confirmation of the BT pairing?
 * Are there any technical documentations (I couldn't find any so far) of 
Android Beam available? The NFC guide on android developers ( 
http://developer.android.com/guide/topics/connectivity/nfc/nfc.html ) isn't 
of much help concerning Android Beam.

Any help is much appreciated :)

Kind regards
Andreas

-- 
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] Bluetooth GATT characteristic thread safety

2014-07-20 Thread flix
As for most APIs, there is no word about thread safety in the Bluetooth 
GATT API documentation.

I have implemented a driver for the HM-10 BLE module, which is an UART 
adapter. It has one GATT characteristic for reading and writing data. So I 
get notifications about incoming data in the onCharacteristicChanged() 
callback function of my BluetoothGattCallback implementation. These 
callbacks are called from a Binder thread which the Android framework 
maintains. To write data, I need to call setValue() on the 
BluetoothGattCharacteristic object and call writeCharacteristic() on the 
BluetoothGatt instance afterwards. This is done from a thread of my app.

And here is the problem: Unsurprisingly, BluetoothGattCharacteristic is not 
thread safe: What sometimes happens is that the Value property of my 
BluetoothGattCharacteristic gets overwritten during my write operation, 
when incoming data is received in the very same moment.

Any idea how to solve this? Is it somehow possible to place the code for 
writing data in the same thread where the BluetoothGattCallback callbacks 
occur?

-- 
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] Bluetooth, my app suddenly asks for permission to access SIM. Why?

2014-04-01 Thread Leo


I'm developing a game that has 'play via bluetooth' mode. Two game 
instances connect to each other perfectly, but from time to time (one out 
of ten or so) I got a confirmation dialog on my Galaxy S3 with message that 
Remote app requests permission to access SIM.

This message appears when my game tries to connect to the S3 phone. 
Suddenly after several successful connections, next connection raises this 
dialog and then refuses to connect no matter what I choose in this dialog.

I've tested this behavior on my Galaxy S3 (Android 4.1.1) and HTC Legend 
(Android 2.2). 

The game is using generated UUID for creating secure bluetooth connection.

Why am I getting this access SIM? And how to fix it?

Any advice is really 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.


Re: [android-developers] Bluetooth connection

2013-11-01 Thread sting
Thats not the problem.  I need a device that when it is asked to connect 
with a SPP profile, it knows what to do.  I have a bluetooth card that I 
have configured to work in SPP mode but it seems that android still can't 
connect.  I just want to know what commands I need to send to the device to 
get it to connect.

On Thursday, October 31, 2013 8:23:05 AM UTC-7, Kristopher Micinski wrote:

 It seems that something like this would do the trick: 


 http://www.miniinthebox.com/bluetooth-master-uart-board-wireless-transceiver-module-uart-interface-host-mode_p394547.html?currency=USDlitb_from=paid_adwords_shoppinggclid=CJbo1KSwwboCFdGe4AodKzQAzQ
  

 It's got a UART interface and lets you stick raw bytes, I'd assume. 

 Kris 


 On Thu, Oct 31, 2013 at 1:15 AM, sting raymond...@gmail.com javascript: 
 wrote: 
  I am building a device that basically has a UART so I can send and 
 receive 
  bytes.  I want to be able to control the device, send configuration 
  information to the device, using an android phone.  Is there a way for 
 such 
  a simple device to establish a connection with the 
 BlueToothServer/socket. 
  All I think I need is the connection, then its a matter of transmitting 
  messages that are just strings. 
  
  Any help would be 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-d...@googlegroups.comjavascript: 
  To unsubscribe from this group, send email to 
  android-developers+unsubscr...@googlegroups.com javascript: 
  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 javascript:. 
  For more options, visit https://groups.google.com/groups/opt_out. 


-- 
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/groups/opt_out.


Re: [android-developers] Bluetooth connection

2013-10-31 Thread Kristopher Micinski
It seems that something like this would do the trick:

http://www.miniinthebox.com/bluetooth-master-uart-board-wireless-transceiver-module-uart-interface-host-mode_p394547.html?currency=USDlitb_from=paid_adwords_shoppinggclid=CJbo1KSwwboCFdGe4AodKzQAzQ

It's got a UART interface and lets you stick raw bytes, I'd assume.

Kris


On Thu, Oct 31, 2013 at 1:15 AM, sting raymond.madi...@gmail.com wrote:
 I am building a device that basically has a UART so I can send and receive
 bytes.  I want to be able to control the device, send configuration
 information to the device, using an android phone.  Is there a way for such
 a simple device to establish a connection with the BlueToothServer/socket.
 All I think I need is the connection, then its a matter of transmitting
 messages that are just strings.

 Any help would be 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/groups/opt_out.

-- 
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/groups/opt_out.


[android-developers] Bluetooth connection

2013-10-30 Thread sting
I am building a device that basically has a UART so I can send and receive 
bytes.  I want to be able to control the device, send configuration 
information to the device, using an android phone.  Is there a way for such 
a simple device to establish a connection with the BlueToothServer/socket.  
All I think I need is the connection, then its a matter of transmitting 
messages that are just strings.

Any help would be 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/groups/opt_out.


[android-developers] Bluetooth Low Energy Encrypted Characteristic Read Write

2013-09-24 Thread Ashwini
I am developeing an application which can talk to few smart(bluetooth 4.0) 
devices. I tested the code on Nexus 4 running Android OS version 4.3. 

The application is able to connect to nordic chip programmed as heart rate 
monitor. For this device, I am able to read services, characteristics and 
even get updates for heart rate values.
However, when I programmed the same chip for encrypted characteristics, I 
am facing some issues.

   - Connection drops sometimes after write characteristic descriptor is 
   performed.
   - The devices once paired with phone can not be un-paired. (This is 
   known issue and confirmed the same from android issue tracker).
   - Getting following statement in logs quite often but not able to 
   understand the status code - 133.

D/BluetoothGatt(1780): onClientConnectionState() - status=133 clientIf=4 
device=CC:F3:A5:4D:CB:3F


   - The phone also logs this statement for state change.
   
   In stable state, received invalid newState: 10
   
   

I do not seem to find a way to instruct the phone to get paired with the 
chip. Also there is no way to specify that we want to perform *encrypted 
read-write operations*.

Any help is 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/groups/opt_out.


[android-developers] Bluetooth connection that persists through activity life-cycle

2013-08-22 Thread RLScott
I have a Bluetooth implementation in my app that goes through its entire 
set-up and tear-down in onResume and onPause in my main activity.  The 
application communicates with a Bluetooth serial adapter.  The trouble is 
that sometimes the user needs to leave our main activity for some other 
activity within my app.  Or he may briefly go to some other app.  In either 
case, upon returning to my main activity, the entire Bluetooth set-up is 
repeated.  This can take up to 5 seconds to re-establish the link.  I would 
like to make some of the set-up static so that it lasts as long as my app's 
process is running.  Of course if my app is killed, I will have to start 
over.  I accept that.  But if my main activity has been merely put into 
background, it would be nice if the user could return to that activity and 
not have to wait up to 5 seconds for the Bluetooth connection to be 
re-established.  What is the best practice for maintaining a Bluetooth 
connection in this case?  In other words, which parts of the Bluetooth 
set-up can I do just once and which parts need to be re-done whenever the 
main activity that created it is resumed?

-- 
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/groups/opt_out.


[android-developers] BlueTooth Low Energy quick question

2013-08-11 Thread darrinps
Anyone know what status 129 means? I can't seem to find much on it via 
Google.

I connect to a BLE device and it says it has services to discover (via 
using BluetoothGatt.discoverServices()). It then hits this method:

@Override
public void onServicesDiscovered(BluetoothGatt gatt, int status)
{
if (status == BluetoothGatt.GATT_SUCCESS)
{
broadcastUpdate(ACTION_GATT_SERVICES_DISCOVERED);
}
else
{
Log.w(TAG, onServicesDiscovered received:  + status);
}
}

The log message gets written saying that the status is 129, but I have no 
idea what 129 is.

Any help is appreciated!

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/groups/opt_out.




[android-developers] Bluetooth Smart Ready - 4.0 BLE

2013-04-23 Thread Sameer Bobade
Hi,

Any news on native support for BLE / 4.0 / GATT / Bluetooth Smart Ready?

-- 
-- 
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/groups/opt_out.




[android-developers] Bluetooth not working!

2013-04-23 Thread udaysingh1999
Iam Uday.I live in India,i have byond b50 android 2.3.6 (rooted)phone.My 
bluetooth isn't working as it doesn't turn on!!!
Kindly reply me @-udaysingh1...@gmail.com or reply!
PLEASE!!!ANYBODY HELP!

-- 
-- 
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/groups/opt_out.




Re: [android-developers] bluetooth file transfer failure

2013-03-15 Thread akash roy
@Indicator Veritatis

code for mminstream that u r asking for. :

private final BluetoothSocket mmSocket;
private final InputStream mmInStream;
private final OutputStream mmOutStream;

public ConnectedThread(BluetoothSocket socket) {
Log.d(TAG, create ConnectedThread);
mmSocket = socket;
InputStream tmpIn = null;
OutputStream tmpOut = null;

// Get the BluetoothSocket input and output streams
try {
tmpIn = socket.getInputStream();
tmpOut = socket.getOutputStream();
} catch (IOException e) {
Log.e(TAG, temp sockets not created, e);
}

mmInStream = tmpIn;
mmOutStream = tmpOut;
}

public void run() {
Log.i(TAG, BEGIN mConnectedThread);
byte[] buffer = new byte[4096];
int bytes = 0,mb;
String file_name;
long file_length;

// Keep listening to the InputStream while connected
while (true) {
try {
// Read from the InputStream
Log.d(TAG, file creating);
FileOutputStream fos = new
FileOutputStream(sdcard/abc.txt);
BufferedOutputStream bos = new BufferedOutputStream(fos);
/*BufferedReader nbr=new  BufferedReader(new
InputStreamReader(mmInStream));
file_name=nbr.readLine();
Log.d(TAG, file_name);
file_length= Long.parseLong(nbr.readLine());
Log.d(TAG, file length withdrawn);
double nosofpackets = Math.ceil(( (int)file_length)/4096);*/

//for(double i=0; inosofpackets; i++)
//for(double i=0; i4; i++)
// {
//bytes = (Integer) null;
 //Log.d(TAG, begin inputstream);
   // bytes = mmInStream.read(buffer);
Log.d(TAG, data incoming);
//System.out.println(bytes);
Log.d(TAG, begin file writing);
//bos.write(buffer, 0,buffer.length);
while((bytes = mmInStream.read(buffer))0){
 Log.d(TAG, data is there for writing);
 bos.write(buffer);}
//}
// Send the obtained bytes to the UI Activity
mHandler.obtainMessage(BluetoothChat.MESSAGE_READ,
bytes, -1, buffer)
.sendToTarget();
} catch (IOException e) {
Log.e(TAG, disconnected, e);
connectionLost();
break;
}
}

-- 
-- 
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/groups/opt_out.




Re: [android-developers] bluetooth file transfer failure

2013-03-15 Thread akash roy
@Lew

1. file constructors are working well and i am pretty sure about that.
2.since i am trying on some small sized files so int perfect for it.
3.i was actually trying to clean the buffer before inserting any other
details but i didn't noticed that i was deallocating the buffer.
4.the receving code is reposted..


@to all.
and i guess i just got the problem.
i.e. i have inserted the nbr.readline() function in the recevier which is
not required for right now.

Thankyou if i get any further problem i will b back in this thread.
Thankyou again!

-- 
-- 
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/groups/opt_out.




Re: [android-developers] bluetooth file transfer failure

2013-03-15 Thread Indicator Veritatis
Thanks for posting that link, Lew. I try to follow that practice myself, 
too. But this link expresses it SO well.

The only thing they don't mention that I find worthy to add is that while 
constructing that SSCCE, one often finds the solution to the problem. So it 
is worth the extra time, one must resist the temptation to fail to do it 
because of the time it takes. The time really is well spent.

On Thursday, March 14, 2013 6:26:31 PM UTC-7, Lew wrote:

 Indicator Veritatis wrote:

 In order to answer your question, we need to see the code where you 
 create and set mmInstream, too. For all we know, you might have forgotten 
 to connect it to any stream,


 Follow this advice:
 http://sscce.org/
  


  akash roy wrote:

 here  i am trying to send a file over bluetooth but its not sending any 
 data.
 here the main problem is that its not sending or receiving any data over 
 the two devices but they are connected to each other.

 on configuring the bluetooth chat example.


 Sending code:


  File myFile = new File(message.toURI());


 Are you quite certain 'message' translates properly to a URI that the 
 'File' constructor can use?

 Are you certain that the abstract pathname represented by the 'File' 
 instance is accessible?

  

  Double nosofpackets = Math.ceil(((int) myFile.length() )/4096);


 'Math.ceil()' makes no sense with integer expressions. It will only return 
 the argument's value.

 Are you quite certain that the length of the file will fit in an 'int'?

 Why does 'nosofpackets' (a non-compliant name) have to be 'Double' rather 
 than 'double'?

  System.out.println(nosofpackets);
  BufferedInputStream bis= new BufferedInputStream(new 
 FileInputStream(myFile));
  byte[] send = new byte[4096];
  for(double i=0; inosofpackets; i++)


 'int' would be a better type for a loop index. It's actually pretty 
 strange to think about what 
 a 'double' is doing here.
  

  {
   send = null ;


 So why do you null out this variable and forget and eventually de-allocate 
 the array?
  

   a=bis.read(send, 0,send.length);


 NPE!

 You can't get the length of 'null'.

 You did not tell us you were getting exceptions. How come?

 What is 'a'?

  

   Log.d(BluetoothChat, data packet  + i);
   if(a==-1)
   {
   break;
   }
   mChatService.write(send);
  }


 Receiving code :


 while((bytes = mmInStream.read(buffer))0)


 What are these variables?
  

 {
 
 Log.d(TAG, data is there for writing);
 bos.write(buffer);
 
 }


 Incomplete question, cannot be answered completely.

 -- 
 Lew



-- 
-- 
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/groups/opt_out.




Re: [android-developers] bluetooth file transfer failure

2013-03-14 Thread Indicator Veritatis
In order to answer your question, we need to see the code where you create 
and set mmInstream, too. For all we know, you might have forgotten to 
connect it to any stream,

On Wednesday, March 13, 2013 9:28:08 PM UTC-7, akash roy wrote:

 here  i am trying to send a file over bluetooth but its not sending any 
 data.
 here the main problem is that its not sending or receiving any data over 
 the two devices but they are connected to each other.

 on configuring the bluetooth chat example.


 Sending code:


  File myFile = new File(message.toURI());
  Double nosofpackets = Math.ceil(((int) myFile.length() )/4096);
  System.out.println(nosofpackets);
  BufferedInputStream bis= new BufferedInputStream(new 
 FileInputStream(myFile));
  byte[] send = new byte[4096];
  for(double i=0; inosofpackets; i++)
  {
   send = null ;
   a=bis.read(send, 0,send.length);
   Log.d(BluetoothChat, data packet  + i);
   if(a==-1)
   {
   break;
   }
   mChatService.write(send);
  }


 Receiving code :


 while((bytes = mmInStream.read(buffer))0)
 {
 
 Log.d(TAG, data is there for writing);
 bos.write(buffer);
 
 }

  

-- 
-- 
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/groups/opt_out.




Re: [android-developers] bluetooth file transfer failure

2013-03-14 Thread Lew
Indicator Veritatis wrote:

 In order to answer your question, we need to see the code where you create 
 and set mmInstream, too. For all we know, you might have forgotten to 
 connect it to any stream,


Follow this advice:
http://sscce.org/
 


  akash roy wrote:

 here  i am trying to send a file over bluetooth but its not sending any 
 data.
 here the main problem is that its not sending or receiving any data over 
 the two devices but they are connected to each other.

 on configuring the bluetooth chat example.


 Sending code:


  File myFile = new File(message.toURI());


Are you quite certain 'message' translates properly to a URI that the 
'File' constructor can use?

Are you certain that the abstract pathname represented by the 'File' 
instance is accessible?

 

  Double nosofpackets = Math.ceil(((int) myFile.length() )/4096);


'Math.ceil()' makes no sense with integer expressions. It will only return 
the argument's value.

Are you quite certain that the length of the file will fit in an 'int'?

Why does 'nosofpackets' (a non-compliant name) have to be 'Double' rather 
than 'double'?

 System.out.println(nosofpackets);
  BufferedInputStream bis= new BufferedInputStream(new 
 FileInputStream(myFile));
  byte[] send = new byte[4096];
  for(double i=0; inosofpackets; i++)


'int' would be a better type for a loop index. It's actually pretty strange 
to think about what 
a 'double' is doing here.
 

  {
   send = null ;


So why do you null out this variable and forget and eventually de-allocate 
the array?
 

   a=bis.read(send, 0,send.length);


NPE!

You can't get the length of 'null'.

You did not tell us you were getting exceptions. How come?

What is 'a'?

 

   Log.d(BluetoothChat, data packet  + i);
   if(a==-1)
   {
   break;
   }
   mChatService.write(send);
  }


 Receiving code :


 while((bytes = mmInStream.read(buffer))0)


What are these variables?
 

 {
 
 Log.d(TAG, data is there for writing);
 bos.write(buffer);
 
 }


Incomplete question, cannot be answered completely.

-- 
Lew

-- 
-- 
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/groups/opt_out.




[android-developers] bluetooth file transfer failure

2013-03-13 Thread akash roy
here  i am trying to send a file over bluetooth but its not sending any
data.
here the main problem is that its not sending or receiving any data over
the two devices but they are connected to each other.

on configuring the bluetooth chat example.


Sending code:


 File myFile = new File(message.toURI());
 Double nosofpackets = Math.ceil(((int) myFile.length() )/4096);
 System.out.println(nosofpackets);
 BufferedInputStream bis= new BufferedInputStream(new
FileInputStream(myFile));
 byte[] send = new byte[4096];
 for(double i=0; inosofpackets; i++)
 {
  send = null ;
  a=bis.read(send, 0,send.length);
  Log.d(BluetoothChat, data packet  + i);
  if(a==-1)
  {
  break;
  }
  mChatService.write(send);
 }


Receiving code :


while((bytes = mmInStream.read(buffer))0)
{

Log.d(TAG, data is there for writing);
bos.write(buffer);

}

-- 
-- 
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/groups/opt_out.




[android-developers] Bluetooth maximum connection capability.

2013-02-07 Thread Srinivas Nainala
Hi All,

I would like to know how many (maximum capacity) blue devices could connect 
to my Android tablet. My friends have different OS like Android, iOS and 
Windows devices. They want to connect to my Android device and I would like 
to connect their device mutually.

Thanks in advance for your help.

BR
Srinivas

-- 
-- 
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/groups/opt_out.




[android-developers] Bluetooth BLE generic profile supported by Android

2012-12-30 Thread gran33
Hey all,

Does Android support any generic Bluetooth BLE profile? e.g GATT (Generic 
Attribute Profile)

10x in advance,
RAN

-- 
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

[android-developers] Bluetooth input stream buffer overflows

2012-12-19 Thread Elvira


I try to read a file via Bluetooth with HTC Desire.

The code for connection is similar to BluetoothChat sample 
http://developer.android.com/tools/samples/index.html.

The problem is in the ConnectedThread when reading files with size greater 
than 5 KB.

This is the run() method of this thread (I removed the code that is 
unnecessary for the understanding of the problem):

public void run() {
  // Keep listening to the InputStream while connected
int bufferSize = 2048;
byte[] buffer = new byte[bufferSize];
int num = 0;
int offset = 0;
while (true) {
try {
// Read from the InputStream

offset = mmInStream.read(buffer, num, 1024);
num = num + offset;

Log.d(Read, offset =  + offset);

if(num  bufferSize - 1024)
{

num = 0;
offset = 0;
}

} catch (IOException e) {

connectionLost(mAddress);
break;
}
}
}

The local variable *offset* is never greater than 127. And when I try to 
read a 7K file mmInStream.read method blocks after a few seconds and 
doesn't return.

I attempted to use different buffer sizes and read(buffer,0, bufferSize) 
method instead of the one given above. But it doesn't help.

It seems like the inputstream internal buffer is overflowed before the 
reading completed.

Does anyone have an idea how to prevent it?

-- 
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

[android-developers] Bluetooth Thetering

2012-11-20 Thread Jonnys Gomes
Hello all,
Someone can tell me where I find something documentation about tethering 
over bluetooth? I searched in developer.android.com but I not found there.

-- 
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

[android-developers] Bluetooth HDP source code

2012-11-20 Thread gran33
Hey, 
I am looking for the HDP code for the source side (source - Bluetooth 
device, sink - mobile)
Is someone know where can i find it?

10x in advance!

-- 
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

[android-developers] Bluetooth RFCOMM connection couldn't be established consecutively on Android 4.2

2012-11-19 Thread Kun Li


I have a application which talks to a custom device through RFCOMM of 
Bluetooth. The communication code is based on BluetoothTalk sample project. 
It was running without any problem before on either Galaxy S3, Galaxy S2, 
Galaxy Note and Nexus 7.

Recently, Nexus 7 were upgraded to Android 4.2 and since then, the problem 
happens as follows:

1 When you use the app to set up a connection for the first time, meaning 
that the device is just turned on and app is just launched, no problem, you 
can get data normally.

2 Then if you stop the communication, and try to restart, the communication 
fails with error java.io.IOException: bt socket closed, read return: -1. 
From then on, no matter how many times you try to reconnect, it simply 
always fails.

3 The only way to make it work again is, if you reboot the custom device 
AND the app, then try to connect, the communication becomes normal. But 
then, once you stop and restart the communication, it keeps on failing.

I borrowed a Nexus 4 with Android 4.2 and the issue remains.

It really annoying because the main value of our device is relying upon the 
Bluetooth RFCOMM application. I double checked about the documentation on 
BT in Android 4.2 and didn't see any significant change. I'm fairly 
confident about the code on my side because it works for any Android device 
not running 4.2

Any hint or suggestion would be greatly appreciated. The device need to be 
demoed in the very beginning of December and we really want to address this 
issue ASAP.

-- 
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

Re: [android-developers] bluetooth PAN issue

2012-11-13 Thread Robin Gujjar
Fixed :) 


do the below setting in config.xml 

string-array translatable=false name=networkAttributes
 itemmobile_bluetooth,7,7,1,-1,true/item
/string-array
string-array translatable=false name=radioAttributes
 item7,1/item
/string-array
integer-array translatable=false name=config_tether_upstream_types
item7/item
 /integer-array
string-array translatable=false name=config_tether_bluetooth_regexs
  itembnep\\d/item
 /string-array

and recheck the dhcp server on GM or Master side . 


On Monday, November 12, 2012 5:23:10 PM UTC+8, harsh wrote:

 Hi. 
 I think this might be an accepted bug for ICS (Assuming you are using 
 that).
 This http://code.google.com/p/android/issues/detail?id=34161 might help 
 you.

 - Best


 On Mon, Nov 12, 2012 at 12:31 PM, Robin Gujjar 
 robin@gmail.comjavascript:
  wrote:

 Hi All ,


 I am trying to setup the bluetoooth PAN on my devlopment board( Client 
 PANU).  Master is running on a Ubuntu PC 12.04 . 
 Master is working fine as i am able to access interbet on another ubuntu 
 PC . 

 But on my android development board i am not able to start a connection, 
 i have done the below steps : 

 On my android board : 

 W/ProcessStats( 1665): Skipping unknown process pid 2239
 W/ThrottleService( 1665): unable to find stats for iface rmnet0
 I/pand( 2254): Bluetooth PAN daemon version 4.93
 I/pand( 2254): Connecting to 74:E5:43:51:8C:E6
 I/pand( 2254): bnep0 connected

 root@android:/ # pand -l 
 bnep0 E6:8C:51:43:E5:74 PANU

 method 1: 
 Static IP setting : 
 ifconfig bnep0 172.22.22.10 netmask 255.255.255.0
 route add default gw 172.22.22.1 dev bnep0 
 setprop net.dns1 198.95.1.1


 130|root@android:/ # netcfg 
 lo   UP
 **   127.0.0.1/8   0x0049 00:00:00:00:00:00
 sit0 DOWN  ** 0.0.0.0/0   0x0080 
 00:00:00:00:00:00
 ip6tnl0  DOWN  ** 0.0.0.0/0   0x0080 
 00:00:00:00:00:00
 bnep0UP**172.22.22.10/24  0x1043 
 00:02:72:bc:01:47

 Method2 : 
 I also tried the dhcp :

 1|root@android:/ # dhcpcd -d bnep0 **
 

 dhcpcd[2346]: version 5.2.10 starting
 dhcpcd[2346]: bnep0: using hwaddr 00:02:72:bc:01:47
 dhcpcd[2346]: bnep0: executing `/system/etc/dhcpcd/dhcpcd-**run-hooks', 
 reason PREINIT
 dhcpcd[2346]: bnep0: executing `/system/etc/dhcpcd/dhcpcd-**run-hooks', 
 reason CARRIER
 dhcpcd[2346]: host does not support a monotonic clock - timing can skew
 dhcpcd[2346]: bnep0: reading lease `/data/misc/dhcp/dhcpcd-bnep0.**lease'
 dhcpcd[2346]: bnep0: checking for 169.254.159.45
 dhcpcd[2346]: bnep0: sending ARP probe (1 of 3), next in 1.11 seconds
 dhcpcd[2346]: bnep0: sending ARP probe (2 of 3), next in 1.81 seconds
 dhcpcd[2346]: bnep0: sending ARP probe (3 of 3), next in 2.00 seconds
 dhcpcd[2346]: bnep0: using IPv4LL address 169.254.159.45
 dhcpcd[2346]: bnep0: adding IP address 169.254.159.45/16
 dhcpcd[2346]: bnep0: adding route to 169.254.0.0/16
 dhcpcd[2346]: bnep0: writing lease `/data/misc/dhcp/dhcpcd-bnep0.**lease'
 dhcpcd[2346]: bnep0: executing `/system/etc/dhcpcd/dhcpcd-**run-hooks', 
 reason IPV4LL
 dhcpcd[2346]: forking to background
 dhcpcd[2346]: forked to background, child pid 2370


 = 
 None of them works for me:  i can not ping my master form android client. 
 am i missing any other step ? 
 Please give me soem pointers ? 

 thanks 
 Robin Singh

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




 -- 
 Regards
 Harsh Vardhan

  

-- 
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

Re: [android-developers] bluetooth PAN issue

2012-11-12 Thread Harsh Vardhan
Hi.
I think this might be an accepted bug for ICS (Assuming you are using that).
This http://code.google.com/p/android/issues/detail?id=34161 might help
you.

- Best


On Mon, Nov 12, 2012 at 12:31 PM, Robin Gujjar robin.guj...@gmail.comwrote:

 Hi All ,


 I am trying to setup the bluetoooth PAN on my devlopment board( Client
 PANU).  Master is running on a Ubuntu PC 12.04 .
 Master is working fine as i am able to access interbet on another ubuntu
 PC .

 But on my android development board i am not able to start a connection, i
 have done the below steps :

 On my android board :

 W/ProcessStats( 1665): Skipping unknown process pid 2239
 W/ThrottleService( 1665): unable to find stats for iface rmnet0
 I/pand( 2254): Bluetooth PAN daemon version 4.93
 I/pand( 2254): Connecting to 74:E5:43:51:8C:E6
 I/pand( 2254): bnep0 connected

 root@android:/ # pand -l
 bnep0 E6:8C:51:43:E5:74 PANU

 method 1:
 Static IP setting :
 ifconfig bnep0 172.22.22.10 netmask 255.255.255.0
 route add default gw 172.22.22.1 dev bnep0
 setprop net.dns1 198.95.1.1


 130|root@android:/ # netcfg
 lo   UP
 **   127.0.0.1/8   0x0049 00:00:00:00:00:00
 sit0 DOWN  ** 0.0.0.0/0   0x0080
 00:00:00:00:00:00
 ip6tnl0  DOWN  ** 0.0.0.0/0   0x0080
 00:00:00:00:00:00
 bnep0UP**172.22.22.10/24  0x1043
 00:02:72:bc:01:47

 Method2 :
 I also tried the dhcp :

 1|root@android:/ # dhcpcd -d bnep0 **

 dhcpcd[2346]: version 5.2.10 starting
 dhcpcd[2346]: bnep0: using hwaddr 00:02:72:bc:01:47
 dhcpcd[2346]: bnep0: executing `/system/etc/dhcpcd/dhcpcd-**run-hooks',
 reason PREINIT
 dhcpcd[2346]: bnep0: executing `/system/etc/dhcpcd/dhcpcd-**run-hooks',
 reason CARRIER
 dhcpcd[2346]: host does not support a monotonic clock - timing can skew
 dhcpcd[2346]: bnep0: reading lease `/data/misc/dhcp/dhcpcd-bnep0.**lease'
 dhcpcd[2346]: bnep0: checking for 169.254.159.45
 dhcpcd[2346]: bnep0: sending ARP probe (1 of 3), next in 1.11 seconds
 dhcpcd[2346]: bnep0: sending ARP probe (2 of 3), next in 1.81 seconds
 dhcpcd[2346]: bnep0: sending ARP probe (3 of 3), next in 2.00 seconds
 dhcpcd[2346]: bnep0: using IPv4LL address 169.254.159.45
 dhcpcd[2346]: bnep0: adding IP address 169.254.159.45/16
 dhcpcd[2346]: bnep0: adding route to 169.254.0.0/16
 dhcpcd[2346]: bnep0: writing lease `/data/misc/dhcp/dhcpcd-bnep0.**lease'
 dhcpcd[2346]: bnep0: executing `/system/etc/dhcpcd/dhcpcd-**run-hooks',
 reason IPV4LL
 dhcpcd[2346]: forking to background
 dhcpcd[2346]: forked to background, child pid 2370


 =
 None of them works for me:  i can not ping my master form android client.
 am i missing any other step ?
 Please give me soem pointers ?

 thanks
 Robin Singh

 --
 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




-- 
Regards
Harsh Vardhan

-- 
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

[android-developers] bluetooth PAN issue

2012-11-11 Thread Robin Gujjar
Hi All ,


I am trying to setup the bluetoooth PAN on my devlopment board( Client 
PANU).  Master is running on a Ubuntu PC 12.04 . 
Master is working fine as i am able to access interbet on another ubuntu PC 
. 

But on my android development board i am not able to start a connection, i 
have done the below steps : 

On my android board : 

W/ProcessStats( 1665): Skipping unknown process pid 2239
W/ThrottleService( 1665): unable to find stats for iface rmnet0
I/pand( 2254): Bluetooth PAN daemon version 4.93
I/pand( 2254): Connecting to 74:E5:43:51:8C:E6
I/pand( 2254): bnep0 connected

root@android:/ # pand -l 
bnep0 E6:8C:51:43:E5:74 PANU

method 1: 
Static IP setting : 
ifconfig bnep0 172.22.22.10 netmask 255.255.255.0
route add default gw 172.22.22.1 dev bnep0 
setprop net.dns1 198.95.1.1


130|root@android:/ # netcfg 
lo   UP
   127.0.0.1/8   0x0049 00:00:00:00:00:00
sit0 DOWN   0.0.0.0/0   0x0080 
00:00:00:00:00:00
ip6tnl0  DOWN   0.0.0.0/0   0x0080 
00:00:00:00:00:00
bnep0UP172.22.22.10/24  0x1043 
00:02:72:bc:01:47

Method2 : 
I also tried the dhcp :

1|root@android:/ # dhcpcd -d 
bnep0 
dhcpcd[2346]: version 5.2.10 starting
dhcpcd[2346]: bnep0: using hwaddr 00:02:72:bc:01:47
dhcpcd[2346]: bnep0: executing `/system/etc/dhcpcd/dhcpcd-run-hooks', 
reason PREINIT
dhcpcd[2346]: bnep0: executing `/system/etc/dhcpcd/dhcpcd-run-hooks', 
reason CARRIER
dhcpcd[2346]: host does not support a monotonic clock - timing can skew
dhcpcd[2346]: bnep0: reading lease `/data/misc/dhcp/dhcpcd-bnep0.lease'
dhcpcd[2346]: bnep0: checking for 169.254.159.45
dhcpcd[2346]: bnep0: sending ARP probe (1 of 3), next in 1.11 seconds
dhcpcd[2346]: bnep0: sending ARP probe (2 of 3), next in 1.81 seconds
dhcpcd[2346]: bnep0: sending ARP probe (3 of 3), next in 2.00 seconds
dhcpcd[2346]: bnep0: using IPv4LL address 169.254.159.45
dhcpcd[2346]: bnep0: adding IP address 169.254.159.45/16
dhcpcd[2346]: bnep0: adding route to 169.254.0.0/16
dhcpcd[2346]: bnep0: writing lease `/data/misc/dhcp/dhcpcd-bnep0.lease'
dhcpcd[2346]: bnep0: executing `/system/etc/dhcpcd/dhcpcd-run-hooks', 
reason IPV4LL
dhcpcd[2346]: forking to background
dhcpcd[2346]: forked to background, child pid 2370


= 
None of them works for me:  i can not ping my master form android client. 
am i missing any other step ? 
Please give me soem pointers ? 

thanks 
Robin Singh

-- 
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

[android-developers] Bluetooth App with Apple chip inside of it.

2012-10-18 Thread ColorTheorist
There is a custom device that I am working with that has been approved to 
communicate with Apple mobile devices.  It will be my responsibility on my 
end to also communicate with that device over bluetooth with Android 
applications.  In pre-limenary testing, the devices around me here will 
pair with the device, but will not connect with the device.  I haven't done 
bluetooth development before, so I will have to research a bit into the 
complications involved in pairing and connecting with a device from within 
an Android library in the next few days.

But I was curious if anyone had knowledge of whether or not the chip 
modifications that were needed in the Apple device were going to cause 
issues in connecting with my Android devices.  If anyone has that knowledge 
available to them, I would be glad to hear feedback on it.  Just cause it 
hasn't connected thus far, doesn't mean that I wouldn't be able to connect 
with it from the code still, so that test will be for tomorrow.  

-- 
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

[android-developers] Bluetooth Low Energy Support in API 16?

2012-10-04 Thread Zafar Alam
Heard that API 16 is going to support BLE, So is there any information 
regarding when BLE API will be officially supported in 
the SDK?

-- 
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

[android-developers] Bluetooth Pairing problem

2012-09-12 Thread HPP

Hai all 

 I am making an application for sending data from my phone to another 
device using blue-tooth..I am using the bluetooth chat example that 
comes along with the SDK sample for my code . I need to pair my device with 
the other device after device discovery.But in chat application  after 
scanning it directly trying to connect to the other device.By 
googling it I understood that the other device should have to run the same 
application at the same timeBut in my application I need to pair my 
device to the other while the device discoverable option is ON 
there  And here is my code for connecting

try {
if (secure) {
tmp = device.createRfcommSocketToServiceRecord(
MY_UUID_SECURE);
} else {
tmp = device.createInsecureRfcommSocketToServiceRecord(
MY_UUID_INSECURE);
}
} catch (IOException e) {
Log.e(TAG, Socket Type:  + mSocketType + create() failed, e);
}
mmSocket = tmp;
}

public void run() {
Log.i(TAG, BEGIN mConnectThread SocketType: + mSocketType);
setName(ConnectThread + mSocketType);

// Always cancel discovery because it will slow down a connection
mAdapter.cancelDiscovery();

// Make a connection to the BluetoothSocket
try {
// This is a blocking call and will only return on a
// successful connection or an exception
mmSocket.connect();
} catch (IOException e) {
// Close the socket
try {
mmSocket.close();
} catch (IOException e2) {
Log.e(TAG, unable to close()  + mSocketType +
 socket during connection failure, e2);
}
connectionFailed();
return;
}

And my UUIDs are 


private static final UUID MY_UUID_SECURE = 
UUID.fromString(fa87c0d0-afac-11de-8a39-0800200c9a66);
private static final UUID MY_UUID_INSECURE 
=UUID.fromString(8ce255c0-200a-11e0-ac64-0800200c9a66);



For the last two days I am stuck with this problemPlease help..

Thanks in advance 


-- 
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

[android-developers] Bluetooth connection problem

2012-08-30 Thread Bryan
I've been trying to resolve a bluetooth connection problem between my app 
and service running on my laptop. I've paired my phone, a Nexus S 4G 
running AOSP 4.1.1, with my laptop through the System Settings. In my app, 
I'm unable to connect to my service over this pairing. However, if I go 
back into System Settings, Bluetooth Settings Activity, and select my 
laptop, the Bluetooth Settings Activity lists the laptop as selected and 
the Notification Bar icon for Bluetooth changes from grey to blue. Now, my 
app can connect just fine. If I disconnect from my laptop through the 
Bluetooth Settings Activity, my app can no longer connect. My understanding 
was that I only needed to be paired/bonded with a device to make a 
bluetooth connection. Why do I have to explicitly connect through the 
System/Bluetooth Settings before being able to connect in my app? I've 
tried both secure and insecure RfcommSocketToServiceRecord calls.

Any help is greatly appreciated! Thank you!

My source code is here:

https://github.com/piusvelte/RemoteAuthClient

-- 
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

Re: [android-developers] Bluetooth connection problem

2012-08-30 Thread rauf qureshi
//demo3.idhasoft.us/iloyal/api/iloyal/customer.php/customer.login

//I have develop following code can any body tell me solution of following
errors

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.IBinder;

public class RegistrationService extends Service{
 String SOAP_ACTION=
http://demo3.idhasoft.us/iloyal/api/iloyal/customer.php/customer.addIloyalCustomer
;
String SOAP_METHOD=customer.addIloyalCustomer;
String NAME_SPACE=http://demo3.idhasoft.us/iloyal/api/iloyal/customer.php;;
String url=http://demo3.idhasoft.us/iloyal/api/iloyal/customer.php/?wsdl;;

@Override
public IBinder onBind(Intent intent)
{
//TODO Auto-generated method stub
return null;
}

@Override
public void onStart(Intent intent, int startId)
{
//TODO Auto-generated method stub
super.onStart(intent, startId);
try{
 SoapObject result=(SoapObject)getWeather();
 System.out.println(+result.toString());
}catch(Exception e)
{
System.out.println(exception in soap   +e);
}
 stopService(intent);
}
public SoapObject getWeather() throws Exception
{
SoapObject request = new SoapObject(NAME_SPACE, SOAP_METHOD);
//request.addProperty(PlaceName, city);
request.addProperty(firstname, rauf);
request.addProperty(lastname, qureshi);
request.addProperty(email, rauf.qure...@gmail.com);
request.addProperty(password, 12345);
request.addProperty(mobile, 8286459963);
request.addProperty(DOB, 15/04/88);
request.addProperty(zipcode, 400092);

SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
// It seems that it is a .NET Web service because it doesn't work
without next line
envelope.dotNet = true;

HttpTransportSE transport = new HttpTransportSE(url);
System.out.println(service me conncetion checking se pahle aaya);

//ConnectivityManager cm = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
//NetworkInfo netInfo = cm.getActiveNetworkInfo();
//
//if (netInfo != null  netInfo.isConnectedOrConnecting())
//{
//   System.out.println(connected+netInfo.getExtraInfo());
//}
//else
//{
//System.out.println(not connceted);
//}
System.out.println(request   +request);
System.out.println(1=);
transport.call(SOAP_ACTION, envelope);
System.out.println(2=);
return (SoapObject) envelope.getResponse();
}
@Override
public void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
 }

}



org.xmlpull.v1.XmlPullParserException: expected: START_TAG {
http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG
definitions name='wsLogin' targetNamespace='
http://painel01.allinmail.com.br/wsAllin/login.php'@2:403 in
java.io.InputStreamReader@4375ba18)


i am getting above problem can any body tell me solution of above problem.

-- 
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

Re: [android-developers] Bluetooth connection problem

2012-08-30 Thread Bryan
rauf,

I think you replied to the wrong topic, could you please delete your post?

Thank you,
Bryan

On Thursday, August 30, 2012 10:15:58 AM UTC-4, rauf qureshi wrote:



 //demo3.idhasoft.us/iloyal/api/iloyal/customer.php/customer.login

 //I have develop following code can any body tell me solution of following 
 errors

 import org.ksoap2.SoapEnvelope;
 import org.ksoap2.serialization.SoapObject;
 import org.ksoap2.serialization.SoapSerializationEnvelope;
 import org.ksoap2.transport.HttpTransportSE;

 import android.app.Service;
 import android.content.Context;
 import android.content.Intent;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
 import android.os.IBinder;

 public class RegistrationService extends Service{
  String SOAP_ACTION=
 http://demo3.idhasoft.us/iloyal/api/iloyal/customer.php/customer.addIloyalCustomer
 ;
  String SOAP_METHOD=customer.addIloyalCustomer;
 String NAME_SPACE=http://demo3.idhasoft.us/iloyal/api/iloyal/customer.php
 ;
  String url=http://demo3.idhasoft.us/iloyal/api/iloyal/customer.php/?wsdl
 ;

 @Override
 public IBinder onBind(Intent intent) 
  {
 //TODO Auto-generated method stub
  return null;
 }

  @Override
 public void onStart(Intent intent, int startId) 
  {
 //TODO Auto-generated method stub
 super.onStart(intent, startId);
  try{
  SoapObject result=(SoapObject)getWeather();
  System.out.println(+result.toString());
  }catch(Exception e)
 {
 System.out.println(exception in soap   +e);
  }
  stopService(intent);
  }
 public SoapObject getWeather() throws Exception 
  {
 SoapObject request = new SoapObject(NAME_SPACE, SOAP_METHOD);
 //request.addProperty(PlaceName, city);
 request.addProperty(firstname, rauf);
 request.addProperty(lastname, qureshi);
 request.addProperty(email, rauf.q...@gmail.com javascript:);
 request.addProperty(password, 12345);
 request.addProperty(mobile, 8286459963);
 request.addProperty(DOB, 15/04/88);
 request.addProperty(zipcode, 400092);
 
 SoapSerializationEnvelope envelope = new 
 SoapSerializationEnvelope(SoapEnvelope.VER11);
 envelope.setOutputSoapObject(request);
 // It seems that it is a .NET Web service because it doesn't work 
 without next line
 envelope.dotNet = true;
 
 HttpTransportSE transport = new HttpTransportSE(url);
 System.out.println(service me conncetion checking se pahle aaya);
 
 //ConnectivityManager cm = (ConnectivityManager) 
 getSystemService(Context.CONNECTIVITY_SERVICE);
 //NetworkInfo netInfo = cm.getActiveNetworkInfo();
 //
 //if (netInfo != null  netInfo.isConnectedOrConnecting()) 
 //{
 //   System.out.println(connected+netInfo.getExtraInfo());
 //}
 //else
 //{
 //System.out.println(not connceted);
 //}
 System.out.println(request   +request);
 System.out.println(1=);
 transport.call(SOAP_ACTION, envelope);
 System.out.println(2=);
 return (SoapObject) envelope.getResponse();
 }
  @Override
 public void onDestroy() {
  // TODO Auto-generated method stub
 super.onDestroy();
  }
   
 }



 org.xmlpull.v1.XmlPullParserException: expected: START_TAG {
 http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG 
 definitions name='wsLogin' targetNamespace='
 http://painel01.allinmail.com.br/wsAllin/login.php'@2:403 in 
 java.io.InputStreamReader@4375ba18)


 i am getting above problem can any body tell me solution of above problem.


-- 
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

[android-developers] Bluetooth client server

2012-08-24 Thread Mulia Dhamma
Hello all masters,.
do you have the code for bluetooth client server ?
example..i have 2 android phone..and when the 1 android phone sending a string 
then the 2 andoid phone automatically pop up a toast that the 1 android phone 
send.also same with the 2 android phone when the 2 android phone sending a 
string then the 1 android phone automatically pop up a toast that the 2 android 
phone send.
Thank you..

-- 
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


[android-developers] Bluetooth: program stuck at inputstream reading

2012-08-22 Thread Elvira
Hi!

I have a problem with Bluetooth socket, I hope somebody can help me.

I use the code from BluetoothChat to send and receive data.

I'm trying to receive a file from bluetooth device. This file is sent by 
packages of 256 bytes.
My program stuck at mmInStream.read(buffer) in method run() of the class 
ConnectedThread after receiving a few packages:

public void run() {
Log.i(TAG, BEGIN mConnectedThread);
byte[] buffer = new byte[256];
int bytes;

// Keep listening to the InputStream while connected
while (true) {
try {
// Read from the InputStream
bytes = mmInStream.read(buffer);

mEmulatorView.write(buffer, bytes);
} catch (IOException e) {
Log.e(TAG, disconnected, e);
connectionLost();
break;
}
}
}

Before program blocking I receive different number of packages from 4 to 14.

There is no problem with the connected device, I verify it with Termite on 
PC, all packages received.

Is there a buffer somewhere that is filling up? Or another problem with 
bluetooth socket inputstream?

Thanks for any help.

-- 
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

[android-developers] Bluetooth PAN profile in Android ICS

2012-07-27 Thread chainz roid
Hello

I've a question that, is ANDROID ICS support Bluetooth Personal Area 
Network (PAN) profile or not .? 
Is any one handled that, kindly let me know.!

Thanks in advance.

-- 
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

[android-developers] Bluetooth Mutual Authentication

2012-07-16 Thread RumblyFungus
Hi Guyz,

Has anyone worked on BT mutual authentication before on Android ? Also is 
there any API version in android that supports it ? Please let me know if 
there is any data I can find on above two questions.

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

Re: [android-developers] Bluetooth sniffing

2012-07-14 Thread bob
Here's what I did with my Samsung Galaxy S3:

adb shell
shell@android:/ $ hcidump
/system/bin/sh: hcidump: not found



On Wednesday, July 11, 2012 3:41:57 AM UTC-5, the_edge123 wrote:

 On 10/07/2012 17:38, bob wrote: 

  
  I'm seeing some Bluetooth weirdness with Android.  Anyone know if there 
 is 
  a practical way to sniff Bluetooth packets?  Or are there any other good 
  tools for debugging Android Bluetooth? 
  
  

 You may try to use the HCI commands (hcidump and so on) under the ADB 
 shell if they are available. 

 - 
 Fabien 



-- 
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

Re: [android-developers] Bluetooth sniffing

2012-07-11 Thread Fabien R
On 10/07/2012 17:38, bob wrote:
  

 I'm seeing some Bluetooth weirdness with Android.  Anyone know if there is 
 a practical way to sniff Bluetooth packets?  Or are there any other good 
 tools for debugging Android Bluetooth?


   
You may try to use the HCI commands (hcidump and so on) under the ADB
shell if they are available.

-
Fabien

-- 
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


[android-developers] Bluetooth pairing

2012-07-10 Thread hari shankar
hi

I have scan the Bluetooth device and add in list View. I want to pair the
device by android code.
pl help me

Thank You

-- 
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

[android-developers] Bluetooth SPP

2012-07-10 Thread kaajavi
[EN]
Hi, this is my problem.
I made an application that connects to a device for SPP (Serial Port 
Profile). In some phones work and others do not. I see that, for example, 
bluetooth keyboards have the same problem.
Anyone know why?
Tanks!
---
[ES]
Hola, este es mi problema.
Realicé una aplicación que se conecta con un dispositivo por SPP (Serial 
Port Profile). En algunos celulares funciona y en otros no. Estoy viendo 
que, por ejemplo, los teclados bluetooth tienen el mismo problema.
Alguien sabe por que?
Gracias!!


-- 
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

Re: [android-developers] Bluetooth pairing

2012-07-10 Thread Yamanoor Sai Ram
Refer to the file DeviceListActivity.java in the Bluetooth Chat example
file.

It saves a lot of time as it is done already

Sai

On Sat, Jul 7, 2012 at 5:06 AM, hari shankar h...@euthika.com wrote:

 hi

 I have scan the Bluetooth device and add in list View. I want to pair the
 device by android code.
 pl help me

 Thank You

 --
 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 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

[android-developers] Bluetooth sniffing

2012-07-10 Thread bob
 

I'm seeing some Bluetooth weirdness with Android.  Anyone know if there is 
a practical way to sniff Bluetooth packets?  Or are there any other good 
tools for debugging Android Bluetooth?



-- 
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

[android-developers] Bluetooth Connection failing in android OS 2.3 and above

2012-07-10 Thread Jonathan Lim
Hi, i have am developing an application which connects to Bluetooth and it 
works perfectly in android OS 2.1 and 2.2 however when i tested with OS 2.3 
and above i am unable to connect, does anyone have any clue?

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

[android-developers] Bluetooth crash

2012-07-06 Thread bob
 

Any ideas why trying to enumerate a list of discoverable Bluetooth devices 
would cause an Android Ice Cream Sandwich device to crash?  


Unfortunately, all I have is a vague user report.


-- 
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

Re: [android-developers] Bluetooth crash

2012-07-06 Thread Kristopher Micinski
Use ACRA for your apps, at the very least, so you have a crash report...

kris

On Fri, Jul 6, 2012 at 10:06 AM, bob b...@coolfone.comze.com wrote:
 Any ideas why trying to enumerate a list of discoverable Bluetooth devices
 would cause an Android Ice Cream Sandwich device to crash?


 Unfortunately, all I have is a vague user report.


 --
 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 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


Re: [android-developers] Bluetooth crash

2012-07-06 Thread bob
Ok.
I suspect 
android.bluetooth.BluetoothDevice.getName() is returning null sometimes. 
 Don't know when.  Don't know why.

Here's what ACRA says:

java.lang.NullPointerException
at 
android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:394)
at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
at android.widget.AbsListView.obtainView(AbsListView.java:2046)
at 
android.widget.ListView.measureHeightOfChildren(ListView.java:1292)
at android.widget.ListView.onMeasure(ListView.java:1155)
at android.view.View.measure(View.java:13018)
at 
android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:594)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:376)
at android.view.View.measure(View.java:13018)
at 
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4706)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
at android.view.View.measure(View.java:13018)
at 
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4706)
at 
android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1369)
at 
android.widget.LinearLayout.measureVertical(LinearLayout.java:660)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:553)
at android.view.View.measure(View.java:13018)
at 
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4706)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
at 
com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2162)
at android.view.View.measure(View.java:13018)
at 
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1084)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2498)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)


On Friday, July 6, 2012 9:13:20 AM UTC-5, Kristopher Micinski wrote:

 Use ACRA for your apps, at the very least, so you have a crash report... 

 kris 

 On Fri, Jul 6, 2012 at 10:06 AM, bob b...@coolfone.comze.com wrote: 
  Any ideas why trying to enumerate a list of discoverable Bluetooth 
 devices 
  would cause an Android Ice Cream Sandwich device to crash? 
  
  
  Unfortunately, all I have is a vague user report. 
  
  
  -- 
  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 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

[android-developers] Bluetooth chat bug?

2012-07-06 Thread bob
I'm looking at the Bluetooth chat example:

// When discovery finds a device
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
// Get the BluetoothDevice object from the Intent
BluetoothDevice device = 
intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
// If it's already paired, skip it, because it's been 
listed already
if (device.getBondState() != BluetoothDevice.BOND_BONDED) {
mNewDevicesArrayAdapter.add(device.getName() + \n + 
device.getAddress());
}
// When discovery is finished, change the Activity title
} 



I think there is a bug here because it assumes device.getName() does not 
return null, when in fact it might.

What do you guys think?

-- 
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

[android-developers] Bluetooth Signal Strength

2012-07-01 Thread Bhavin
*Dear Sir,*
*
*
*I need to measure Signal strength of Bluetooth like :App Bluetooth Finder
*
*
*
*Would you please help me to find out,how to do this?*
*
*
*moreover this,i need to show kind of bar ,which could show signal strength.
*
*
*
*:)*
*Thanks  Regards*


-- 
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

Re: [android-developers] Bluetooth Signal Strength

2012-07-01 Thread TreKing
On Sun, Jul 1, 2012 at 2:03 AM, Bhavin alertsavemyl...@gmail.com wrote:

 *I need to measure Signal strength of Bluetooth like :App Bluetooth
 Finder*
 *
 *
 *Would you please help me to find out,how to do this?*


What have you tried so far?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
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

[android-developers] bluetooth pair

2012-06-20 Thread bob
 

Is it possible to have an Android device bluetooth pair up with a PC 
without the PC having to click anything?


Of course the PC would be preconfigured for this.


-- 
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

Re: [android-developers] Bluetooth error on socket call

2012-06-16 Thread James Black
How do you set btDevice?
On Jun 15, 2012 7:04 PM, mike digioia mpd...@gmail.com wrote:

 Bluetooth error on socket call-

 Anyone know what the issues are with my Samsung Nexus S device when I get
 this error in my native code call to the socket LIB --  code starts here:

 btface = -1;
 btDevice = NULL;
 btsock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);

 if ( btsock  0 ) {
 btDevice=NULL;
 #ifdef DEBUG
 ccnd_msg(h, ccnd_run: btDevice is NULL\n);
 #endif
 __code end

 __Debug Message

 I/CCND(  709): 1339785624.784335 ccnd[709]: ccnd_run: btDevice is NULL

 I can use the example BT chat application fine on this phone with
 discovery. So the BT device is working fine. Something with the socket call
 or libbluetooth.so (copied from the phone) I am using.

 /mpd

 --
 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 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

Re: [android-developers] Bluetooth error on socket call

2012-06-16 Thread mike digioia
Set it to zero in the def.
On Jun 16, 2012 9:18 AM, James Black planiturth...@gmail.com wrote:

 How do you set btDevice?
 On Jun 15, 2012 7:04 PM, mike digioia mpd...@gmail.com wrote:

 Bluetooth error on socket call-

 Anyone know what the issues are with my Samsung Nexus S device when I get
 this error in my native code call to the socket LIB --  code starts here:

 btface = -1;
 btDevice = NULL;
 btsock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);

 if ( btsock  0 ) {
 btDevice=NULL;
 #ifdef DEBUG
 ccnd_msg(h, ccnd_run: btDevice is NULL\n);
 #endif
 __code end

 __Debug Message

 I/CCND(  709): 1339785624.784335 ccnd[709]: ccnd_run: btDevice is NULL

 I can use the example BT chat application fine on this phone with
 discovery. So the BT device is working fine. Something with the socket call
 or libbluetooth.so (copied from the phone) I am using.

 /mpd

 --
 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 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 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

[android-developers] Bluetooth error on socket call

2012-06-15 Thread mike digioia
Bluetooth error on socket call-

Anyone know what the issues are with my Samsung Nexus S device when I get
this error in my native code call to the socket LIB --  code starts here:

btface = -1;
btDevice = NULL;
btsock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);

if ( btsock  0 ) {
btDevice=NULL;
#ifdef DEBUG
ccnd_msg(h, ccnd_run: btDevice is NULL\n);
#endif
__code end

__Debug Message

I/CCND(  709): 1339785624.784335 ccnd[709]: ccnd_run: btDevice is NULL

I can use the example BT chat application fine on this phone with
discovery. So the BT device is working fine. Something with the socket call
or libbluetooth.so (copied from the phone) I am using.

/mpd

-- 
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

[android-developers] Bluetooth SPP RFComm socket abort at receving speed of 1.15kpbs

2012-06-12 Thread RAIJ1
I've been having an issue with RFCOMM socket abort over Bluetooth in
Android. I don't have any issues connecting, but receiving data at
speed of 1.15kbps from a remote bluetooth adapter. There isn't a
problem with the adapter as the data is properly received if I connect
with a laptop.

My Bluetooth connection is handled based off of the BluetoothChat
sample application found at the Android developer site (http://
developer.android.com/resources/samples/BluetoothChat/index.html),
with no changes. The data being sent is the 18 bytes frames at speed
of 1.15kbps. My application works very much fine if i send the same
data at speed of 9600bps. The specific problem I have is thatRFCOMM
socket abort*(Please see log below)* when i tried to read the input
stream 2 or 3rd time. I have tried the solution suggessted by Data
Transmisison error using SPP over Bluetooth on Android , as it is
somewhat related with my problem. But that didnt helped. I am
developing my application on MOTOROLA Milestone phone.

My Question: Is there any solution for this problem or i can not
receive data at this speed in Android?

06-06 09:20:45.639: DEBUG/dalvikvm(1352): GC freed 4237 objects /
242728 bytes in 131ms 06-06 09:20:50.623: DEBUG/dalvikvm(1396): GC
freed 1257 objects / 66456 bytes in 109ms 06-06 09:21:03.287: ERROR/
BluetoothEventLoop.cpp(1277): event_filter: Received signal
org.bluez.Device:PropertyChanged from /org/bluez/1362/hci0/
dev_00_A0_96_1C_95_B9 06-06 09:21:03.287: ERROR/
BluetoothChatService(3718): disconnected 06-06 09:21:03.287: ERROR/
BluetoothChatService(3718): java.io.IOException: Software caused
connection abort 06-06 09:21:03.287: ERROR/BluetoothChatService(3718):
at android.bluetooth.BluetoothSocket.readNative(Native Method) 06-06
09:21:03.287: ERROR/BluetoothChatService(3718): at
android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:307) 06-06
09:21:03.287: ERROR/BluetoothChatService(3718): at
android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:
96) 06-06 09:21:03.287: ERROR/BluetoothChatService(3718): at
java.io.InputStream.read(InputStream.java:133) 06-06 09:21:03.287:
ERROR/BluetoothChatService(3718): at
com.example.android.ECGPlotter.BluetoothChatService
$ConnectedThread.run(BluetoothChatService.java:411)

In the log above you can see that receive thread fails to read from
inStream and RFComm channel aborts.

Regards, Jagmeet

-- 
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


[android-developers] Bluetooth HDP Sample Code won't run on emulator

2012-05-30 Thread Akeem W.
Recently, sample code for the Bluetooth HDP Demo has been made
available at:
http://developer.android.com/resources/samples/BluetoothHDP/index.html
However, when attempting to Run this program using the emulator, an
error message appears on the emulator display, reading,
Unfortunately, HDP Sample has stopped.
When referring to the LogCat, a short list of errors are listed (all
of which are under the AndroidRuntime Tag). I am currently utilizing
Android 4.0.3 (API 15), the most recent update as of this hour, and
have not modified the origianl sample code in any way. I have not yet
tested this code on an actual Android device to compare functionality;
nonetheless, I do not find any reason the emulator version would not
work. If you are an individual who has run this demo successfully on
the emulator, I will try changing machines and reattempt the process.
Am I mistaken that this code can ONLY run on an actual device?

The entire LogCat for this run-time session reads as follows:

05-29 23:16:25.914: I/dalvikvm(606): threadid=3: reacting to signal 3
05-29 23:16:26.074: I/dalvikvm(606): Wrote stack traces to '/data/anr/
traces.txt'
05-29 23:16:26.654: D/AndroidRuntime(606): Shutting down VM
05-29 23:16:26.654: W/dalvikvm(606): threadid=1: thread exiting with
uncaught exception (group=0x409c01f8)
05-29 23:16:27.185: E/AndroidRuntime(606): FATAL EXCEPTION: main
05-29 23:16:27.185: E/AndroidRuntime(606): java.lang.RuntimeException:
Unable to destroy activity {com.example.bluetooth.health/
com.example.bluetooth.health.BluetoothHDPActivity}:
java.lang.IllegalArgumentException: Receiver not registered:
com.example.bluetooth.health.BluetoothHDPActivity$3@412a2be8
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.app.ActivityThread.performDestroyActivity(ActivityThread.java:
3112)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:
3130)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.app.ActivityThread.access$1200(ActivityThread.java:123)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1180)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.os.Handler.dispatchMessage(Handler.java:99)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.os.Looper.loop(Looper.java:137)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.app.ActivityThread.main(ActivityThread.java:4424)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
java.lang.reflect.Method.invokeNative(Native Method)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
java.lang.reflect.Method.invoke(Method.java:511)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
dalvik.system.NativeStart.main(Native Method)
05-29 23:16:27.185: E/AndroidRuntime(606): Caused by:
java.lang.IllegalArgumentException: Receiver not registered:
com.example.bluetooth.health.BluetoothHDPActivity$3@412a2be8
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:628)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1066)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:
354)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
com.example.bluetooth.health.BluetoothHDPActivity.onDestroy(BluetoothHDPActivity.java:
226)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.app.Activity.performDestroy(Activity.java:4629)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:
1079)
05-29 23:16:27.185: E/AndroidRuntime(606):  at
android.app.ActivityThread.performDestroyActivity(ActivityThread.java:
3099)
05-29 23:16:27.185: E/AndroidRuntime(606):  ... 11 more

-- 
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


[android-developers] Bluetooth

2012-05-21 Thread Samuel Caetano
Hello guys, i've been looking for some docs about bluetooth in
android
Can you guy show me some docs about it? 'cause i've been trying to use
the google documents explanations about bluetooth, but that was a full
waste of time

-- 
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


Re: [android-developers] Bluetooth

2012-05-21 Thread Kristopher Micinski
That's the best / most up to date documentation...

There is no third party source writing extensive docs for the Android
platform... So the Bluetooth section of the API along with detailed
docs of  the interfaces are your best bet.

On Sat, May 19, 2012 at 10:06 PM, Samuel Caetano sam.kaet...@gmail.com wrote:
 Hello guys, i've been looking for some docs about bluetooth in
 android
 Can you guy show me some docs about it? 'cause i've been trying to use
 the google documents explanations about bluetooth, but that was a full
 waste of time

 --
 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 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


Re: [android-developers] Bluetooth

2012-05-21 Thread Raunaque Quaiser
what you are looking in BT docs. Any thing specific?

Regards
Raunaque

On Mon, May 21, 2012 at 9:09 PM, Kristopher Micinski krismicin...@gmail.com
 wrote:

 That's the best / most up to date documentation...

 There is no third party source writing extensive docs for the Android
 platform... So the Bluetooth section of the API along with detailed
 docs of  the interfaces are your best bet.

 On Sat, May 19, 2012 at 10:06 PM, Samuel Caetano sam.kaet...@gmail.com
 wrote:
  Hello guys, i've been looking for some docs about bluetooth in
  android
  Can you guy show me some docs about it? 'cause i've been trying to use
  the google documents explanations about bluetooth, but that was a full
  waste of time
 
  --
  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 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 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

Re: [android-developers] Bluetooth Peer to Peer network in Android..

2012-05-21 Thread mike digioia
You can do this with a multicast based Openfire system! This uses IP.
Bluetooth as the transport using sockets is still under study, since I am
just attempting to get the first case to work with only one chat between
two phones. Since this uses Content Centric networking, it can be extended
to handle many nodes by extending bluetooth headers and doing packet
fragmentation (BT max is 950) to handle large packets.

On Sun, May 20, 2012 at 10:01 AM, Kristopher Micinski 
krismicin...@gmail.com wrote:

 You basically, can't do it for Bluetooth, with more than two / three
 (max usually) nodes.

 You can look into wifi direct.

 You can also put a p2p overlay on top of a standard java socket.  But
 that makes this no more interesting than any desktop java app.  I.e.,
 there is absolutely nothing that makes it Android specific.

 http://www.zeromq.org/build:android

 There's a 0MQ build on Android, but it's using the NDK, and I haven't
 seen Java bindings, so it's probably going to a real pain to use.
 (Though in real apps, a message queue like 0mq would be a real
 lifesaver, since you're basically going to emulate that anyway!)

 kris

 On Sun, May 20, 2012 at 12:41 PM, sudheesh ap hellosud...@gmail.com
 wrote:
   Yes, it's for a class project. The aim is to make a p2p overlay
 network
  in android platform to  support p2p android applications such as
 multiplayer
  games.I was asking about the possibility to make it over the
 bluetooth/wifi
  connection. Waiting for your valuable suggestions.
 
  Regards,
  sap
 
  --
  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 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 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

Re: [android-developers] Bluetooth Peer to Peer network in Android..

2012-05-21 Thread Kristopher Micinski
Right, that's what I said... But I also said that I doubt that for a
real live device, if any one can have more than two open connections
at a time, I'd be surprised, please tell if so!  And, if you're
talking to 950 nodes where the average degree is two for each node...
That's gonna be pretty harsh ;-)

kris

On Mon, May 21, 2012 at 12:53 PM, mike digioia mpd...@gmail.com wrote:
 You can do this with a multicast based Openfire system! This uses IP.
 Bluetooth as the transport using sockets is still under study, since I am
 just attempting to get the first case to work with only one chat between two
 phones. Since this uses Content Centric networking, it can be extended to
 handle many nodes by extending bluetooth headers and doing packet
 fragmentation (BT max is 950) to handle large packets.

 On Sun, May 20, 2012 at 10:01 AM, Kristopher Micinski
 krismicin...@gmail.com wrote:

 You basically, can't do it for Bluetooth, with more than two / three
 (max usually) nodes.

 You can look into wifi direct.

 You can also put a p2p overlay on top of a standard java socket.  But
 that makes this no more interesting than any desktop java app.  I.e.,
 there is absolutely nothing that makes it Android specific.

 http://www.zeromq.org/build:android

 There's a 0MQ build on Android, but it's using the NDK, and I haven't
 seen Java bindings, so it's probably going to a real pain to use.
 (Though in real apps, a message queue like 0mq would be a real
 lifesaver, since you're basically going to emulate that anyway!)

 kris

 On Sun, May 20, 2012 at 12:41 PM, sudheesh ap hellosud...@gmail.com
 wrote:
       Yes, it's for a class project. The aim is to make a p2p overlay
  network
  in android platform to  support p2p android applications such as
  multiplayer
  games.I was asking about the possibility to make it over the
  bluetooth/wifi
  connection. Waiting for your valuable suggestions.
 
  Regards,
  sap
 
  --
  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 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 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 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


Re: [android-developers] Bluetooth Peer to Peer network in Android..

2012-05-21 Thread mike digioia
Oh sorry I just stated what I believe is the current packet size linitation
of BT as 950.

Yes you are correct about the limitations on any one device today. However,
the CCNX will handle the networking of devices as it does today over IP.
Nothing is being changed inside the CCND except to handle as additional BT
socket type.

On Mon, May 21, 2012 at 9:56 AM, Kristopher Micinski krismicin...@gmail.com
 wrote:

 Right, that's what I said... But I also said that I doubt that for a
 real live device, if any one can have more than two open connections
 at a time, I'd be surprised, please tell if so!  And, if you're
 talking to 950 nodes where the average degree is two for each node...
 That's gonna be pretty harsh ;-)

 kris

 On Mon, May 21, 2012 at 12:53 PM, mike digioia mpd...@gmail.com wrote:
  You can do this with a multicast based Openfire system! This uses IP.
  Bluetooth as the transport using sockets is still under study, since I am
  just attempting to get the first case to work with only one chat between
 two
  phones. Since this uses Content Centric networking, it can be extended to
  handle many nodes by extending bluetooth headers and doing packet
  fragmentation (BT max is 950) to handle large packets.
 
  On Sun, May 20, 2012 at 10:01 AM, Kristopher Micinski
  krismicin...@gmail.com wrote:
 
  You basically, can't do it for Bluetooth, with more than two / three
  (max usually) nodes.
 
  You can look into wifi direct.
 
  You can also put a p2p overlay on top of a standard java socket.  But
  that makes this no more interesting than any desktop java app.  I.e.,
  there is absolutely nothing that makes it Android specific.
 
  http://www.zeromq.org/build:android
 
  There's a 0MQ build on Android, but it's using the NDK, and I haven't
  seen Java bindings, so it's probably going to a real pain to use.
  (Though in real apps, a message queue like 0mq would be a real
  lifesaver, since you're basically going to emulate that anyway!)
 
  kris
 
  On Sun, May 20, 2012 at 12:41 PM, sudheesh ap hellosud...@gmail.com
  wrote:
Yes, it's for a class project. The aim is to make a p2p overlay
   network
   in android platform to  support p2p android applications such as
   multiplayer
   games.I was asking about the possibility to make it over the
   bluetooth/wifi
   connection. Waiting for your valuable suggestions.
  
   Regards,
   sap
  
   --
   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 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 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 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 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

Re: [android-developers] Bluetooth Peer to Peer network in Android..

2012-05-21 Thread Kristopher Micinski
That would be the same as any other message queue adapted to sit on
top of a different socket layer, however, I believe...

kris

On Mon, May 21, 2012 at 1:11 PM, mike digioia mpd...@gmail.com wrote:
 Oh sorry I just stated what I believe is the current packet size linitation
 of BT as 950.

 Yes you are correct about the limitations on any one device today. However,
 the CCNX will handle the networking of devices as it does today over IP.
 Nothing is being changed inside the CCND except to handle as additional BT
 socket type.


 On Mon, May 21, 2012 at 9:56 AM, Kristopher Micinski
 krismicin...@gmail.com wrote:

 Right, that's what I said... But I also said that I doubt that for a
 real live device, if any one can have more than two open connections
 at a time, I'd be surprised, please tell if so!  And, if you're
 talking to 950 nodes where the average degree is two for each node...
 That's gonna be pretty harsh ;-)

 kris

 On Mon, May 21, 2012 at 12:53 PM, mike digioia mpd...@gmail.com wrote:
  You can do this with a multicast based Openfire system! This uses IP.
  Bluetooth as the transport using sockets is still under study, since I
  am
  just attempting to get the first case to work with only one chat between
  two
  phones. Since this uses Content Centric networking, it can be extended
  to
  handle many nodes by extending bluetooth headers and doing packet
  fragmentation (BT max is 950) to handle large packets.
 
  On Sun, May 20, 2012 at 10:01 AM, Kristopher Micinski
  krismicin...@gmail.com wrote:
 
  You basically, can't do it for Bluetooth, with more than two / three
  (max usually) nodes.
 
  You can look into wifi direct.
 
  You can also put a p2p overlay on top of a standard java socket.  But
  that makes this no more interesting than any desktop java app.  I.e.,
  there is absolutely nothing that makes it Android specific.
 
  http://www.zeromq.org/build:android
 
  There's a 0MQ build on Android, but it's using the NDK, and I haven't
  seen Java bindings, so it's probably going to a real pain to use.
  (Though in real apps, a message queue like 0mq would be a real
  lifesaver, since you're basically going to emulate that anyway!)
 
  kris
 
  On Sun, May 20, 2012 at 12:41 PM, sudheesh ap hellosud...@gmail.com
  wrote:
        Yes, it's for a class project. The aim is to make a p2p overlay
   network
   in android platform to  support p2p android applications such as
   multiplayer
   games.I was asking about the possibility to make it over the
   bluetooth/wifi
   connection. Waiting for your valuable suggestions.
  
   Regards,
   sap
  
   --
   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 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 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 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 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 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


Re: [android-developers] Bluetooth Peer to Peer network in Android..

2012-05-21 Thread mike digioia
Multicast does this for you automatically, however, Bluetooth currently
does not support multicast like IP. It is PTP.

see this link:

http://www.google.com/url?sa=trct=jq=esrc=ssource=webcd=2ved=0CF4QFjABurl=http%3A%2F%2Fwireless.cs.tku.edu.tw%2F~cychang%2FTMCP.pdfei=Z366T63_MLGUmQXHj4GzCQusg=AFQjCNGw-2ARQ1I-FXu30Qtpxgwsh3Wb9wsig2=vedcvR89NgXqjsJV9Fz1vQ


On Mon, May 21, 2012 at 10:23 AM, Kristopher Micinski 
krismicin...@gmail.com wrote:

 That would be the same as any other message queue adapted to sit on
 top of a different socket layer, however, I believe...

 kris

 On Mon, May 21, 2012 at 1:11 PM, mike digioia mpd...@gmail.com wrote:
  Oh sorry I just stated what I believe is the current packet size
 linitation
  of BT as 950.
 
  Yes you are correct about the limitations on any one device today.
 However,
  the CCNX will handle the networking of devices as it does today over IP.
  Nothing is being changed inside the CCND except to handle as additional
 BT
  socket type.
 
 
  On Mon, May 21, 2012 at 9:56 AM, Kristopher Micinski
  krismicin...@gmail.com wrote:
 
  Right, that's what I said... But I also said that I doubt that for a
  real live device, if any one can have more than two open connections
  at a time, I'd be surprised, please tell if so!  And, if you're
  talking to 950 nodes where the average degree is two for each node...
  That's gonna be pretty harsh ;-)
 
  kris
 
  On Mon, May 21, 2012 at 12:53 PM, mike digioia mpd...@gmail.com
 wrote:
   You can do this with a multicast based Openfire system! This uses IP.
   Bluetooth as the transport using sockets is still under study, since I
   am
   just attempting to get the first case to work with only one chat
 between
   two
   phones. Since this uses Content Centric networking, it can be extended
   to
   handle many nodes by extending bluetooth headers and doing packet
   fragmentation (BT max is 950) to handle large packets.
  
   On Sun, May 20, 2012 at 10:01 AM, Kristopher Micinski
   krismicin...@gmail.com wrote:
  
   You basically, can't do it for Bluetooth, with more than two / three
   (max usually) nodes.
  
   You can look into wifi direct.
  
   You can also put a p2p overlay on top of a standard java socket.  But
   that makes this no more interesting than any desktop java app.  I.e.,
   there is absolutely nothing that makes it Android specific.
  
   http://www.zeromq.org/build:android
  
   There's a 0MQ build on Android, but it's using the NDK, and I haven't
   seen Java bindings, so it's probably going to a real pain to use.
   (Though in real apps, a message queue like 0mq would be a real
   lifesaver, since you're basically going to emulate that anyway!)
  
   kris
  
   On Sun, May 20, 2012 at 12:41 PM, sudheesh ap hellosud...@gmail.com
 
   wrote:
 Yes, it's for a class project. The aim is to make a p2p
 overlay
network
in android platform to  support p2p android applications such as
multiplayer
games.I was asking about the possibility to make it over the
bluetooth/wifi
connection. Waiting for your valuable suggestions.
   
Regards,
sap
   
--
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 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 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 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 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 

Re: [android-developers] Bluetooth Peer to Peer network in Android..

2012-05-21 Thread Kristopher Micinski
Yes, I understand what multicast means :-)...

And yes, this is what I'm trying to point out, the problem is that you
can't multicast to so many nodes for a given device because the
hardware *just won't* support it for *most* devices out there these
days...

And furthermore, I'm saying that even if you overlay a multicast layer
on top of the Bluetooth connection, you will still have pretty crappy
connectivity, because I've only ever see people get it working with
2/3 nodes, with a hard limit of 7 (iirc) for a piconet...  Though I
just don't see utility in multicasting to that many people at once via
BT, that's just *not* what the protocol's (medium's?) intended for...

kris

On Mon, May 21, 2012 at 1:49 PM, mike digioia mpd...@gmail.com wrote:
 Multicast does this for you automatically, however, Bluetooth currently does
 not support multicast like IP. It is PTP.

 see this link:

 http://www.google.com/url?sa=trct=jq=esrc=ssource=webcd=2ved=0CF4QFjABurl=http%3A%2F%2Fwireless.cs.tku.edu.tw%2F~cychang%2FTMCP.pdfei=Z366T63_MLGUmQXHj4GzCQusg=AFQjCNGw-2ARQ1I-FXu30Qtpxgwsh3Wb9wsig2=vedcvR89NgXqjsJV9Fz1vQ


 On Mon, May 21, 2012 at 10:23 AM, Kristopher Micinski
 krismicin...@gmail.com wrote:

 That would be the same as any other message queue adapted to sit on
 top of a different socket layer, however, I believe...

 kris

 On Mon, May 21, 2012 at 1:11 PM, mike digioia mpd...@gmail.com wrote:
  Oh sorry I just stated what I believe is the current packet size
  linitation
  of BT as 950.
 
  Yes you are correct about the limitations on any one device today.
  However,
  the CCNX will handle the networking of devices as it does today over IP.
  Nothing is being changed inside the CCND except to handle as additional
  BT
  socket type.
 
 
  On Mon, May 21, 2012 at 9:56 AM, Kristopher Micinski
  krismicin...@gmail.com wrote:
 
  Right, that's what I said... But I also said that I doubt that for a
  real live device, if any one can have more than two open connections
  at a time, I'd be surprised, please tell if so!  And, if you're
  talking to 950 nodes where the average degree is two for each node...
  That's gonna be pretty harsh ;-)
 
  kris
 
  On Mon, May 21, 2012 at 12:53 PM, mike digioia mpd...@gmail.com
  wrote:
   You can do this with a multicast based Openfire system! This uses IP.
   Bluetooth as the transport using sockets is still under study, since
   I
   am
   just attempting to get the first case to work with only one chat
   between
   two
   phones. Since this uses Content Centric networking, it can be
   extended
   to
   handle many nodes by extending bluetooth headers and doing packet
   fragmentation (BT max is 950) to handle large packets.
  
   On Sun, May 20, 2012 at 10:01 AM, Kristopher Micinski
   krismicin...@gmail.com wrote:
  
   You basically, can't do it for Bluetooth, with more than two / three
   (max usually) nodes.
  
   You can look into wifi direct.
  
   You can also put a p2p overlay on top of a standard java socket.
    But
   that makes this no more interesting than any desktop java app.
    I.e.,
   there is absolutely nothing that makes it Android specific.
  
   http://www.zeromq.org/build:android
  
   There's a 0MQ build on Android, but it's using the NDK, and I
   haven't
   seen Java bindings, so it's probably going to a real pain to use.
   (Though in real apps, a message queue like 0mq would be a real
   lifesaver, since you're basically going to emulate that anyway!)
  
   kris
  
   On Sun, May 20, 2012 at 12:41 PM, sudheesh ap
   hellosud...@gmail.com
   wrote:
     Yes, it's for a class project. The aim is to make a p2p
overlay
network
in android platform to  support p2p android applications such as
multiplayer
games.I was asking about the possibility to make it over the
bluetooth/wifi
connection. Waiting for your valuable suggestions.
   
Regards,
sap
   
--
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 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 post to this group, send email to
   android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   

Re: [android-developers] Bluetooth Peer to Peer network in Android..

2012-05-20 Thread sudheesh ap
Thanks for your reply. I will consider WiFi for the chord implementation.


With regards,
sudheesh

-- 
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

Re: [android-developers] Bluetooth Peer to Peer network in Android..

2012-05-20 Thread Kristopher Micinski
Wifi for the cord implementation?

How?

Wifi is infrastructure mode, did you mean wifi direct?

Otherwise anything you're doing is necessarily just an emulated
overlay of p2p on top of an standard socket.

kris

On Sun, May 20, 2012 at 4:29 AM, sudheesh ap hellosud...@gmail.com wrote:
 Thanks for your reply. I will consider WiFi for the chord implementation.


 With regards,
     sudheesh

 --
 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 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


Re: [android-developers] Bluetooth Peer to Peer network in Android..

2012-05-20 Thread Kristopher Micinski
It just seems like using chord in this case would be a tad forced, is
it a requirement for a class project or something?

kris

On Sun, May 20, 2012 at 11:29 AM, Kristopher Micinski
krismicin...@gmail.com wrote:
 Wifi for the cord implementation?

 How?

 Wifi is infrastructure mode, did you mean wifi direct?

 Otherwise anything you're doing is necessarily just an emulated
 overlay of p2p on top of an standard socket.

 kris

 On Sun, May 20, 2012 at 4:29 AM, sudheesh ap hellosud...@gmail.com wrote:
 Thanks for your reply. I will consider WiFi for the chord implementation.


 With regards,
     sudheesh

 --
 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 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


Re: [android-developers] Bluetooth Peer to Peer network in Android..

2012-05-20 Thread sudheesh ap
 Yes, it's for a class project. The aim is to make a p2p overlay
network in android platform to  support p2p android applications such as
multiplayer games.I was asking about the possibility to make it over the
bluetooth/wifi connection. Waiting for your valuable suggestions.

Regards,
sap

-- 
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

Re: [android-developers] Bluetooth Peer to Peer network in Android..

2012-05-20 Thread Kristopher Micinski
You basically, can't do it for Bluetooth, with more than two / three
(max usually) nodes.

You can look into wifi direct.

You can also put a p2p overlay on top of a standard java socket.  But
that makes this no more interesting than any desktop java app.  I.e.,
there is absolutely nothing that makes it Android specific.

http://www.zeromq.org/build:android

There's a 0MQ build on Android, but it's using the NDK, and I haven't
seen Java bindings, so it's probably going to a real pain to use.
(Though in real apps, a message queue like 0mq would be a real
lifesaver, since you're basically going to emulate that anyway!)

kris

On Sun, May 20, 2012 at 12:41 PM, sudheesh ap hellosud...@gmail.com wrote:
      Yes, it's for a class project. The aim is to make a p2p overlay network
 in android platform to  support p2p android applications such as multiplayer
 games.I was asking about the possibility to make it over the bluetooth/wifi
 connection. Waiting for your valuable suggestions.

 Regards,
 sap

 --
 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 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


  1   2   3   4   >