Taifun Flashlight problems with some mobiles

Maybe my blocks contain an error, place an image.
I explain their function:
They have to make the flash blink every second until I stop it with a button.
On these phones it works
- Samsung Galaxy j3 2016 Android 5.1.1
-Huawey p8 lite android 6
- xiaomi mi 10 t lite 50 android 12

 It does not work
 1) oppo a91 android 11 (does not turn on the flashlight)
 1) Galaxy s20 android 12 (some times it starts and sometimes the flashlight doesn't start)
 3) Galaxy S10 android 9 (The flashlight stays on and does not turn off, blocking every operation of the phone that cannot be restarted, I have to wait a few minutes and then it restarts by itself luckily, I thought I had ruined the phone of one of mine friend.

The same thing happened to someone, how did you solve it?
Or is it just my problem?

What are the timer intervals for the clocks?
There is a lot of redundancy in your blocks...

Use only 1 clock to toggle on/off as @Juan_Antonio has shown here Extensiones App Inventor. Encender/apagar linterna. and refrain from switching on/off too fast...

Taifun

a second for 15 seconds, I will raise that period of time and try, but I do not think that is the problem, in fact the flashlight in some devices does not turn on. in the S '20 sometimes it stays on and sometimes not, sometimes it locks the phone causing it to crash

Post the aia (or a simple test aia).

It was my mistake the flash extension works perfectly.

Tested on Companion or APK?

Your aia does not work with Companion (WiFi), only with USB connection (checked on Android 9 and 11).

Try the example project on these devices from here

If that works, follow my previous suggestion and use only 1 clock

Taifun

1 Like

I'm not sure I understand what you mean.

If you are referring to the connection of the mobile phone via usb to try the apk, I always use the usb, because it is much faster than the emulator.
Perhaps the only way to test on how many and which systems it works I think is to publish it and distribute it for a test phase on the Google Play console.
Thanks to both of you for your time.

Thanks AnKe I'm happy that on the two systems you listed it works, but in those of my list unfortunately there are problems and I hope they are the only ones.

Thanks also to you Taifun, I hope you will soon be able to solve the problem for those phones too.

Thanks also to you Typhoon, I have already tried that system too, but it gave the same results.

The important thing is that my blocks work and that the problem is not their fault.

sure, just send me some test devices and I will check... (sarcasm)

and you also said

Galaxy s20 android 12 (some times it starts and sometimes the flashlight doesn't start)

did you try the example project on that device? I do not think so... The example app toggles the flashlight on button click... try the test project also on the other devices...

as already said earlier: There is a lot of redundancy in your blocks... Use only 1 clock to toggle on/off as @Juan_Antonio has shown here Extensiones App Inventor. Encender/apagar linterna.

Taifun

1 Like

Try this simple test aia:
Flashlight_test.aia (14.8 KB)

Blocks

Build the APK and try on your test devices.

(Tested on Android 9, 11, 12 without any issues.)

I have to apologize to everyone especially Taifun
Puravida Apps.
The code I posted in the .aia file is part of a more complex project.
Thanks to the fact that I extrapolated the Flash code and trying it on all the devices I mentioned as not working it worked.

So I inserted the blocks back into the project and I realized that there were some errors that I didn't see before such as, for example, I started the flashlight ignition first, thinking it was normal for an on off and therefore the flashlight remained in the on state when the alternation stopped.
Then I eliminated every command within the flashlight blocks, separating the flash blocks from other triggers.
Evidently it was these that caused the problem on some devices. (however it seems strange that in others this problem did not arise)
Now everything works. Thanks Taifun and once again sorry.
Naturally, thanks also to all the others who tried to help me.
Poorò also your Anke thanks.

I clarify all my problems in both Taifun and Anke.

  1. if I tried the flashlight locks with an on and off button everything worked in every mobile phone.

But they didn't work when I plugged in the timer, but not because the timer didn't work, but as I wrote earlier, in the block (FIle.Aia) I posted it worked perfectly.
In fact, the errors (because there were more than one) were in the rest of the blocks and the commands that simultaneously activated both the flash and other. Separating the flash from the others everything worked perfectly.

By the way, I've never had any problems with it.

So what do we learn from this?
Always also create a simple test aia (as I did), only with the basic functions of the extension and / or test the test aia provided by the extension developer (if available, and it is in this case).

You would have saved us and yourself a lot of time!

3 Likes

You are absolutely right, but sometimes when you are under pressure for something you need to present to a third party, these basic behaviors escape you and when you do not respect them through distraction or otherwise, what you described perfectly happens.
I just have to renew my apologies to everyone, I hope not to make the same mistake later.

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