0
I’m creating a small app with two activities, the first is a screen with only a 'connect' button, after connected to the bluetooth module it would change to the second screen (Second Activity) where would be the command to send by bluetooth.
The question is: How to use the connection made in the first Activity to send data in the second...
I thought about passing the Bluetoothsocket as an extra on Intent, but it was not possible because it does not implement serializable.
You want to send what exactly from the first to the second Activity?
– Lollipop
So, here’s the problem, I’m not sure it’s necessary... but I’ve had the idea to send the Bluetoothsocket or the Inputstream.... My intention is to isolate the connection and the sending of data
– Kevin Brayan
And my last question: what is the purpose of passing on this information?
– Lollipop
I didn’t want the other screen I sent the commands to be "polluted" with a button to connect...
– Kevin Brayan
So you want to remove this button? I don’t understand what your goal is about passing parameters to a second activity. Can you explain only the purpose of this transfer? It seems to me you want to do something simple through a lot of work.
– Lollipop
That, wanted to make an input screen. A "cover" with the button connect. If the connection established, it would enter the second Activity.
– Kevin Brayan
I think you should isolate all this logic that deals with Bluetooth for a Service, as it would avoid the coupling with a certain Activity.
– Wakim