Get coordinates from location sensor

Dear Friends,
I am trying to save coordinates into google spreadsheet.
This blocks worked in emulator, unfortunately failed after I installed my app.
Maybe because of Play protect?

I also tried to upload then download my app from Amazon app store. Still, my app fails to save coordinates. The google spreadsheet only returns with latt = 1 and longt = 2.

Please kindly advised.

Thanks in advance.

Is this your full block?

You have shown the procedure to savedatabase but where are you calling it??

Did you assign the same name given in the text block as in the script codes??

  1. No, I got click Button to initiate.

  2. Yes, I assign the same name. It works in emulator, but failed when I installed.

Thx for your response.

Since you ar using location it will take sometime to display the co ordinates. Are you getting it in label?

Yes, but sheet only got: latt = 1 and longt = 2.

Any advice?

Can you show your script URL??

By the way , to send data to gsheet using script URL Pls try to follow the method as suggested in this tutor

Yes I followed above thread.

I eventually solve my problem.

Solution is adding location sensor on previous screen. Because the sensor needs time to get latt & longt. So those values could be sent on next screen.

Thx for all your advice.

I am using it in my all but I will call my app to read the latt and long whenever screen intialise with spinning progres. It will spin till I get co ordinates. If it gets spinning will stop and I will go for another operation.