• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Same Bluetooth Connection for all Activities?

rich2020

Lurker
Oct 5, 2011
1
0
Hi all,

New to Android, so this may seem obvious.

Here's what I have: A class called BT_Comm
BT_Comm creates a bluetooth connection and allows me to send data with it via a method called sendData(int xxx, int yyy);

Now, I use this BT_Comm in my main activity -the first one.

Say I have 10 Activities, how could I access that same BT_Comm in other Activities?

Eg:

-------------------------------------------------------
Activity 1 (main)
Code:
BT_Comm bt = new BT_Comm();

pubic void someMethod()
{
bt.sendData(xxx, yyy);
}
-------------------------------------------------------

Activity 2
Code:
private void someOtherMethod()
{
bt.sendData(xxx, yyy);
}

-------------------------------------------------------

Activity 3
Code:
private void someOtherMethod()
{
bt.sendData(xxx, yyy);
}

-------------------------------------------------------

Does anyone know how I might do this?

Thanks,

Rich.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones