[PAID] πŸ“ Location Service Extension

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 App Inventor Extensions: Location Service | Pura Vida Apps)

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.ezproxy.canberra.edu.au/search?q=distance

Taifun

1 Like

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?

it looks like you are taling about the locationservice extension App Inventor Extensions: Location Service | Pura Vida Apps

the extension does not create a table in your database, you have to create that before using the extension...
see also the documentation, especially chapter "Example blocks to send the location data to a MySQL database while the location service is running in the background"

Taifun


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

It works on Kodular?

Hi
I have a problem with the Extension Location service. I want to send an email when the coordinates change. the mail without attachment should be sent from my PHP server (php7), even if the app is running in the background or the cell phone is in stand-by mode.
the coordinates are currently stored in an sql database using the location extension.
I would be grateful for new starting points.

Greetings from Germany
Stefan

At the time of publishing the extension, Kodular did not offer some annotations in the manifest, but meanwhile it should work...
I will do some tests next week for you and let you know then...

Taifun

1 Like

From the documentation

Also a background web functionality is available which can be used to send the location data to a web service of your choice using a POST request.

There are also example blocks, see chapter ' Example blocks to send an Email
while the location service is running in the background'

Do you have a simple example project, which works to send an email together with your server? Then I can help you to configure the extension for you ...

Taifun

Hi there,
First of all, thanks for the reply, even though the post was closed immediately. which I don't understand by the way.
thanks to the extension location service, the transfer of coordinates to my sql database works perfectly. I can now monitor the location with a second cell phone.
That also works wonderfully. I would like to receive an email (from the 1st cell phone to the second cell phone) as soon as the location changes. So monitoring my camper in case it is stolen.
the mail doesn't need an attachment or pictures or anything else, just the transfer of the coordinates and that's it.
Actually, I imagine a php script that sends an email. location service doesn't actually do anything else. maybe you can extend the existing skipt and it won't
the database addressed special the mail command from php
what would be needed for the block to address the script and the extension of the script.
I've been experimenting for about 7 days and can't get any further at the moment. the solution with ifttt is not the best since we
want to do a europe and north africa tour with several vehicles and everyone wants to install the same system.

I hope you can think of something better or have a solution using your mail extension.

greetings from Stefan

Your post has been moved into the Locationservice thread

There are php servers solutions to send an email... see here App Inventor Tutorials and Examples: Send Mail | Pura Vida Apps

if you get one of them running together with your server then I can help you to configure the locationservice extension...

Taifun

If you want zo use the ifttt solution you have to set it up only once for your app and can use it with as much devices as you want

Taifun

yes the extension of SmtpCLient Extension by vknow360 to send emails using SMTP server
does exactly what I want, but only as long as the app is running in the foreground.

gruß

You have to look for a solution, which works with the web component together with the POST method...

A solution using a mail extension is not supported

Taifun

An alternative possibility to share the location data among the vehicles:

HOW TO: use LocationService extension with a GoogleSpreadsheet to record real time locations while the app is in the background , All the users post to the spreadsheet but can read the data too. The participants could also 'share' messages if you provide a message in addition to posting coordinates. You could even post everyone's coordinates on a Map.

2 Likes

I now tested the extension in Kodular and it also works there. However for some reason the RequestLocationPermission method does not work there, but you can use a workaround for this, for details see chapter "Kodular" here App Inventor Extensions: Location Service | Pura Vida Apps

Taifun
PS: for further questions about using the extension in Kodular, please start a new thread in the Kodular community and I will answer there. Thank you.

1 Like

I can start the extension with the receipt of an sms?

the StartService method starts the service
start

to call the StartService method from the Texting.MessageReceived event is also possible while your app is up and running
http://ai2.appinventor.mit.edu.ezproxy.canberra.edu.au/reference/components/social.html#Texting

in case your app is not running you probably will need additionally a background service

Taifun