Listening to Bluetooth, and Fetching/Sending Text Messages in the background

So, I want to listen to incoming Bluetooth data, and send a text message in reply,
and If I get a text message I want to send that data over Bluetooth,
But in the background instead of foregrond

Im using a BluetoothLE extension, and the builtin texting extension,
Those work well when app in foreground.

I just want maybe examples of how to do it, then we can troubleshoot from there

I can't seem to figure it out, and this is my first time making a Topic? A question? Help? Idk, Please correct me if I do anything wrong
Thanks!

Try the itoo extension, read the complete thread and try the examples to learn how the extension works

See also this ble itoo example

Taifun

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

Hello, I got assistance months ago from Taifun, but I still can't figure out background services. If someone could help me get started with it, I’d really appreciate it. I don't understand how it works or how to interface with it, despite looking at various examples. If someone could look at my .aia file and help me get started, that would be great. Thanks!

https://ptsv3.com/d/b3g.aia (ptsv3 dot com/d/b3g.aia)

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Ah okay, good to know

I can't see you using itoo?
See again my previous answer

Also update to the latest version of the ble extension

Taifun

I haven't yet implemented it, as I don't understand how I would where. I've looked at various examples and I just don't quite understand background services

Its fine, you are just overwhelmed with a lot of information. Read the Itoo topic fully once. Then check out the Resources & Quick Start section that offers multiple test examples.

If you are using Android 14+ to test, then update with this extension:

Hmm, I kinda understood a little bit I dug a bit deeper, but when I open the app it crashes :confused: Here is what I've got now

What may I be doing wrong, Im using the android 14+ .aix file ( I am using Android 15 beta )

Thanks for the help!

The LocationChanged event does have 4 arguments, your event handler locationChange does have only 3
Also you could rename your arguments to get more readable argument names

Taifun

after fixing the arguments (adding the fourth), the app crash dialog pops up, but app doesnt crash (likely the service is crashing),
and I also notice that when my phone is turned off / on the lock screen the Location icon is gone (indicating location is not being used)

I tried the example aia for Itoo background tasks, and it isn't working either; But it isn't crashing

You have to use the latest version of itoo now because of the sdk 34 update

Use logcat to find out more about the crash

Taifun

You should use an extension, which is able to provide location updates in the background...

Taifun