Ideas on iOS GPS tracking needed

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Ideas on iOS GPS tracking needed

ELS Prothero via use-livecode
Sorry this is a bit long.

For a long time I’ve been tinkering with an app that uses the GPS on iPhones to show how far ‘as the crow flies’ the user is from some base point, which is set before the journey starts. It’s intended for walkers and cyclists, and I was using a beta version in the first French lockdown, which forbade one walking more than 1km from one’s house. I put the completion of this aside, but now we’re in the second French lockdown and it looks worth finishing - but I have some issues which I believe are not just down to my bad coding (though of course that’s more than possible), and I wonder if anyone else has thought about this stuff.

The basic idea is extremely simple, as you can imagine, and it wasn’t hard to code. The app keeps working out the point-to-point distance from the base and tests it against the permitted limit. If the limit is exceeded, it sounds an alarm. If the user goes back within the limit, the alarm stops. Everything else is just cosmetic, really.

The issue I have is that in every journey of say 40 minutes to an hour, the iPhone appears to generate a few ‘bad’ GPS readings. When I say bad, I mean way beyond the published accuracy of the GPS (which varies up to about 70m). Sometimes the GPS wants to tell me that I’ve walked half a kilometer in three seconds!

I have analysed a lot of data (.gpx files) from other apps for walkers, drivers and cyclists and I don’t see such glaring anomalies; and using such apps on my main test phone (an iPhone X), I don’t see these strange readings affecting the data.

Assuming this isn’t just a stupid coding error on my part (OK, a risky assumption), I need to find a solution, either by increasing the accuracy of the readings, or by finding the anomalies as they occur and eliminating them. I know no way of doing the first, and although I have ideas for the second (check apparent speed, for example), none seems foolproof. As the app works in real time, a retroactive curve-fitting solution is no good for me, even if my maths was up to coding it (Kalman filter, anyone?).

Has anyone tried anything like this, and if so, did you find any anomalies in the data, and how did you cope with them?

I’d be grateful for any ideas.

Graham
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Ideas on iOS GPS tracking needed

ELS Prothero via use-livecode
Hi Graham

Are you checking the horizontal accuracy of each reading? (It's part of the array of data with your lat-longs, as well as speed, etc - though not on every phone).

If not, try that and see if the anomalous readings are hugely out. From my experience, that's normally the case. If so, the easiest thing is to drop them in the short term, unless you get too many and then you may need to be a bit fancier. If you do, would love to hear the solution that you come up with.

HTH, cheers

Alan

> On 4 Nov 2020, at 3:30 am, Graham Samuel <[hidden email]> wrote:
>
> From: Graham Samuel <[hidden email]>
> To: How to use LiveCode <[hidden email]>
> Subject: Ideas on iOS GPS tracking needed
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=utf-8
>
> Sorry this is a bit long.
>
> For a long time I?ve been tinkering with an app that uses the GPS on iPhones to show how far ?as the crow flies? the user is from some base point, which is set before the journey starts. It?s intended for walkers and cyclists, and I was using a beta version in the first French lockdown, which forbade one walking more than 1km from one?s house. I put the completion of this aside, but now we?re in the second French lockdown and it looks worth finishing - but I have some issues which I believe are not just down to my bad coding (though of course that?s more than possible), and I wonder if anyone else has thought about this stuff.
>
> The basic idea is extremely simple, as you can imagine, and it wasn?t hard to code. The app keeps working out the point-to-point distance from the base and tests it against the permitted limit. If the limit is exceeded, it sounds an alarm. If the user goes back within the limit, the alarm stops. Everything else is just cosmetic, really.
>
> The issue I have is that in every journey of say 40 minutes to an hour, the iPhone appears to generate a few ?bad? GPS readings. When I say bad, I mean way beyond the published accuracy of the GPS (which varies up to about 70m). Sometimes the GPS wants to tell me that I?ve walked half a kilometer in three seconds!
>
> I have analysed a lot of data (.gpx files) from other apps for walkers, drivers and cyclists and I don?t see such glaring anomalies; and using such apps on my main test phone (an iPhone X), I don?t see these strange readings affecting the data.
>
> Assuming this isn?t just a stupid coding error on my part (OK, a risky assumption), I need to find a solution, either by increasing the accuracy of the readings, or by finding the anomalies as they occur and eliminating them. I know no way of doing the first, and although I have ideas for the second (check apparent speed, for example), none seems foolproof. As the app works in real time, a retroactive curve-fitting solution is no good for me, even if my maths was up to coding it (Kalman filter, anyone?).
>
> Has anyone tried anything like this, and if so, did you find any anomalies in the data, and how did you cope with them?
>
> I?d be grateful for any ideas.
>
> Graham


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Ideas on iOS GPS tracking needed

ELS Prothero via use-livecode
Seems to me if you are tracking linear movement, you need to average the trending values, say the last 5 or 10 reads, against a time base, and reject the ones outside an acceptable tolerance. You may reject some good data here and there, but something grossly outside tolerance should be pretty easy to grok.

Sounds easy, huh? :-) But it really is. For a car moving at 60mph, obviously the trend is going to be greater than a person walking, and slower than a small airplane. For an alien spacecraft traveling at insane speeds and making wild maneuvers, I’m afraid you are on your own. The tolerance can be a percentage of the average of the last x reads or the last x seconds. Seconds makes more sense to me since if you drop 2 or 3 reads it will skew the averages significantly. That is likely how Google Maps does it.

Bob S


On Nov 3, 2020, at 2:39 PM, Alan Stenhouse via use-livecode <[hidden email]<mailto:[hidden email]>> wrote:

Hi Graham

Are you checking the horizontal accuracy of each reading? (It's part of the array of data with your lat-longs, as well as speed, etc - though not on every phone).

If not, try that and see if the anomalous readings are hugely out. From my experience, that's normally the case. If so, the easiest thing is to drop them in the short term, unless you get too many and then you may need to be a bit fancier. If you do, would love to hear the solution that you come up with.

HTH, cheers

Alan

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Pass Javascript Session Cookie to LiveCode Variable?

ELS Prothero via use-livecode
Greetings LiveCoders,

I have an LC server format file that uses a Javascript video player.
The video player has a nice time progress bar that shows how far
the user has played the video. All of that works just fine.

What I would like to do is check what that time completion variable
is when the user clicks on a button to leave the video so I will know
if they finished watching it all the way to the end of the video or not.
I then want to make a note of it in my database which requires that
I am able to send that javascript variable value over to a LiveCode
variable.

I’ve been looking at Session Cookies to see if LiveCode can read
a Javascript Session Cookie, but so far have been unsuccessful.

Ideas, code or suggestions anyone?

Thanks!

Rick
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Pass Javascript Session Cookie to LiveCode Variable?

ELS Prothero via use-livecode
Hi Rick,

i just did a quick test and created an html file which wrote a cookie with javascript

<script type="text/javascript">
 document.cookie = "username=Rick";
</script>

Then in LC Server i used the array $_cookie to read the content of the cookie

Doing a
put $_Cookie["username"]

returned  Rick


Regards
Matthias


-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 04.11.2020 um 18:16 schrieb Rick Harrison via use-livecode <[hidden email]>:
>
> Greetings LiveCoders,
>
> I have an LC server format file that uses a Javascript video player.
> The video player has a nice time progress bar that shows how far
> the user has played the video. All of that works just fine.
>
> What I would like to do is check what that time completion variable
> is when the user clicks on a button to leave the video so I will know
> if they finished watching it all the way to the end of the video or not.
> I then want to make a note of it in my database which requires that
> I am able to send that javascript variable value over to a LiveCode
> variable.
>
> I’ve been looking at Session Cookies to see if LiveCode can read
> a Javascript Session Cookie, but so far have been unsuccessful.
>
> Ideas, code or suggestions anyone?
>
> Thanks!
>
> Rick
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Pass Javascript Session Cookie to LiveCode Variable?

ELS Prothero via use-livecode
Hi Matthias,

I just tried your code and it didn’t go across from one format file to the next.

I got:   username = “username”

What’s wrong?

If you can give me your full code for both mini format files I will try it
and we can see the results exactly.

Thanks for helping!

Rick

> On Nov 4, 2020, at 2:04 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> <script type="text/javascript">
> document.cookie = "username=Rick";
> </script>
>
> Then in LC Server i used the array $_cookie to read the content of the cookie
>
> Doing a
> put $_Cookie["username"]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Pass Javascript Session Cookie to LiveCode Variable?

ELS Prothero via use-livecode
Hi Rick,

there are two files:

writecookies.html
readcookies.lc

See the code of each here
https://livecode.dermattes.de/javascript/showcode.lc

-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 04.11.2020 um 22:10 schrieb Rick Harrison via use-livecode <[hidden email]>:
>
> Hi Matthias,
>
> I just tried your code and it didn’t go across from one format file to the next.
>
> I got:   username = “username”
>
> What’s wrong?
>
> If you can give me your full code for both mini format files I will try it
> and we can see the results exactly.
>
> Thanks for helping!
>
> Rick
>
>> On Nov 4, 2020, at 2:04 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>
>> <script type="text/javascript">
>> document.cookie = "username=Rick";
>> </script>
>>
>> Then in LC Server i used the array $_cookie to read the content of the cookie
>>
>> Doing a
>> put $_Cookie["username"]
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Ideas on iOS GPS tracking needed

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode
Thanks Alan and Bob - I was beginning to think I was alone on this one…

Yes, I do look at horizontal accuracy. I found out the following using my iPhone XS.

1. Horizontal accuracy tends to be rather poor for the first 10 to 20 readings after activation, typically 65 metres. In context, a test walking round my garden, which is about 110 x 60 meters, can quite often be woefully inaccurate at the beginning.

2. Even when has settled down it is still  quite variable, but tends to settle to an average less than 10 metres after a time.

3. Occasionally it throws colossal anomalies, like 5000 metres, with a corresponding crazy waypoint taking someone on foot right out of the park.

Of course I can catch the really big ones and ignore them, especially as they are infrequent (maybe two or three in an hour’s walk); but on my tests, the issue is the points that are a bit out, which can be fairly subtle - I mean if you draw them on a map, they are obvious to the human eye, but detecting them is quite difficult. For those, Bob’s idea is a good one, though of course it works best after the trip has been going for while. Anyway, thanks, I'm planning to use it. I agree seconds is the way to go - especially if the app doesn’t know the intended speed (it might be walking, cycling or driving for example). You can tell the user what you’re doing (some apps do this) but I prefer not to ask the user to make that choice.

I just bought a little app from the App Store, GPSOdometer by Kevin Willett. This does more or less what I want my app to do (it’s cosmetically quite different), and it offers a “Filter Level” setting, which effectively allows the user to decide how much horizontal (in)accuracy to accept. The level varies between 0.05 and 2.00, where a higher number means a larger tolerance of inaccuracies. I’ve written to Kevin to ask for a little more detail - of course he doesn’t have to reply, but I hope he does.

I will come back to the list to say how I got on. You never know, this may help others eventually.

Graham

PS The only test data I have been able to find for the XCode Simulator is a bike ride in California which runs along giving a succession of GPS . It is quite useful, but naturally it doesn’t involve anomalies.


> On 3 Nov 2020, at 23:55, Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> Seems to me if you are tracking linear movement, you need to average the trending values, say the last 5 or 10 reads, against a time base, and reject the ones outside an acceptable tolerance. You may reject some good data here and there, but something grossly outside tolerance should be pretty easy to grok.
>
> Sounds easy, huh? :-) But it really is. For a car moving at 60mph, obviously the trend is going to be greater than a person walking, and slower than a small airplane. For an alien spacecraft traveling at insane speeds and making wild maneuvers, I’m afraid you are on your own. The tolerance can be a percentage of the average of the last x reads or the last x seconds. Seconds makes more sense to me since if you drop 2 or 3 reads it will skew the averages significantly. That is likely how Google Maps does it.
>
> Bob S
>
>
> On Nov 3, 2020, at 2:39 PM, Alan Stenhouse via use-livecode <[hidden email]<mailto:[hidden email]>> wrote:
>
> Hi Graham
>
> Are you checking the horizontal accuracy of each reading? (It's part of the array of data with your lat-longs, as well as speed, etc - though not on every phone).
>
> If not, try that and see if the anomalous readings are hugely out. From my experience, that's normally the case. If so, the easiest thing is to drop them in the short term, unless you get too many and then you may need to be a bit fancier. If you do, would love to hear the solution that you come up with.
>
> HTH, cheers
>
> Alan
>
> On 4 Nov 2020, at 3:30 am, Graham Samuel <[hidden email] <mailto:[hidden email]>> wrote:
>
> From: Graham Samuel <[hidden email] <mailto:[hidden email]>>
> To: How to use LiveCode <[hidden email] <mailto:[hidden email]>>
> Subject: Ideas on iOS GPS tracking needed
> Message-ID: <[hidden email] <mailto:[hidden email]>>
> Content-Type: text/plain; charset=utf-8
>
> Sorry this is a bit long.
>
> For a long time I?ve been tinkering with an app that uses the GPS on iPhones to show how far ?as the crow flies? the user is from some base point, which is set before the journey starts. It?s intended for walkers and cyclists, and I was using a beta version in the first French lockdown, which forbade one walking more than 1km from one?s house. I put the completion of this aside, but now we?re in the second French lockdown and it looks worth finishing - but I have some issues which I believe are not just down to my bad coding (though of course that?s more than possible), and I wonder if anyone else has thought about this stuff.
>
> The basic idea is extremely simple, as you can imagine, and it wasn?t hard to code. The app keeps working out the point-to-point distance from the base and tests it against the permitted limit. If the limit is exceeded, it sounds an alarm. If the user goes back within the limit, the alarm stops. Everything else is just cosmetic, really.
>
> The issue I have is that in every journey of say 40 minutes to an hour, the iPhone appears to generate a few ?bad? GPS readings. When I say bad, I mean way beyond the published accuracy of the GPS (which varies up to about 70m). Sometimes the GPS wants to tell me that I?ve walked half a kilometer in three seconds!
>
> I have analysed a lot of data (.gpx files) from other apps for walkers, drivers and cyclists and I don?t see such glaring anomalies; and using such apps on my main test phone (an iPhone X), I don?t see these strange readings affecting the data.
>
> Assuming this isn?t just a stupid coding error on my part (OK, a risky assumption), I need to find a solution, either by increasing the accuracy of the readings, or by finding the anomalies as they occur and eliminating them. I know no way of doing the first, and although I have ideas for the second (check apparent speed, for example), none seems foolproof. As the app works in real time, a retroactive curve-fitting solution is no good for me, even if my maths was up to coding it (Kalman filter, anyone?).
>
> Has anyone tried anything like this, and if so, did you find any anomalies in the data, and how did you cope with them?
>
> I?d be grateful for any ideas.
>
> Graham

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Pass Javascript Session Cookie to LiveCode Variable?

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode
Hi Matthias,

Well, that works fine!

I’ll have to study what I did differently to figure why my method didn’t work.

Will this work with Session variables too?

Thanks,

Rick

> On Nov 4, 2020, at 4:35 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> Hi Rick,
>
> there are two files:
>
> writecookies.html
> readcookies.lc <http://readcookies.lc/>
>
> See the code of each here
> https://livecode.dermattes.de/javascript/showcode.lc <https://livecode.dermattes.de/javascript/showcode.lc>
>
> -
> Matthias Rebbe

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Pass Javascript Session Cookie to LiveCode Variable?

ELS Prothero via use-livecode
What do you mean with session variables?

To be honest i am not very used with Javascript.
I just did a quick test to write a cookie with JS and read it with LC server. ;)

Regards,
Matthias
-
Matthias Rebbe
Life Is Too Short For Boring Code



> Am 05.11.2020 um 00:31 schrieb Rick Harrison via use-livecode <[hidden email]>:
>
> Hi Matthias,
>
> Well, that works fine!
>
> I’ll have to study what I did differently to figure why my method didn’t work.
>
> Will this work with Session variables too?
>
> Thanks,
>
> Rick
>
>> On Nov 4, 2020, at 4:35 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>
>> Hi Rick,
>>
>> there are two files:
>>
>> writecookies.html
>> readcookies.lc <http://readcookies.lc/>
>>
>> See the code of each here
>> https://livecode.dermattes.de/javascript/showcode.lc <https://livecode.dermattes.de/javascript/showcode.lc>
>>
>> -
>> Matthias Rebbe
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Pass Javascript Session Cookie to LiveCode Variable?

ELS Prothero via use-livecode
Hi Matthias,

Session Variables are like cookies except they auto-expire at the end of a browser session
like when you close a tab or window.

In Javascript one would set a session variable this way:

<script language="JavaScript">
<!--
// Set the Value of the Session Variable
  sessionStorage.setItem("firstname", "John");
  sessionStorage.setItem("lastname", "Smith");
  //-->
</script>


One would retrieve the session variable in Javascript this way:


<script language="JavaScript">
<!--
  // Retrieve
  document.getElementById("JSNewFirstName").innerHTML = sessionStorage.getItem("firstname");  
  document.getElementById("JSNewLastName").innerHTML = sessionStorage.getItem("lastname");
//-->
</script>


In LiveCode one would set a session variable like this:

<?lc

start session

put “Matthias” into VarFirstName

put VarFirstName into $_SESSION["NewFirstName”]

stop session

?>

To retrieve the session variable in LiveCode:

<?lc

start session

put  $_SESSION["NewFirstName”] into VarFirstName

stop session

?>

So, I’m wondering that since we are able to have LiveCode retrieve Javascript cookies,
then perhaps it can retrieve Javascript session variables too.

I just haven’t quite made the connection yet.

Your thoughts?

Rick

> On Nov 4, 2020, at 7:00 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> What do you mean with session variables?
>
> To be honest i am not very used with Javascript.
> I just did a quick test to write a cookie with JS and read it with LC server. ;)
>
> Regards,
> Matthias

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Pass Javascript Session Cookie to LiveCode Variable?

ELS Prothero via use-livecode
Rick,

you are mixing something.

$_session array is stored on the server while sessionstorage is stored on the clients computer.

I am not sure that there is a direct way to let Livecode Server read sessionstorage directly from the clients computer, but i might be wrong.
At least PHP is not able.

One way would be to use Javascript to read the storagesession and post it to a LC Server script using Ajax.
You could even do this from one single LC server script.
In the script you would check if the $_POST array contains any data.
If the $_POST array is empty, then you have to execute  the javascript that fetches the sessionstorage data and if there is sessionstorage  then it posts that data to the script again.
If the $_POST array is not empty, then you can continue the script using the sessionstorage data.

At least this is the way how it is done in .php

I've used this method a lot for processing form data.

HTH

Matthias




> Am 05.11.2020 um 02:12 schrieb Rick Harrison via use-livecode <[hidden email]>:
>
> Hi Matthias,
>
> Session Variables are like cookies except they auto-expire at the end of a browser session
> like when you close a tab or window.
>
> In Javascript one would set a session variable this way:
>
> <script language="JavaScript">
> <!--
> // Set the Value of the Session Variable
> sessionStorage.setItem("firstname", "John");
> sessionStorage.setItem("lastname", "Smith");
> //-->
> </script>
>
>
> One would retrieve the session variable in Javascript this way:
>
>
> <script language="JavaScript">
> <!--
> // Retrieve
> document.getElementById("JSNewFirstName").innerHTML = sessionStorage.getItem("firstname");  
> document.getElementById("JSNewLastName").innerHTML = sessionStorage.getItem("lastname");
> //-->
> </script>
>
>
> In LiveCode one would set a session variable like this:
>
> <?lc
>
> start session
>
> put “Matthias” into VarFirstName
>
> put VarFirstName into $_SESSION["NewFirstName”]
>
> stop session
>
> ?>
>
> To retrieve the session variable in LiveCode:
>
> <?lc
>
> start session
>
> put  $_SESSION["NewFirstName”] into VarFirstName
>
> stop session
>
> ?>
>
> So, I’m wondering that since we are able to have LiveCode retrieve Javascript cookies,
> then perhaps it can retrieve Javascript session variables too.
>
> I just haven’t quite made the connection yet.
>
> Your thoughts?
>
> Rick
>
>> On Nov 4, 2020, at 7:00 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>
>> What do you mean with session variables?
>>
>> To be honest i am not very used with Javascript.
>> I just did a quick test to write a cookie with JS and read it with LC server. ;)
>>
>> Regards,
>> Matthias
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



-
Matthias Rebbe
Life Is Too Short For Boring Code


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Ideas on iOS GPS tracking needed

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode
Hi Graham,


PS The only test data I have been able to find for the XCode Simulator is a bike ride in California which runs along giving a succession of GPS . It is quite useful, but naturally it doesn’t involve anomalies.


You can make your own location simulations to run in the iOS simulator. They are .gpx files containing coordinate information in XML format.

I created one for my students to use on my App Development (in Swift) module. I managed to hack it together and made a simulated walk/run around part of the Liverpool University Campus. To make one these you need GPS coordinates (I got them from Google Maps) and times - the difference in time from the last step determines the speed that the marker travels from the previous step. Since it was done by hand, the times between steps don’t match well with the distances and so the walk turns into a very fast run once or twice, but it works as an example.

Copy and paste the text below into a text file and save it with a “.gpx” extension.





<?xml version="1.0"
      encoding="UTF-8"
      standalone="no"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
     version="1.1"
     creator="Phil Jimmieson and Jodie Zhou">
     <wpt lat="53.406566" lon="-2.966531">
<name>Ashton Building</name>
          <time>2019-11-22T08:59:46Z</time>
     </wpt>

     <wpt lat="53.406721" lon=" -2.966007">
<name>step 1</name>
          <time>2019-11-22T09:01:00Z</time>
     </wpt>

     <wpt lat="53.406120" lon="-2.965911">
<name>step 2</name>
          <time>2019-11-22T09:01:20Z</time>
     </wpt>

     <wpt lat="53.406068" lon="-2.965063">
<name>step 3</name>
          <time>2019-11-22T09:01:40Z</time>
     </wpt>

     <wpt lat="53.406081" lon="-2.964527">
<name>step 4</name>
          <time>2019-11-22T09:02:00Z</time>
     </wpt>

     <wpt lat="53.405493" lon="-2.964645">
<name>step 5</name>
          <time>2019-11-22T09:02:20Z</time>
     </wpt>

     <wpt lat="53.404834" lon="-2.964730">
<name>step 6</name>
          <time>2019-11-22T09:02:40Z</time>
     </wpt>

     <wpt lat="53.404553" lon="-2.965803">
<name>step 7</name>
          <time>2019-11-22T09:03:00Z</time>
     </wpt>

     <wpt lat="53.404610" lon="-2.966672">
<name>step 8</name>
          <time>2019-11-22T09:03:20Z</time>
     </wpt>

     <wpt lat="53.405390" lon="-2.966533">
<name>step 9</name>
          <time>2019-11-22T09:03:40Z</time>
     </wpt>

     <wpt lat="53.405966" lon="-2.966297">
<name>step 10</name>
          <time>2019-11-22T09:04:00Z</time>
     </wpt>

     <wpt lat="53.406049" lon="-2.967198">
<name>step 11</name>
          <time>2019-11-22T09:04:20Z</time>
     </wpt>
     <wpt lat="53.406350" lon="-2.967220">
<name>step 12</name>
          <time>2019-11-22T09:04:40Z</time>
     </wpt>
</gpx>

--
Phil Jimmieson
University of Liverpool, Computer Science Department
Ashton Bldg, Ashton Street, Liverpool. L69 3BX
0151 795 4236
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

New Google PlayStore Console

ELS Prothero via use-livecode
I received these 3 warnings when uploading APKs using the new Google Play Console. The first one I've been seeing for a while. Anyone know about the last 2? I assume the second one is LCs use of the JVM.

Warning
This APK results in unused code and resources being sent to users. Your app could be smaller if you used the Android App Bundle. By not optimizing your app for device configurations, your app is larger to download and install on users' devices than it needs to be. Larger apps see lower install success rates and take up storage on users' devices.

Warning
This APK contains Java/Kotlin code, which might be obfuscated. We recommend you upload a deobfuscation file to make your crashes and ANRs easier to analyze and debug. Learn More

Warning
This APK contains native code, and you've not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug. Learn More

Ralph DiMola
IT Director
Evergreen Information Services
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: New Google PlayStore Console

ELS Prothero via use-livecode
following,

On Thu, Nov 5, 2020 at 12:46 PM Ralph DiMola via use-livecode <
[hidden email]> wrote:

> I received these 3 warnings when uploading APKs using the new Google Play
> Console. The first one I've been seeing for a while. Anyone know about the
> last 2? I assume the second one is LCs use of the JVM.
>
> Warning
> This APK results in unused code and resources being sent to users. Your
> app could be smaller if you used the Android App Bundle. By not optimizing
> your app for device configurations, your app is larger to download and
> install on users' devices than it needs to be. Larger apps see lower
> install success rates and take up storage on users' devices.
>
> Warning
> This APK contains Java/Kotlin code, which might be obfuscated. We
> recommend you upload a deobfuscation file to make your crashes and ANRs
> easier to analyze and debug. Learn More
>
> Warning
> This APK contains native code, and you've not uploaded debug symbols. We
> recommend you upload a symbol file to make your crashes and ANRs easier to
> analyze and debug. Learn More
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> [hidden email]
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
Tom Glod
Founder & Developer
MakeShyft R.D.A (www.makeshyft.com)
Mobile:647.562.9411
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Pass Javascript Session Cookie to LiveCode Variable?

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode
Hi Matthias,

I found the problem.

You had:  put $_Cookie["username”]

It shouldn’t have the quotes.

put  $_Cookie[username]

works fine.

I think I made the same mistake sometime!  LOL

Cookies reside in the client’s web-browser which is why
as users were are always clearing them out.

So, LiveCode can read Javascript cookies!  Yay!

It’s good enough for now.  I’ll revisit Javascript session variables later.

Thanks for your help!

Rick

> On Nov 4, 2020, at 2:04 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> Hi Rick,
>
> i just did a quick test and created an html file which wrote a cookie with javascript
>
> <script type="text/javascript">
> document.cookie = "username=Rick";
> </script>
>
> Then in LC Server i used the array $_cookie to read the content of the cookie
>
> Doing a
> put $_Cookie["username"]
>
> returned  Rick
>
>
> Regards
> Matthias

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Pass Javascript Session Cookie to LiveCode Variable?

ELS Prothero via use-livecode
I doubt that the qoutes were the problem. ;)

Your
put $_cookie[username]  
will replace the content of the var username.
In your case, if the value of variable username for example is Peter then
LC would replace $_cookie[username]   with $_cookie["Peter"]

If username wasn't used before then LC uses username as the value of username

In this case LC would replace $_cookie[username] with $_cookie["username"].

So for example
put "hallo" into tArray["mytext"]
put tArray["mytext"]    --returns hallo
put tArray[mytext] -- returns hallo
put "test" into mytext
put tArray[mytext] -- returns nothing

So i am not sure, what the problem was, but definitely not the quotes. ;)

Regards,
Matthias


-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 06.11.2020 um 03:54 schrieb Rick Harrison via use-livecode <[hidden email]>:
>
> Hi Matthias,
>
> I found the problem.
>
> You had:  put $_Cookie["username”]
>
> It shouldn’t have the quotes.
>
> put  $_Cookie[username]
>
> works fine.
>
> I think I made the same mistake sometime!  LOL
>
> Cookies reside in the client’s web-browser which is why
> as users were are always clearing them out.
>
> So, LiveCode can read Javascript cookies!  Yay!
>
> It’s good enough for now.  I’ll revisit Javascript session variables later.
>
> Thanks for your help!
>
> Rick
>
>> On Nov 4, 2020, at 2:04 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>
>> Hi Rick,
>>
>> i just did a quick test and created an html file which wrote a cookie with javascript
>>
>> <script type="text/javascript">
>> document.cookie = "username=Rick";
>> </script>
>>
>> Then in LC Server i used the array $_cookie to read the content of the cookie
>>
>> Doing a
>> put $_Cookie["username"]
>>
>> returned  Rick
>>
>>
>> Regards
>> Matthias
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Pass Javascript Session Cookie to LiveCode Variable?

ELS Prothero via use-livecode
Hi Matthias,

Hmm, I should never do things when I’m tired.

I do the following all the time with LC session variables
and they do use the quotes.

put $_SESSION["userid"] into Varuserid

Yet the following works nicely and no array is needed:

<script type="text/javascript">

var amount1 = 23;
var amount2  = 56;
var total = amount1 + amount2;

document.cookie = "AdditionResult=" + total + ";"

</script>


<?lc

put $_cookie[AdditionResult] into VarAdditionResult

put "<br><br>"
put "VarAdditionResult = " & VarAdditionResult
put "<br><br>"

?>

So $_cookie[AdditionResult] and $_cookie[“AdditionResult”]
are different variables?  

I will have to play around some more.  I’m happy that at least
something is working now.  I just need to know why.

Cheers,

Rick




> On Nov 6, 2020, at 6:04 AM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> I doubt that the qoutes were the problem. ;)
>
> Your
> put $_cookie[username]  
> will replace the content of the var username.
> In your case, if the value of variable username for example is Peter then
> LC would replace $_cookie[username]   with $_cookie["Peter"]
>
> If username wasn't used before then LC uses username as the value of username
>
> In this case LC would replace $_cookie[username] with $_cookie["username"].
>
> So for example
> put "hallo" into tArray["mytext"]
> put tArray["mytext"]    --returns hallo
> put tArray[mytext] -- returns hallo
> put "test" into mytext
> put tArray[mytext] -- returns nothing
>
> So i am not sure, what the problem was, but definitely not the quotes. ;)
>
> Regards,
> Matthias
>
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: New Google PlayStore Console

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode
Hai Ralph,

whether this problem has been resolved?

.

Pada tanggal Jum, 6 Nov 2020 00.46, Ralph DiMola via use-livecode <
[hidden email]> menulis:

> I received these 3 warnings when uploading APKs using the new Google Play
> Console. The first one I've been seeing for a while. Anyone know about the
> last 2? I assume the second one is LCs use of the JVM.
>
> Warning
> This APK results in unused code and resources being sent to users. Your
> app could be smaller if you used the Android App Bundle. By not optimizing
> your app for device configurations, your app is larger to download and
> install on users' devices than it needs to be. Larger apps see lower
> install success rates and take up storage on users' devices.
>
> Warning
> This APK contains Java/Kotlin code, which might be obfuscated. We
> recommend you upload a deobfuscation file to make your crashes and ANRs
> easier to analyze and debug. Learn More
>
> Warning
> This APK contains native code, and you've not uploaded debug symbols. We
> recommend you upload a symbol file to make your crashes and ANRs easier to
> analyze and debug. Learn More
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> [hidden email]
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

RE: New Google PlayStore Console

ELS Prothero via use-livecode
No it isn't. Apparently no one on the list has any input on the implications
of this is. I will have to take this to the mother ship and file a QCC
report.

Ralph DiMola
IT Director
Evergreen Information Services
[hidden email]

-----Original Message-----
From: use-livecode [mailto:[hidden email]] On Behalf
Of Riko Abadi via use-livecode
Sent: Monday, November 09, 2020 7:17 AM
To: How to use LiveCode
Cc: Riko Abadi
Subject: Re: New Google PlayStore Console

Hai Ralph,

whether this problem has been resolved?

.

Pada tanggal Jum, 6 Nov 2020 00.46, Ralph DiMola via use-livecode <
[hidden email]> menulis:

> I received these 3 warnings when uploading APKs using the new Google
> Play Console. The first one I've been seeing for a while. Anyone know
> about the last 2? I assume the second one is LCs use of the JVM.
>
> Warning
> This APK results in unused code and resources being sent to users.
> Your app could be smaller if you used the Android App Bundle. By not
> optimizing your app for device configurations, your app is larger to
> download and install on users' devices than it needs to be. Larger
> apps see lower install success rates and take up storage on users'
devices.

>
> Warning
> This APK contains Java/Kotlin code, which might be obfuscated. We
> recommend you upload a deobfuscation file to make your crashes and
> ANRs easier to analyze and debug. Learn More
>
> Warning
> This APK contains native code, and you've not uploaded debug symbols.
> We recommend you upload a symbol file to make your crashes and ANRs
> easier to analyze and debug. Learn More
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> [hidden email]
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12