Start google maps with sms

Post your questions and help other users.

Moderator: Martin

younesetre
Posts: 16
Joined: 29 Apr 2016 23:04

Re: Start google maps with sms

Post by younesetre » 26 Apr 2019 14:26

Thanks lot. Now it works :D

younesetre
Posts: 16
Joined: 29 Apr 2016 23:04

Re: Start google maps with sms

Post by younesetre » 26 Apr 2019 20:24

It works with maps but not with osmand. Is it possible to extract only the coordinates like this "12.121212, -1.121212"

User avatar
Desmanto
Posts: 1981
Joined: 21 Jul 2017 17:50

Re: Start google maps with sms

Post by Desmanto » 27 Apr 2019 04:23

Yes, but again, we need to change the regex

Code: Select all

find = findAll(sms_text, 'lat: (.*) lon: (.*)', true);
lat = find[0][1];
lon = find[0][2];
This will get the lat lon value. Then to use with other apps which doesn't support direct google map, you can use start activity.

Start Activity
Action : android.intent.action.View
Data URI : geo:{lat},{long}
Explicit componet, Package name : choose osmand
Class name leave blank (or pick one of the activity that works, need try and error)

It is easier to select from example, choose Google Maps: with Coordinates, then replace the Data URI and package name. You can include the ?z=11 as the zoom level
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), Resurrection Remix Official 7.0.2 20190829, Pie 9.0, Rooted.

younesetre
Posts: 16
Joined: 29 Apr 2016 23:04

Re: Start google maps with sms

Post by younesetre » 27 Apr 2019 07:54

Hi with this new script i have error "action not executed...index 0 size 0 find 0 line 1"

User avatar
Desmanto
Posts: 1981
Joined: 21 Jul 2017 17:50

Re: Start google maps with sms

Post by Desmanto » 27 Apr 2019 08:16

Do your sms start with this exactly ?
lat: 11.123456 lon: -1.123456

Try to copy your full sms text, go to Script action, tap the regular expression tester. Paste your sms text in the sample text. Then copy
lat: (.*) lon: (.*)
to the Regular expression. Do you see part of the result got green highlighted? If yes, then is there underlined on the lat and lon coordinate?
If not, maybe there is some space or extra symbol at your sms text. Try to delete/add the space/symbol in the regex to matched your sms text.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), Resurrection Remix Official 7.0.2 20190829, Pie 9.0, Rooted.

younesetre
Posts: 16
Joined: 29 Apr 2016 23:04

Re: Start google maps with sms

Post by younesetre » 27 Apr 2019 08:50

Here is the result but I do not know what to do
sms
"lat:12.722078 lon:-0.120596
speed:0.01
T:19/04/25 15:15
http://maps.google.com/maps?f=q&q=12.72 ... 20596&z=16
Pwr: ON Door: OFF ACC: OFF."


I did not find any underlined
Attachments
Screenshot_2019-04-27-09-36-34-977_ch.gridvision.ppam.androidautomagic[1].png
Screenshot_2019-04-27-09-36-34-977_ch.gridvision.ppam.androidautomagic[1].png (308.32 KiB) Viewed 851 times

User avatar
Desmanto
Posts: 1981
Joined: 21 Jul 2017 17:50

Re: Start google maps with sms

Post by Desmanto » 27 Apr 2019 09:17

You don't have space in the real sms, between the lat: and the value, so the regex also may not have space. Change the regex now to
lat:(.*) lon:(.*)
Try to remove the space and see if it is highlighted and underlined now.

To be exactly, the script now is

Code: Select all

find = findAll(sms_text, 'lat:(.*) lon:(.*)', true);
lat = find[0][1];
lon = find[0][2];
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), Resurrection Remix Official 7.0.2 20190829, Pie 9.0, Rooted.

younesetre
Posts: 16
Joined: 29 Apr 2016 23:04

Re: Start google maps with sms

Post by younesetre » 27 Apr 2019 12:25

yes now i have lat and lon hightlighted and underlined but i have always the same error "action not exec...."
Attachments
Screenshot_2019-04-27-13-22-40-270_ch.gridvision.ppam.androidautomagic[1].png
Screenshot_2019-04-27-13-22-40-270_ch.gridvision.ppam.androidautomagic[1].png (93.98 KiB) Viewed 835 times
Screenshot_2019-04-27-13-20-30-628_ch.gridvision.ppam.androidautomagic[1].png
Screenshot_2019-04-27-13-20-30-628_ch.gridvision.ppam.androidautomagic[1].png (265.01 KiB) Viewed 835 times

younesetre
Posts: 16
Joined: 29 Apr 2016 23:04

Re: Start google maps with sms

Post by younesetre » 28 Apr 2019 21:14

Hi Desmanto

I still have not found the solution to this error.
have you found where is the error of your side.
Even if you did not find it.Thanks a lot

anuraag
Posts: 270
Joined: 24 Jan 2015 02:06

Re: Start google maps with sms

Post by anuraag » 28 Apr 2019 23:35

You have executed action only where sms_text is empty.
Try sending a test sms to yourself.

Post Reply