geolocation

Getting CivicAddress on Windows Phone 8.1

醉酒当歌 提交于 2019-11-30 15:59:03
问题 I'm trying to get the CivicAddress from a Geoposition in Windows Phone 8.1 I've tried using the following code: // Get Current Location var geolocator = new Geolocator(); geolocator.DesiredAccuracyInMeters = 100; var position = await geolocator.GetGeopositionAsync(); // Get Country var country = position.CivicAddress.Country; which throws NullReferenceException as the CivicAddress field is null. I understand that a CivicAddress provider is not provided for Windows 8. I would like to check

Getting CivicAddress on Windows Phone 8.1

拥有回忆 提交于 2019-11-30 15:35:35
I'm trying to get the CivicAddress from a Geoposition in Windows Phone 8.1 I've tried using the following code: // Get Current Location var geolocator = new Geolocator(); geolocator.DesiredAccuracyInMeters = 100; var position = await geolocator.GetGeopositionAsync(); // Get Country var country = position.CivicAddress.Country; which throws NullReferenceException as the CivicAddress field is null. I understand that a CivicAddress provider is not provided for Windows 8. I would like to check whether this is the case for Windows Phone 8.1 If so, how can I obtain / write a CivicAddress provider?

Switching between gps and network provider according to the availability

巧了我就是萌 提交于 2019-11-30 15:34:58
public void onCreate() { locationListener = new GeoUpdateHandler(); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); try { gps_enabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); network_enabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); } catch (Exception ex) { } if(gps_enabled) { locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, TIME_DURATION, 100, locationListener); } else if(network_enabled) { // Checking for GSM locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, TIME

Facebook graph api search results depends on location?

荒凉一梦 提交于 2019-11-30 15:32:36
问题 I've tried to fetch results using Graph search API and I've notice that the results when executed in my computer (Argentina) are different from the results when I run it in a server (France). Is this like this? How can I force a location for a search? 回答1: Thanks @Sascha Galley. I also find another easy way. Just add &locale=en_US in Facebook Graph search API query URL . This is languages and locales list refrence 回答2: I don't know exactly which results are different and which skd version you

Test if html5 geolocation permission already has been granted

梦想的初衷 提交于 2019-11-30 15:19:09
Does anyone know if there is a way to test if prior html5 geolocation permission has been granted? I try to make a script that does not request the geolocation unless the permission for the page has already been given. Does not nessicerily have to be html5; other frameworks are also ok. According to the Geolocation API Specification there isn't any function for this. Even the option to save it in the browser preferences isn't pushed to your code. If it's realy important and you realy have to beeing aware of this, you have to write a browser addon for every common browser and ask the user to

What's the most battery-efficient approach of using LocationClient to periodically get updates?

我们两清 提交于 2019-11-30 15:13:02
问题 I am thinking about having two separate alarms to gather a user's location data every hour, one that goes off every 59 minutes to "connect" the client and a second to actually get the location and then subsequently disconnect the client. In terms of battery life, is there anything else I should consider doing if getting the user's location will be the primary drain of the app? Or, is there a different approach to having two alarms? I originally only had a single alarm, but performing a (

Requesting just geotagged statuses from the Twitter API

纵然是瞬间 提交于 2019-11-30 15:07:06
How can I ask the twitter API to give me just geotagged statuses? I'm currently filtering but it would make more sense to be more 'friendly' Seems like you should be able to do this with the streaming API and a location filter , just set the bounding box to cover the whole earth: Just as with the track parameter, queries are subject to Track Limitations, described in Track Limiting and subject to access roles, described in the statuses/filter method. Both the number and size of bounding boxes is limited. Bounding boxes can be up to 360 degrees longitude by 180 degrees latitude, and you may

How to get Yahoo's woeid by location?

旧时模样 提交于 2019-11-30 14:28:07
// Get woeid by lati/long HttpGet hg = new HttpGet( "http://where.yahooapis.com/geocode?location=" + latlon + "&flags=J&gflags=R)"); HttpClient hc = new DefaultHttpClient(); HttpResponse weatherHR = hc.execute(hg); if (weatherHR.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { if (DEBUG) Utils.log("", "Location != HttpStatus.SC_OK"); return null; } I used this API and it work ok before, but It return a error since today, the HttpStatus.SC_OK is not OK. Has this API been closed? Thanks. Yes, it's closed, give a look here: http://soup.metwit.com/post/47181933854/an-alternative-to-yahoo

Make clickable polygons on Google Maps (for Android)

寵の児 提交于 2019-11-30 14:00:22
I have continuous LatLngs of various areas in a city. Is there any way I can create clickable polygons with it. Once way to go about would be to Generate polygons with the available LatLngs.( I want to visually show the polygons on the map with color encoding) Set up setOnMapClickListener . Do a point inside polygon test. I understand that this is very naive. What are the alternative approaches? bittterbotter Here's how I did it. Polygon polygon = getMap().addPolygon(new PolygonOptions() .add(new LatLng(12.780712, 77.770956), new LatLng(12.912006, 77.229738), new LatLng(12.412006, 77.629738),

What's the most battery-efficient approach of using LocationClient to periodically get updates?

拜拜、爱过 提交于 2019-11-30 13:53:25
I am thinking about having two separate alarms to gather a user's location data every hour, one that goes off every 59 minutes to "connect" the client and a second to actually get the location and then subsequently disconnect the client. In terms of battery life, is there anything else I should consider doing if getting the user's location will be the primary drain of the app? Or, is there a different approach to having two alarms? I originally only had a single alarm, but performing a (!mLocationClient.isConnected) then connect check does not give the client enough time to connect. Thanks for