Number of Bluetooth Connections

by vishy » Wed, 01 Apr 2009 14:57:49 GMT


Sponsored Links
 Hi ,

During our initial testing with Android Phones(Using Cupcake build) we
noticed that the phone connects to more than one BT HF device.Can
anyone share some information on the number of devices Android phones
can connect to via Bluetooth!

Like ,can we connect Phone A to HFP only Headset and PhoneA to A2DP
only Headset,simultaneously!

If multiple connections are supported,what would be the criteria on
which it
is done!

Thanks&Regards,
Vishy
--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Number of Bluetooth Connections

by Nick Pelly » Fri, 03 Apr 2009 04:47:36 GMT


 


Have you tried reading the javadoc in BluetoothHeadset.java or
BluetoothA2dp.java ?

Nick

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---


Sponsored Links


Number of Bluetooth Connections

by Jackson Fan » Fri, 03 Apr 2009 06:12:07 GMT


 Hi Nick,
         Supporting connection to a single device can be understood. I
want to expand the topic a bit, related to multiple connections to a
same device. For example, cupcake already supports A2DP and HFP
connection to a same headset in concurrent way, although audio data
(A2DP/SCO) need be switched depending on call state. However,
framework code to control such concurrency is weak and cupcake depends
on applications to handle them properly, like in mediaplaybackservice
and BluetoothHandsfree. Are there any plan to support audio switch
from framework level?
         The reason is because cupcake does not implement the
recommendation as from the "Bluetooth White Paper Simultaneous use of
HFP, A2DP, and AVRCP profiles" (url:
https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=49216).
Current A2DP->SCO switch has a limitation depending on other side
interoperating capability - for incoming call case suppose headset
could not echo "A2DP data to close" signal back to phone, I guess A2DP
data channel becomes a unknown state along with SCO being setup. So
during a call in case user still tries to launch music player, effect
depends on hardware implementation of two sides.
         Also suppose later people want to add more profiles,
concurrency need be controlled otherwise data flow competing will
threaten overall quality. I do not know whether you plan to add Qos
mechanism when multiple data related profiles being active, like DUN,
OPP, PBAP, A2DP, PAN, etc? Although conflicting cases may be rare, I
know some carkits can make calls or listening to music while
transferring phonebook entries (via OBEX) via Bluetooth.

Jackson






--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Number of Bluetooth Connections

by Nick Pelly » Mon, 06 Apr 2009 23:17:18 GMT


 i 'Jackson Fan',

I agree with your analysis. The framework code to handle A2DP / SCO
transitions could be improved. In the current design A2DP and HFP are
loosely coupled independent services. In retrospect you actually need
a fair degree of coupling between them in order to make the SCO/A2DP
transitions in a way that inter-operates with a greater number of
bluetooth headsets.

We have been planning to add a 'Profile Manager' layer to handle
connection sequence serialization between various profiles.

Nick



On 4/2/09, Jackson Fan <xy...@motorola.com> wrote:

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Number of Bluetooth Connections

by vishy » Thu, 09 Apr 2009 23:20:15 GMT


 Hi Nick,

Guess you are trying to point me to the below statement in
BluetoothHeadset.java!

* Android only supports one connected Bluetooth Headset at a time."

Although we do not observe it every time,we have noticed that it is
possible to connect to a HF Stereo Device and to a HF Mono Device ,
simultaneously!

The Process would be:

1) Pair and connect ,only Media(Under the 'Options' Menu) ,with a
Stereo HF Device
2) Initiate a Connection from a Headset which was previously Paired
with the phone!

Vishy





--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Number of Bluetooth Connections

by Nick Pelly » Fri, 10 Apr 2009 03:31:34 GMT


 




Stereo Bluetooth uses a different profile - A2DP.






--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Number of Bluetooth Connections

by vishy » Sat, 11 Apr 2009 00:30:24 GMT


 Hi Nick,


the main concern is two ACL connections with two different devices,at
the same time.

Basically it would be helpfull,if we get to know from you guys ,if the
behaviour we notice is a bug(connecting to two different devices at
the same time) or works as designed.

Thanks &Regards,
Vishy








--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Number of Bluetooth Connections

by Nick Pelly » Sat, 11 Apr 2009 00:46:54 GMT


 




That is working as designed. The user can have a HFP connection to one
device, and an A2DP connection to another.









--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Number of Bluetooth Connections

by vishy » Mon, 13 Apr 2009 23:21:08 GMT


 Hi Nick,

Thanks for the Help.

Regards,
Vishy











--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Other Threads

1. Google reader api

I would like to sync some content in my application with google
reader. I know that there are apps on the market that access google
reader so I know that it can be done.

Are there any built in java apis in android to access google reader,
if not, what do you think is the best approach to implementing this.

I've googled a bit on this and I have some ideas on how to implement
this, but I don't want to reinvent the wheel if there already is a
working solution available.

Any thoughts on this subject?

/Martin

-- 

2. app not working in background

hi, i have an app that responds to user the incoming sms via speech .
The app seems to work perfectly when it is lauched or even when i
press the back button on the emulator, however when i start a new
app , then i receive the new message only as a Toast (as shown in the
prgm below) but i cannnot hear any sound. I checked the logcat and
found that in this situation i get the error that : "null synthesis-
can't speak" . Please can someone help me on this:

Here is the code having two classes:

TextSpeaker class:



package com.example.TextSpeaker;

import java.util.Locale;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

// the following programme converts the text to speech

public class TextSpeaker extends Activity  implements OnInitListener {
    /** Called when the activity is first created. */
        int MY_DATA_CHECK_CODE = 0;
        public static TextToSpeech mtts;
        public Button button,stop_button;

        @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        button = (Button)findViewById(R.id.button);
        stop_button=(Button)findViewById(R.id.stop_button);

        Intent myintent = new Intent();
        myintent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
        startActivityForResult(myintent, MY_DATA_CHECK_CODE);
        //edit text=(EditText)findViewById(R.id.edittext);
        }

        public void buttonClickListener(View src){
                switch(src.getId())
                {
                case(R.id.button):
                        Toast.makeText(getApplicationContext(), "The service has
been started\n Every new message will now be read out",
Toast.LENGTH_LONG).show();

                     break;
                case(R.id.stop_button):
                        Toast.makeText(getApplicationContext(), "The service has
been stopped\n ", Toast.LENGTH_LONG).show();
                    mtts.stop();
                        break;
                }
        }



        protected void onActivityResult(int requestcode,int
resultcode,Intent data)
        {
                if(requestcode == MY_DATA_CHECK_CODE)
                {
                        
if(resultcode==TextToSpeech.Engine.CHECK_VOICE_DATA_PASS)
                        {
                                // success so create the TTS engine
                                Log.v("TextSpeaker","Pico is installed in the 
system");
                                mtts = new TextToSpeech(this,this);
                                mtts.setLanguage(Locale.ENGLISH);

                        }
                        else
                        {
                                //install the Engine
                                Intent install = new Intent();
 
install.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
                                startActivity(install);
                        }
                }

        }

                @Override
                public void onInit(int status) {
                        if(status==TextToSpeech.SUCCESS)
                                button.setEnabled(true);

                }


    }


and here's the second class:

Receiver

package com.example.TextSpeaker;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.telephony.SmsMessage; // supports both gsm and cdma
import android.util.Log;
import android.widget.Toast;



public class Receiver extends BroadcastReceiver{


        public static String str;
        @Override
        public void onReceive(Context context, Intent intent) {
                Bundle bundle = intent.getExtras();
                Log.d("Receiver","Message received successfully");

                SmsMessage[] msgs = null;

                if(bundle!=null)
                {
                        // retrive the sms received

                        Object[] pdus = (Object[])bundle.get("pdus");
                        msgs = new SmsMessage[pdus.length];
                        for(int i=0;i<msgs.length;i++)
                        {
                                str="";
                                msgs[i]=SmsMessage.createFromPdu((byte[]) 
pdus[i]);
                                str+="Message From 
"+msgs[i].getOriginatingAddress()+".";
                                str+="The message is 
"+msgs[i].getMessageBody().toString();

                        }
                        Toast.makeText(context,str,Toast.LENGTH_LONG).show();
                        TextSpeaker.mtts.speak(Receiver.str,
TextToSpeech.QUEUE_FLUSH,null);

                }
        }
}

-- 

3. Menghilangkan Iklan

4. Mod: List Peserta (sementara) Gathering ID-Android with HTC Indonesia (Sabtu, 26 Juni 2010)

5. layout problem when orientation changed

6. how to bring up text to speech settings in my app?

7. alternative to tabhost