[Discontinued] Background Tasks [4.1] 🥳

Hello, tank you very much Xoma for your help but i have a problem the app must send with bluetooth every informations and must be fonctionnal without internet so this is possible ?

2 Likes

Yes, this is possible but may be very complicated to do this. You can almost use every extensions and component using the extension.

First, go throughout my blocks and examples and try with small things experimenting and if you find any problem then you can report it to me :smile:

1 Like

Ok tank you i will try but the app must also be connected to a device in background :sweat_smile:.

3 Likes

This post was flagged by the community and is temporarily hidden.

1 Like

I have created notification from firebase using this extension @Boban @mod please enable me to post topics

3 Likes

when sending push ! is firebase unlimited like onesignal?

1 Like

i think that if you show me an exemple with this i will understand so can you please put this in the background ?

1 Like

Please can you give me the aia file? im little bit confuse

1 Like

He created a Guide [With Aia] on it -

1 Like

If you need the .aia :SmartConnect_copie.aia (662.7 KB)

1 Like

You will not be able to pick any custom item in the runtime of the extension. Instead what you can do is pick a fixed devive and attempt to connect to it.

I’ve tested the below blocks (in foreground mode) getting the Bluetooth devices and show it in a notification.

When I turn on my Pc’s bluetooth and connect it to my bluetooth (its automatic) I get a notification of the new devices and the connected device.

Also I hope you can go further like when the device is connected sending data, or sending the same data received from the device as the tests.

I have tested it in a foreground service and not testing without it…

You must have to make sure all the APK permissions are allowed as well (the storage and the location) permission asking or manully. This is because the Bluetooth Admin component attempts to ask these permissions while the app is in the background state and it will crash.

Also read this:

To make it easy for you to understand:

  • The create component block just creates the new component dynamically in the Background.
  • Create Function block is to set up a function or a block with values (as lists) but not calling it. Because this will be called by CallFunction block with the function Id.
  • Regester a event means it will listen to all the events and filter out those which is regestered and accordingly call out the function Ids with the event values that can be accesed like {%0} Zero is the first value of the event or the counting starts from Zero,
1 Like

Yeah it’s the same but One signal should be a stable solution. But doing this way is just easy…

2 Likes

Ok tank you very much for your help, its pretty complexe but i will try to make my app alone !

2 Likes

You can ask here when you’re stuck into something (:

1 Like

Ok ! Just on thing i don’t need notification i can do this without notification ?

You can simply remove the register event block for that. This way the event will be ignored.

You can send a connect request to the device but you’ll need to extract the element from the device list as the device name/address and then connect to it but I realize that you cannot do it for the event values. We can do it through the Bluetooth client component:

25.06.2021_16.41.08_REC

This will directly return the address and the names which we can later pick a element. If you invoke this instead of the Bluetooth Admin’s event values and you can connected to it something like this:

25.06.2021_16.47.06_REC

If you want to get the first BLE device and connect it then you can use the segment (invoke:result:[0]) with the MakeExtra and send as the device address. But you’ll need to separate the Addresses and Names which is not posible in the current version. So instead you can provide a fixed element to connect.

2 Likes

Ok tank you !

1 Like

i don’t need to connect a device, Actually it is an application for a diy smart whatch so i start the app, i connect the device and when i put the cellphone standby (the screen is off) the app must be stay connected to the device and continue to collect data (time, steps) and send it to the device but it is pretty complicated and i don’t know how i can really made this. (i made the app but i don’t know how to put every fonctionnality on the background and if you want you can check my work)

That’s way complicated work. Why don’t you upload the steps to the database like firebase? And get the data at another end?

The alternative easy solution that requires the internet:

You just store the steps and get the value from another phone.

I can do this because i must not be dependent on the internet because it is a SmartWhatch but Can we do this with tiny DB ?