Android Question Run Bluetooth from a service

Status
Not open for further replies.

Cenny

Active Member
Licensed User
Longtime User
What is the advantage of running Bluetooth from a service?

Cenny
 

Cenny

Active Member
Licensed User
Longtime User
The rule is: never implement Bluetooth / network communication in an activity. Activities are paused and destroyed.
If you are using B4XPages then you don't need a service.
Then Implementation via a class module, like in the tutorial is ok I presume?
 
Upvote 0

Yimcy

Member
Hi to every one here,please am new here and a beginner in B4A too, I had issues that am pleading for assistance,I manage to write some code in B4A to connect to device HC-05 Bluetooth module together with my Android using bluetooth, the android code works well in foreground and does all I wanted, but I can't get any data via the service from the Asycstream to read from the background please I need assistance,am stock here over 4 months now.all I need is to listen to the bluetooth even at the background using Service Module. Thanks in advance
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Short: Run all components in a service which aren't UI relevant. You can use it as a template for future projects, too. I move even "helper libs" like Stringutils, ByteConverter, Encryption etc. to a service. For another app I can copy it and delete what I don't need.
 
Upvote 0

Yimcy

Member
Thank you Sir. Am new here and am just trying to understand the forum and also table my issue before Gurus.
Please I need a simple service code to retrieve data when the main activity is pulsedesigned please
 
Upvote 0

Yimcy

Member
Thank you Sir. Am new here and am just trying to understand the forum and also table my issue before Gurus.
Please I need a simple service code to retrieve data when the main activity is pulsedesigned please using Bluetooth connections
 
Upvote 0

Yimcy

Member
Good day all.
Please I want to implement Bluetooth communication via service module but I couldn't.
Because they text reader always clash my app.
Please what should I use?
 
Upvote 0
Status
Not open for further replies.
Top