Open Source β€’ Background Tasks: Itoo πŸš€

Yes, sorry, it is called LogInfo
Remove the 2 Firebase blocks and test again

Check also the log for itoo errors

Taifun

1 Like

You the Goat my friend!
Thank you so much for helping :slight_smile:
I've got it working now

Please let us know what the issue was and provide a screenshot of the working solution

Taifun

sure thing :slight_smile:

the block has changed quite a bit, because i've been working on it since that last post.

but here is the current block:

I pretty much just did what you said. However, I never saw anything inside the adb console.
Instead, i pushed a few notifications with "MelonNotification" to see the output content as well as just "the fact that the timer was working" more or less :person_shrugging:

I hope this is explanation enough xD I'm a beginner as far as using the App Inventor. So I'm not sure that I documented really all the changes.

1 Like

Hi everyone,
I'm working on an app that connects my Android (Android 13) to an Arduino using an HM10 BLE module. Right now, the app works as expected while it's open, but I'm trying to improve it by keeping certain features running in the foreground (and maybe even in the background later).
What I ened help with:First, keeping Auto-Reconnect working in the foreground
I tried making it work in the foreground, but it doesn't. As I said, it works when the app is on the screen. I’m not sure which blocks I should be using, or if that is even possible. Second, I also want the app to display a notification with the received string when data is sent from the Arduino. Do I need another extension for this?

Thanks in advance!

So you said, auto reconnect works when the app is open. Isn't that identical to foreground or do you have another definition for foreground?

Are you using Bluetooth Classic?
To try something with itoo follow the description in the first post of this thread. Try some examples to get familiar with the extension and if you have specific questions show us a screenshot of your relevant blocks

Yes, let me recommend

See also some examples there

Taifun

I think I missunderstood the definition in the extension description. What I mean, is for example, if I lock my Andorid screen, after 10mins max, the device disconnects, or that if I go away of the device, it disconnects, and I would like it to reconnect automatically. I then understand that what I need is the reconnect blocks to be working also in background? I am using a HM10 BLE module, so not Bluetooth classic.

Thanks for the recommendation. WIth the Melon extension, I can receive push notifications, as long as my device is still connected, right? So, for example my Android is locked, and a string is received, so I can show in the lockscreen a notification that the device has sent data.

Thanks for your help

I'm not a BLE specialist, but here in this thread there are already a few BLE itoo projects

Yes you can

Taifun

Hey Taifun,

Me again.
I'm having an issue where, when my process is running in the foreground. I will close my app, and then attempt to reopen it; this causes the app to more or less just crash before fully opening, until i force close it.

Any idea off hand what could cause that? I can ofc provide ss of the blocks upon your request.

Thanks again,

ispankzombiez

Please elaborate

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


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

yup.

here is a ss of it.

hopefully its not to much :laughing:
i've been at it for a minute now.

here is the blocks for the related processes
Screenshot_137

this is where the foreground process is being started

the logic of the app is like this.

  1. hits login screen (screen 1)
  2. checks for profile (login info / remember me info)
  3. if present, logs in, moves to "main" screen (this screen)
  4. else, asks for register/login

your large screenshot is of bad quality, unfortunately I can't read it
waht I can see here is you could simplify a bit... also I would use the same tags for TinyDB and itoo to avoid errors...
unknown

use logcat to find out what's going on as mentioned earlier

Taifun

Hey Taifun,

I think I may have figured out my issue :upside_down_face:
I was not properly checking if the app already had notification permission before requesting it... :laughing:
my mistake

-ispankzombiez

so contrary to my previous comment, that did not actually solve my problem :upside_down_face:

i've tracked the source of the error to this block.

which results in a screen that looks like this.

and the app will just sort of stuck right there indefinitly, even if i close the app and restart.
i have to force close it to get it to show the visuals again. But the foreground process (background whatchamacalit) will still be updating and pinging off the notifications correctly.

but i do have to close the app in tasker once (or sometimes more) to accomplish this error.

I'm sorry that my explanations are not great. but i'll post some follow up screenshots shortly.

login / landing page (screen1)

slightly better screenshots of the "next page" ("home" / where the process is launched)


i hope this helps :upside_down_face: im kind of at a loss for what is causing this tbh...
im very new to this. so im not even really sure what to look for.

Edit:

As long as i dont swipe away this notification, it seems to work fine. But if i swipe it away, the app instant does the white screen of death.

Use logcat to find out more

Taifun

so brought up the log cat.
but it doesn't mean much to me :confused:

hopefully this means something to you?
i really truly cannot put into words the amount of appreciation i have for you friend :pray:

04-13 18:58:05.756 1707 1801 D RenderEngine: [SEC_GC_CMN_SF_EFFECTS] drawLayersInternal,1279, Rendering layer Splash Screen appinventor.ai_caleb_bren1.SFL_Notifi$_4070#443457 at index 1

04-13 18:58:10.049 2352 3857 D MdnieScenarioControlService: packageName : appinventor.ai_caleb_bren1.SFL_Notifi className : appinventor.ai_caleb_bren1.SFL_Notifi.Screen1

04-13 18:58:11.735 2352 8395 D SGM:GameManager: identifyGamePackage. appinventor.ai_caleb_bren1.SFL_Notifi, mCurrentUserId: 0, callerUserId: 0, callingMethodInfo: com.samsung.android.game.IGameManagerService$Stub.onTransact(IGameManagerService.java:233)

04-13 18:58:11.735 2352 8395 D SGM:PkgDataHelper: getGamePkgData(). appinventor.ai_caleb_bren1.SFL_Notifi

04-13 18:58:11.819 2352 5054 D SGM:GameManager: identifyForegroundApp. appinventor.ai_caleb_bren1.SFL_Notifi, mCurrentUserId: 0, callerUserId: 0

04-13 18:58:11.820 2352 5054 D SGM:PkgDataHelper: getGamePkgData(). appinventor.ai_caleb_bren1.SFL_Notifi

04-13 18:58:13.237 2352 3857 D MdnieScenarioControlService: packageName : appinventor.ai_caleb_bren1.SFL_Notifi className : appinventor.ai_caleb_bren1.SFL_Notifi.Screen1

04-13 18:58:13.253 9389 9401 W gle.android.gms: ApkAssets: Deleting an ApkAssets object ' and /data/app/~~xwvLL8gZyCeYbkW74kFrDg==/appinventor.ai_caleb_bren1.SFL_Notifi-M4C7MhOMOpBD41RhUIahmw==/base.apk' with 1 weak references

04-13 18:58:13.696 4486 22756 I SearchEngine: isComponentInApps() packageName : appinventor.ai_caleb_bren1.SFL_Notifi / className : appinventor.ai_caleb_bren1.SFL_Notifi.Screen1 / userId : 0 / enable true / enabledSetting 0

04-13 18:58:13.696 4486 22756 I SearchEngine: isComponentInApps() packageName : appinventor.ai_caleb_bren1.SFL_Notifi / className : appinventor.ai_caleb_bren1.SFL_Notifi.Screen1 / userId : 0 / enable true / enabledSetting 0

this last one just repeats after the screen gets stuck on the white opening screen.

if this doesn't show what you need, a point in the right direction as far as how else i should filter it would be awesome :slight_smile:
im currently filtering it like this.

adb logcat | findstr appinventor.ai_caleb_bren1.SFL_Notifi

Your blocks are still of low quality and cannot be read. Please download relevant block individually by right click then Download blocks.