Nice extension @Taifun
Tested it on my Pixel 4a with Android 11. It is working as it should. Didn't get an email after location change. Installed IFTTT but that didn't make a difference.
Great extension
AppInventor is slowly getting into building background apps
(added to new FAQ section)
Thank you everyone and thank you @Peter for your tests...
to get an email you only have to check the Email checkbox and enter a correct email address...
however you created a lot of location changed events in that 11 km run... depending on the time interval and distance interval you have chosen this probably could have been around 500-1000 location changed events? My guess therefore is, your email provider has identified that great amount of emails as spam and has blocked them therefore...
trying my best to push the limits into that direction...
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
I did enter a valid email and checked the checkbox. Just tested it again like this morning with a very short trip and now it works. Good job @Taifun. I must have done something wrong i guess.
Hi, I am interested in buying your "locationservice" extension, but I would like to be sure that is something that suits my needs. Let me describe you what I need:
My app has a timer - when the timer starts, the location sensor stores its coordinates in tinyDB, every 30 seconds.
I used a timer and a location sensor and work fine, as long as the screen remains on. Every 30 seconds a new record is added into tinyDB.
If I turn off (or lock) the screen, the timer still works fine, but location sensor stops sending anything. I guess it is related on appinventor's lack of running on background.
I tried your extension (keepScreenOn), but with no results - the screen remains on, but still the location sensor refuses to send its coordinates every 30 seconds (bear in mind that if I keep screen on manually - without your extension - everything works fine).
What if I buy your locationservice extension? Do you think it will work according to my needs?
Another question - does it offer integration with appInventor build-in maps?
Thank you,
Konstantinos
you should be able to use the extension for this... just grant the permissions after starting the app and start the service as soon as you like...
and you also should be able to do what you want just by using the KeepScreenOn method from the tools extension... however this will drain your battery faster...
you can easily use the stored coordinates and display them on the map... see the example app...
also while you app is up and running you can use the LocationChanged event of the extension to update your map
Taifun
Can you please explain me why this doesn't work?
When I press stop button the only thing you can see in the screen is an empty list [].
you are tring to request location permission and at the same time start the service, this will not work
Are you planning to publish your app in Google Play? In this case you have to get your app approved for background location access, see also Q1 here https://puravidaapps.com/locationservice.php#q
Let me suggest you to request location permission in the Screen.Initialize event
also make sure to have GPS enabled before starting the service... the example project actually shows you how to do it...
The location service is running, if you get the notification
Also make sure to go outside to get a good GPS signal...
also remember... valueIfTagNotThere should be in your case a create empty list block...
because if there is no data, the list from csv table block tries to convert the value from valueIfTagIsNotThere into a list... and this will fail for an empty text block ...
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
another error is, you forgot to assign the correct namespace for TinyDB...
the example project actually shows you how to do it...
Taifun
Thank you so much!
five stars for the extension, five stars for after-sale service!
Hi again!
I have a strange problem! LocationService works fine in a testing app, which has only one screen (Screen1) - the one with the LocationService blocks.
I re-create the entire screen (blocks and components - all are exactly the same) in an app with many different screens - bear in mind that now the LocationService screen IS NOT the Screen1.
Now LocationService refuses to start - I press the button and nothing works..
I tried to call RequestLocationPermission in the first screen (Screen1), still the same
None of the other screens has nothing to do with location sensors, gps etc...
What happens?
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 Taifun.
So, the name of the screen is "te".
When the StartButton is pressed, "started" appears in the textBox, but not any notification in the notification area - also not any record of coordinates in db (you can not see that function here, but it is in my real app and it does not work!)
BUT, if I create a testing app with only Screen1 (and the code you see in the image) everything works fine.. "started" appears in the textBox and also you can see the notification
I removed some of my app"s screens and it worked! What is left now is to define exactly which screen is blocking the locationService and why!!
are you using any other extensions?
you can use logcat and try to find out what happens
Taifun
It turned out that an extension I used for producing some sounds was blocking your service - I don't know why. I removed it and now works like a charm!!