2016년 12월 23일 금요일

Location sensor not showing current address


Location sensor returns latitude and longitude, but not current address.
I found a couple of threads regarding this issue, but there was no solution. One of those threads mentioned that in some places google might not be allowed to give address information, so i tried entering the White House coordinates, but couldn't get an address either. I'm testing my app in Genymotion.
Also, i tried entering my coordinates in http://www.latlong.net/ which is powered by google, and it returned my street address correctly.
Any ideas?

-- 
Did you use the block to get the current address ( LocationSensor1.CurrentAddress) ?   We can't tell because you did not post your blocks. There are multiple reasons why a user might not be able to get a street address.  Yes, sometimes it might be blocked in some countries, frequently an address is NotAvailable in rural areas (what is the address of a cotton field?) or in large cities without defined street information and sometimes no address because the GPS fix is insufficient to provide that information.   To use CurrentAddress, the device must have a network or WIFI connection.  

It does not appear you have yet read and done the MIT Location Sensor tutorial or done any of the tutorials that explain how to use the LocationSensor and how it works.  Please 
try:

➠ Android, Where's My Car? for App Inventor 2
You parked somewhere near the stadium, but when the concert ends you don't have a clue where the car is. Fortunately you haven't lost your Android phone that never forgets anything, and you remember you have the hot new app, Android, Where's My Car?. With this app, you click a button when you park your car, and the Android uses its location sensor to record the car's GPS coordinates and address. Later, when you reopen the app, it shows you a map from where you are to the remembered location-- problem solved! With this tutorial you'll be able to download a created app and then study the annotated blocks below to better understand the app and App Inventor programming in general. This appcovers: GPS, TinyDB, and using Activity Starter to open a map.
Advanced
➠ Map It: Displaying Locations on a Google Map
This tutorial shows how you can develop an app that allows you to record list of addresses and view the address on the Google Maps. It will also show you how view your current location on the Google Map.
Advanced
➠ Exploring with Location Sensor in AI2
The location sensor object is used to communicate with the global positioning satellite receiver (GPS) in your phone/tablet. When the LocationSensor communicates with the built-in GPS receiver, the GPS can determine the location of your device.  The sensor can also work with network/wifi location services.  Finding a location using the network uses very different techniques to determine a location. Location means, the device's present latitude and longitude or it can mean your street address.

You are using Genymotion.   Have you tried testing your code on a device with a GPS receiver?   The issue might be your emulator does not emulate or your code has issues.

Merry Christmas, Wesołych Świąt,  Feliz Navidad, God Jul, Joyeux Noel, Καλά Χριστούγεννα, Happy Christmas, Veseloho Rizdva, Prettige Kerstdagen, Frohe Weihnachten!, 성탄 축하 , Buon Natale,  聖誕快樂 ,  圣诞快乐,  Sretan Božić, C рождеством!,  عيد ميلاد مجيد,

-- 
Before posting I looked at the blocks in the tutorials that you mention and they looked just like mine. I will give those tutorials a try anyway. My emulator seems to be emulating, it returns latitude and longitude just fine.

-- 
you were right, it's a problem with the emulator. I installed the app on my phone and worked flawlessly.

-- 

댓글 없음:

댓글 쓰기