Not sure if this is the right category to discuss issue i'm having with runtime Map markers and Google sheets. So here is the issue i have. I am currently using google sheets to store map data related to an app that allows a user to capture lat/long along with details about a fish they have caught(i.e., fish weight, length, species, user name, time and date fish was caught. as well as an image of fish). Everything is working correctly except the image download. A user can open the app and see click on markers where a fish was caught. I show the details in map infobox. If a user does a long click it will download image and display it in the app. The pixel width is 300x200, and are roughly 16 to 20kb in size. When i test it over wifi image appears with no problems. when i use it over cellular service it does not download. I have done a speed test and depending on where I am at I get 2 to 4mps. the reason for slower speed is because most of the lakes are in rural areas where signal strength is limited. I don't know if google is doing any type of bandwidth throttling. Sorry for the lengthy description. Any help would be appreciated.
Can you please provide a simple example aia project that demonstrates this behaviour ?
Here is the aia file for my fish marker app. There are several code blocks that are disabled. The image files are 24kb in size. I can not get the images to load over cellular network, only wifi. Crazy. See if you can figure this out please. How do I send attachment?
Thank you
will there be some fish ?
yes, and a pic of me Sorry
@Mark_Parente Cool app. Is it for tracking fish (migration, patterns, etc) or for keeping a running count of what fish you've caught and where? Either way, it's cool.
Thanks, I live in a nature preserve where we have stocked lakes. Catch and release only. I thought it iwould be cool to keep track of what's being caught. I know I'll need to make one for IPHONE. Waiting on ai for ios.
Tim,
Were you able to replicate issue?
I've thinking of making a similar (in concept) app for reviewing books and for reviewing restaurants. Just need to finish the current one. You should think about adding a webviewer for fact sheets or something of the sort for the fish type. I took a quick look at the app and I didn't see anything of that sort.
Did you try app with wifi off. Using only cellular service. I don't get images to appear. could it be a type setting?
I didn't test it out (I don't have my tablet rn). I just looked to see if you had a fact sheet component. Sorry.
you need to try it over cellular network. I don't know if your tablet supports cellular.
First run in companion emulator (no location sensor) I got your location and fish
Second test on android 11 device, I just get blue sea (middle of the Atlantic, 0,0), and app crashes
This with wifi (can't run companion without wifi)
you try usb connection?
Tim,
The following link points to a fish picture that was uploaded to google drive spreadsheet using your image upload example.
" https://drive.google.com/uc?export=view&id=1X1v2c17znTA5GcVCr6u49LXXPmalaX9b"
over wifi it loads just fine. over cellular network it does not load. Can you tell me why this is happening? File size is 24KB.
Built a simple apk using these blocks
Image is loaded on both occasions
Using wifi it takes @ 1 second
Using data it takes between 5 and 10 seconds
this is probably to be expected....
See if a different url makes any difference ?
https://drive.google.com/uc?id=
instead of
https://drive.google.com/uc?export=view&id=
Consider, numerous factors affect performance using network versus WIFI. These affect communication with GoogleSheets and displaying images on your Map:
-
the OSM servers operate using donated servers. The ability to refresh the Map is dependent on an OSM (not MIT) server. My experience using the Map component and WIFI (both compiled and using Companion) is that Maps update within several seconds to up to 30 seconds. It sometimes takes longer when the servers are busy. This is the performance observed without querying a GoogleSheet and using WIFI, if you query a sheet, it will take even longer to update the map. Map update performance using network is always slower than WIFI depending on whether I get a 4 or 3G network connection. Performance also depends on the strength of the network connection. You said: [quote="Mark_Parente, post:1, topic:22424"]
most of the lakes are in rural areas where signal strength is limited.
[/quote] -
Performance on my old LG Android 4.2.2 is much slower than my Samsung tablet (Android 8.1). I expect that difference is a hardware issue (better cpu, better gps receiver and perhaps better OS software).
-
OSM can be very slow refreshing on weekends and during other high use periods, even when using WIFI. OSM throttles high use apps and refreshing becomes slower performing when lots of users of this 'free' service are active.
-
The gps receiver requires setting the GPS TimeInterval to about 20 or 30 seconds to ensure a satellite fix. The gps needs to know where it is. Setting TimeInterval to less than 20 seconds results on poor performance on my apps, especially when using the tool within a city's building canyons or in mountainous or hilly terrane.
Is better performance possible? Perhaps. Refactoring (revising the code) improved one of my apps that uses the gps receiver. A newer phone (with improved hardware) or a 5g network should make a difference with both OSM and Google Sheets.
- Your app uses the Map component and many of its features. Turn off the compass etc. and see what happens. (I don't expect dramatic changes but these features require ms to execute).
- fiddle with your 'MarkerDelay' Clock (that 3000 ms is suspicious and is at odds with your LS.TimeInterval).
- You set the LocationSensor to attempt a satellite fix at 1000 ms ... don't do that, try 30000 ms (30 seconds). I expect you don't need to refresh the gps location and more important refresh the Map that often. Those activities uses up your network bandwidth.
- You use a Notification.Alert to tell your user there is a Location Change. Since App Inventor processes commands asynchronously and that alert message persists for a few seconds, using the alert might be slowing down your performance.
You probably have other issues that need to be refactored. Your network performance will never approach you WIFI performance unless you are perhaps on a 5g network. Apps that depend on communications with the Web have natural bottle necks. You might be able to eliminate some and achieve a slight performance increase.
- Do you know that it is possible to use OSM tiles without being connected? Your Map app caches OSM tiles.
Most of these comments refer to use of the Map component, not Google Sheets, however you are using BOTH together so what affects one affects the other. I expect you will have to live with slow performance on network when operating from you and your users 'isolated' environments.
Regards,
Steve
Here's what I found when I simplified to image retrieval.
I created a app that has a button, list view and a image block. I filled the list view with a couple of links to images on my Google drive. these are the same links contained in my sheet. I built the app and installed it. went outside had two bars showing on my cellular strenngth, and app worked just fine. images took 2 to3 seconds to down load. So I'm guessing I need to work on some of the suggestions Steve so kindly suggested. Any other suggestions are welcome.
Thanks
What are OSM Tiles?