geolocation

Efficient Background service for tracking user location

柔情痞子 提交于 2019-12-02 19:50:11
I am developing a small android application in which I want to have Geolocation functionality. What I want to code is one service which gives the updated location of a user whether they are using my application or not. I know that if I am continuously checking the user's location it will drain the battery of the device, so I want good solution for that. For example, to give me updates every 5 or 10 minutes. I have read about this question a lot but I wanted to get one good solution. I read this page and it's a good solution if the user is using my application but if the user not using my

All Countries States Cities and Zipcodes in a Application

僤鯓⒐⒋嵵緔 提交于 2019-12-02 19:48:39
Is there a way getting all countries, states,cities zipcodes/ in one single database. I have been looking all over. I discovered geonames.org , which has I guess all of the content. But there is no way to fetch that data directly. I am using rails. If there any helpers or Plugins, it'd be great. It would be awesome if there is a complete resource in any parsable format which I can use to get this database in place. Please recommend if you any thanks I do have the iso country code list but no States for some countries. Thanks in advance Thanks Guys, I got all the the countries and states of all

PHP/MySQL: Select locations close to a given location from DB

情到浓时终转凉″ 提交于 2019-12-02 19:44:19
In PHP, I have the following code for calculating the distance between two locations: <?php function distance($lat1, $long1, $lat2, $long2) { // DEGREE TO RADIAN $latitude1 = $lat1/180*pi(); $longitude1 = $long1/180*pi(); $latitude2 = $lat2/180*pi(); $longitude2 = $long2/180*pi(); // FORMULA: e = ARCCOS ( SIN(Latitude1) * SIN(Latitude2) + COS(Latitude1) * COS(Latitude2) * COS(Longitude2-Longitude1) ) * EARTH_RADIUS $distance = acos(sin($latitude1)*sin($latitude2)+cos($latitude1)*cos($latitude2)*cos($longitude2-$longitude1))*6371; return $distance; } echo distance(9.9921962, 53.5534074, 9

iOS 7 Simulator on Mac doesn't work with custom location (Also doesn't ask permission)

孤人 提交于 2019-12-02 19:43:06
问题 I'm trying to make an iOS7 app that uses the current location of the device. I'm using the iPhone simulator on my Mac, but I'm having some problems. Every time my view that the location manager is in appears, it prints out 0.000000 for both latitude and longitude, even after I've set a custom location (from simulator>debug>location). Also, it seemed strange that the simulator didn't ask for permission to use current location when it opened the app. Anybody know what's going on here? - (void

Retrieving Current Location and Zip using Geolocation Button

南笙酒味 提交于 2019-12-02 19:34:44
问题 I want to place a Geolocation button near my UISearchBar , which on clicking, it should return the zip (eg. 20043). I will be using the value from the ZIP to get the list of buildings near me. I would appreciate it if someone could help me with the location Button, and what are the methods to implement to return just the ZIP ( integer ) ? And would a custom UIButton work for the location button ? Thank you! 回答1: In iOS 4 there is no forward geocoded (turning an address into lat/long), there

How to convert postcode to Geolocation (latitude & longitude) using google maps api?

别说谁变了你拦得住时间么 提交于 2019-12-02 19:33:52
I just want to get latitude & longitude using the post code with Google maps API. I am using PHP for development. How can I do this? The post code can be from any where in this world. You can do this using google map Geocoding API. Please find below example, but to correct latitude/longitude and address you need to pass full address along with zipcode. For more detail please click on below link: http://code.google.com/apis/maps/documentation/geocoding/ <?php $url ="http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false"; $result =

How to compute hypotenuse and bearing

蹲街弑〆低调 提交于 2019-12-02 19:29:29
问题 I got the below code from @DanS at this link how-to-display-a-map-still-image-file-with-a-moving-current-location onCurrentPosition(Location current){ double hypotenuse = upperLeft.distanceTo(current); double bearing = upperLeft.bearingTo(current); double currentDistanceX = Math.cos(bearing) * hypotenuse; // "percentage to mark the position" double currentPixelX = (currentDistanceX / upperLeft.distanceTo(lowerRight) * Math.cos(upperLeft.bearingTo(lowerRight))) * mapWidth; moveIndicatorX

Finding user location

送分小仙女□ 提交于 2019-12-02 19:24:40
问题 I am trying to get user location for my weather app. I am currently unable to do so and have tried to follow both the Google Last known location guide, as well as https://guides.codepath.com/android/Retrieving-Location-with-LocationServices-API. import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.location.Location; import android.net.ConnectivityManager; import android.net.NetworkInfo;

Phonegap/Cordova geolocation not working on Android

我是研究僧i 提交于 2019-12-02 19:06:50
I'm having a trouble to get Geolocation working on Android in both emulator (even when I geo fix over telnet) and on device. Works on iOS, WP8 and in the browser. When I ask device for location using the following code, I always get an error (in my case custom Retrieving your position failed for unknown reason. with null both error code and error message). Related code: successHandler = (position) -> resolve App.Location.create lat: position.coords.latitude lng: position.coords.longitude errorHandler = (error) -> error = switch error.code when 1 App.LocationError.create message: 'You haven\'t

How to get GPS Coordinates from all the users of my application?

大憨熊 提交于 2019-12-02 18:55:57
Explanation/Scenario: I am developing a app that needs to get in real-time(like 3sec's update) the location of all users of mine app, and these users knowing that, too, will see the another users location, in a map, for example: This location, needs to be in real-time, because all of the users have access to the map, they need to know where are the users of the app, in the exact moment, to find them selves. Question: What i need to do to make my application get in real time the location of all of the users in gps coordinates( for later use on the map )? Obs: I am not asking a full application,