[PAID] 📍 Location Service Extension

Thank you so much!
five stars for the extension, five stars for after-sale service!

3 Likes

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?

1 Like

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.

1 Like

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

1 Like

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!!

1 Like

are you using any other extensions?
you can use logcat and try to find out what happens


Taifun

1 Like

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!!

1 Like

which extension exactly? can you please provide a link?
Taifun

1 Like
1 Like

I wonder if there is is a way for calulating the distance you walked. For now, I send the coordinates list in a server, a php script calculates the distance and send it back. It would be nice if there was a "build in" way to do that!

1 Like

Awesome work !! :+1:

1 Like

the following extensions are able to calculate it
Distance Tools Extension by Red Panda
DistanceCalc Extension: Calculate distance between two places using the Haversine formula by vknow360
taken from the extensions directory https://puravidaapps.com/extensions.php

Taifun


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

1 Like

Can anyone help me. how to not show message when app is running in background using this extension?

1 Like

I think this extension uses Foreground Service means it perform operations that are noticeable to the user so it must show a status bar notification, so that users are actively aware that your some service in your app is running.
Read More

2 Likes

thank you @oseamiya, this is correct...
according to the Google rules the user must be aware, that there is some service running and accessing the location data... it is not possible anymore to get that information without the user knowing it...

and the extension accesses the location in the background, which means (see also Q1 here https://puravidaapps.com/locationservice.php#q)

Tips for getting your app approved for background location access
A : See this Google Blog, see also the Google Policy chapter Location Permissions .

Taifun

3 Likes

Thank you @oseamiya

1 Like

Can I use this extension to measure distance from the moment I press a button to the moment I press another button?

no
the purpose of this extension is

This extension is able to run in the background while your app is closed and stores location data (latitude, longitude and optionally current datetime, altitude, accuracy, speed, current address and provider) in TinyDB .

Also a background web functionality is available which can be used to send the location data in the background to a web service of your choice using a POST request. This could be used for example to store the location data in a MySQL database or to send an email after a location change was detected while the app is not running.

to measure distance you have to do some calculation...
see also some threads about how to do this after doing a search in the community
https://community.appinventor.mit.edu/search?q=distance

Taifun

Hello community
I have an app that writes my location to an sql database, but only as long as the app is running in the foreground. I have now set up the local demo app with the working access data and no table is created. When is the table usually created.

greetings Stefan

Sorry Stefan but I don't understand what you are trying to do :upside_down_face: Do you mean a table in the database or a table in the App?

Could you draw a diagram that shows the intended process? Or list the intended actions?