OT (?): Bookmarking GPS coords

Alex Tweedly alex at tweedly.net
Fri Apr 21 20:23:45 EDT 2017


I was working on a Mobile app to allow a user to set the location of a 
named address within a UK Postcode. For various reasons, I'm not able to 
spend much time on it - and I discovered that although the process of 
starting to develop an Android app looks reasonable, there are many 
details you need to get right.

I'm kind of busy in other things right now, so although I do have some 
time to work on this, I can only manage very brief sessions on Livecode 
(10 minutes here, 20 minutes another time, ...) and it's just not 
working well for learning a new environment. That's my fault, not 
Livecode's Android/mobile process.

So I looked around for other easier ways to achieve a similar app - and 
stumbled into one.

I've been looking at Telegram for messaging - mainly because it runs on 
all major platforms, and syncs my actions between them - so I get to 
send my instant messages using my MacBook - i.e. typing on a real 
keyboard and looking at a decent size screen, etc. but can also use my 
iPhone etc. when I'm out and about.

Other features are :
  - Telegram has a good api and docs for creating Bots
  - these allow you to create a custom keyboard
  - and allow you to provide user's location (if known).

So I used this to implement a very basic ChatBot-based app.

1. you specify a postcode
2. you are presented with a set of buttons for the addresses within that 
postcode
3. click on any one, and you are then asked to click when in the right 
location - and the GPS location will be associated with the property 
address chosen.

I have posted this as a sample to "Sample Stacks" called "Telegram Chatbot"

Note some caveats !!
1. all developed on 9.0.0DP6
2. if you wish to run his stack, you need to become a Telegram user, 
then to register your own Bot
     (see https://core.telegram.org/bots) and replace the string "YOUR 
TOKEN HERE" with your actual token. (line 11 on card script).
3. I removed the 'save' function before I uploaded the stack - so no-one 
can accidentally over-write my own data.

To run it (once you have done the above),
1. click "start"
2. click "Main"
(it should run forever - if you want to pause it to examine code, etc. 
click on"STOP", and subsequently "Main" again.)

Then in your Telegram client,
1. open a chat to @PropertyLocatorBot
2. send command     /start
3. choose a postcode   e.g.  /location,PA34 4XD    (Note that comma !!)
4. then you will see the list of addresses within that post code (for 
which I do not yet have a precise location). You can set them - but not 
save that info - and you should see those whose location is set 
disappear from the list.
5a. click / touch an address
5. when prompted, click "Set location" (it will take your current location)
6. you will then see the reduced list without that address

It should be reasonably easy to understand, even if minimally 
documented. Any questions just ask me either here on the list, or 
directly.  (I should probably put this info / stack onto a forum, but I 
couldn't figure out which one was appropriate.

-- Alex.




More information about the use-livecode mailing list