FAQ Database Discussion Community


Android getLastKnownLocation(LocationManager.GPS_PROVIDER) returns null

android,gps,location
I'm using following code to get my current location. It works perfectly using NETWORK_PROVIDER. But whenever I use GPS_PROVIDER, it always returns null. I know the same question has been asked many many times but none of them solved my problem public class GPSTracker extends Service implements LocationListener { private...

Best approach for creating a reusable object to get users location?

android,android-fragments,location,google-play-services
I have an app which currently consists of 2 activities. Inside the first activity there is a Fragment which itself contains a MapFragment. The other activity contains a ViewPager which holds two fragments, one of which is also a Fragment that itself holds a MapFragment. In both fragments that contain...

How to get user's location in iOS using google plus sdk?

ios,ios7,location,google-plus
I am integrating Google Plus login in my app along with Facebook and Twitter login. So, is it possible to get user's location(city) Like Facebook and Twitter? If yes, how? Any kind of help would be appreciated....

Trouble getting location data using LTE rather than WiFi

java,android,location,locationmanager,locationlistener
I am trying to get the Lat/Long for the device when using 4G/LTE. The code below works great when using WiFi but the onLocationChanged method doesn't get called at all when using 4G/LTE. Any idea why? I only have a limited window to get the location coordinates as they need...

GPS location not accurate

google-maps,gps,location,nmea
I am using a GPS device to track my device location. The data was received in NMEA format and I parsed the latitude and longitude from the GPRMC data. But the issue is that the location obtained when checked in google maps was found to around 600 meters shifted from...

Locate Computer in Network topology

networking,location,client,topology
I ask myself that for some days now, and couldn't find a clear answer. Imagine a network with several rooms, each room with it's own (Layer 2) Switch. Those are then connected in star topology to another switch which is then connected to the router. All Clients get IPs from...

Android Location API not properly tracking the user

android,gps,location,location-provider,fusedlocationproviderapi
I have a background service which should track the user movement with his car, and send the data to my server. I have two variables for sending the location, either 60 seconds have passed or the user has moved 100 meters. On my service here is how I start listening...

location_updated_message cannot be resolved or is not a field

android,location,sample
I've been trying to understand the code provided in the android developer site. https://developer.android.com/training/location/receive-location-updates.html#stop-updates Which leads me to this github code. https://github.com/googlesamples/android-play-location/tree/master/LocationUpdates So I've been copy pasting it all into my app. With my own API key and such. But I'm getting this error at onLocationChanged method which it underlined...

How do I add values to input fields using JavaScript?

javascript,forms,input,location
I'm building a form and would like to automatically fill in the user's coordinates into one of the fields using Google's Geolocation API. I'm only using one input for this because both coordinates are returned together. The text field will be read only so the value cannot be changed by...

Can't access other folders/directories with my XML program

xml,directory,location,folders,pathing
So right now I'm trying to access a certain file automatically through the browse function on my computer. This is what I have so far, but it only keeps me within the same folder as my file is in. How would I access another folder with this: <SupportedDevices> <Device VID="0x1234"...

Android GeomagneticField not working [duplicate]

java,android,location
This question is an exact duplicate of: android.location.Location setters not working as expected 1 answer I am experiencing some problems using Android location-related APIs. Let me cut to the chase: GeomagneticField geoField = new GeomagneticField(20f, 20f, 0, System.currentTimeMillis()); float declination = geoField.getDeclination(); Those are testing values and they have...

header( 'Location: XXXXX );

header,location
If I have a php page that will save data from a form to the database then I want to forward that person to another place, do I have to put header( 'Location: URL ); at the end of the PHP script, or can I put it at the begining...

Core Location not responding

ios,objective-c,location,core-location
When I enter the following code and run it on the simulator and set the location to "City Run", it does not log anything. I don't know what I am doing wrong though. .h #import <CoreLocation/CoreLocation.h> @interface ViewController : UIViewController <UITextFieldDelegate,CLLocationManagerDelegate> { CLLocationManager *locMgr; } @property (nonatomic, retain) CLLocationManager *locMgr;...

Retrieve all latitude longitude points within x distance given an area

location,gis,latitude-longitude,postgis,geo
Given an area defined by x amount of points, I'd like to split that area in to 3 mile blocks and retrieve the center latitude longitude from each block. Here's what I mean: Area covering London: Area split in to 3 mile blocks (not perfect): And then print out the...

Unable to get longitude and latitude in ios8 by GPS

ios,ios8,gps,location,core-location
I am using iOS8 and using the following code for getting longitude and latitude by GPS: -(void)CurrentLocationIdentifier { locationManager = [CLLocationManager new]; locationManager.delegate = self; locationManager.distanceFilter = kCLDistanceFilterNone; locationManager.desiredAccuracy = kCLLocationAccuracyBest; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 && [CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorizedWhenInUse) //[CLLocationManager authorizationStatus] !=...

Get user location in background

android,gps,location
I have an app that updating user location is the main feature of it. So far I have a class that get users location through both GPS and NETWORK providers . It works just fine : public class UserLocation { private String TAG = "UserLocation"; Timer timer; LocationManager locationManager; OnLocationResultListener...

LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this); Tries to cast as com.google.android.gms.location.LocationListener)

android,google-maps-api-3,casting,location
I have set up a Location based map on Android however when I try and call: LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this); Android studio tries to have me cast it as LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, (com.google.android.gms.location.LocationListener) this); This however causes the app to crash when it is called. I have the following Location code for my app:...

iOS 8 CLLocationManager enterRegion: not getting called if use requestWhenInUseAuthorization

ios,objective-c,location,cllocationmanager,clcircularregion
I'm trying to get being called the delegate method locationManager:didEnterRegion in iOS 8 for custom region. Here is the code: self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) { [self.locationManager requestWhenInUseAuthorization]; } CLCircularRegion *region = [[CLCircularRegion alloc] initWithCenter:CLLocationCoordinate2DMake(20, 20) radius:1000 identifier:@"asda"]; region.notifyOnEntry = YES;...

Dropdown first option value not functional

php,jquery,location,html-select
I have a problem whit my dropdown list, I need to change location page when option selected using value option attribute, but the first option element not functional, This is the html code: <form> <select class='language-select' name='URL' id='URL'> <option value="index.php?lan=EN" selected> English</option> <option value="index.php?lan=FR">Français</option> </select> </form> and this is the...

difference between $_SERVER and apache_note

php,apache,location,geoip
I need to get the user country code and I've managed this by using both apache_note('GEOIP_COUNTRY_CODE') and $_SERVER['GEOIP_COUNTRY_CODE'] Is there any reason why I should use one of these over the other or are they both the exact same? They output the same result and as can be seen have...

Finding the compass orientation of an iPhone in swift

ios,iphone,swift,location,compass
I'm trying to make an app which is similar to a compass, but with notable differences, however, they are not important. What I need to know is: how can I get the iPhone to give me the compass orientation (i.e. 0 degrees for north) regardless of the phone's orientation (i.e....

Get Location Android

android,location,latitude-longitude
I have a service that get the location of my phone. When i turn the GPS off and turn it on again, i can't get the location anymore. Some times it return null the latitude and longitude but GPS is on... I have a checkbox when i check it, it...

importing python files that are in a folder

python,file,import,location,relative
I've been working on a project that creates its own .py files that store handlers for the method, I've been trying to figure out how to store the python files in folder and open them. Here is the code im using to create the files if they dont already exist,...

Not getting the location [duplicate]

android,gps,location,locationmanager
This question already has an answer here: getLastKnownLocation method always returns null 1 answer I am making a app in which i have to show a splash screen for 1/2 sec.While the splash is loading i have to get the user location.location accuracy is not concern.So for this i...

Converting CLLocationCoordinate2D to a String that can be stored

ios,swift,location,cllocation,nscoding
I'm trying to save the coordinates of a user while in one ViewController so that it can be used to create an Annotation that can displayed in another ViewController. In the view controller that stores the coordinates I'm using the code NSUserDefaults.standardUserDefaults().setObject( Location, forKey: "Location") In the map view controller...

Android Google Map not showing my location?

java,android,google-maps,gps,location
I am currently working on a Google Map current location application. Everything is good and there is no error detected. When I run my application, Google Map is able to load but is not showing my current location. So I put my logcat here and please someone help me. Is...

How to get location from Google Map after dropping Pin over it

android,google-maps,location,android-maps-v2
I'm trying to get location from GoogleMap using ImageView over it. I can drag this Pin image and the position where I drop it,I should get its location. I'm using framelayout with googleMap as it's first child and ImageView(i.e Pin) as its second child element. The same like we have...

Finding the location of a max int in a list

python,list,location
If given a simple example: k = ['a', 'b', 'c', 'd'] l = [20, 50, 1, 100] How can I write in one line, the simplest code to get the item in list k that corresponds with the location of the highest number of list l? k[max(l)] totally no idea......

linkedin api company search results for location

location,linkedin
I can't seem to find this in the documentation, its probably there, I just can't see it. I make a request like below, but I want to limit the results to a geographical region. Is there a query parameter I can use to do this? Something like location={something}? https://api.linkedin.com/v1/company-search:(facets,companies:(name,description,square-logo-url,website-url))?keywords=something&oauth2_access_token=xxxxxxx&format=json...

Retrieving value of inner promise

javascript,angularjs,location,promise,angular-promise
I am trying to access the value of a nested promise from a controller. Here is my controller. I am calling my service, expected a city name to be returned: LocationService.getCurrentCity(function(response) { // This is never executed console.log('City name retrieved'); console.log(response); }); And here is the service. I am updating...

Get listview item position after soft keyboard shown

android,listview,location,on-screen-keyboard
I have a ListView, it is under action bar and above an EditText. See picture: The list view items have random height according to its content. When click list view item, I need to focus on EditText and open soft keyboard, meanwhile I want the one being clicked to be...

Google Map api v2 Marker not moving until I rotate the phone and the map “refreshes”

java,android,google-maps,location,marker
I have the following code : public class MapsActivity extends FragmentActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener { private GoogleMap mMap; // Might be null if Google Play services APK is not available. // LogCat tag private static final String TAG = MapsActivity.class.getSimpleName(); private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000; private Location...

Pass Variable from Activity to AsynTask

java,android,android-asynctask,location
I have a App with a Navigation Drawer and some fragments. In my MainActivity i get the actual lat & long Location of the device. On my first Fragment in the drawer i load in a AsyncTask some stuff out of my Database on my Webserver For this request i...

How can I simulate a 'moving' location in Xcode 6.3.1

xcode,swift,location
Trying to extract some moving location data while training in Swift, and the simulator now only has fixed locations (London, New York etc). I think you used to be able to simulate moving via car or cycle. Is it possible to simulate a moving location? thx...

Angularjs authentication redirect issue

angularjs,authentication,location
I am having an app that every page except login requires authentication. I do this by checking the $stateChangeStart and then redirecting to /login when token is not set. on initial app load this works fine, but at login screen if i type another "restricted" url. It does the check,...

Can't get location right using Swift

swift,location,locationmanager
So, I am trying to get my Location inside a function of my ViewController.swift. The Code I use works when i try it like this: import UIKit import CoreLocation class ViewController: UIViewController, CLLocationManagerDelegate { var manager : CLLocationManager! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading...

Get current latitude and longitude android

java,android,gps,geolocation,location
Requirement: 1.Sometimes(not everytime) I am getting latitude and longitude 0.0. 2.I want to know how to get the location update after user has enabled the gps from the settings. Here is my code public class GPSTracker extends Service implements LocationListener { private final Context mContext; // flag for GPS status...

How to draw path as I move starting from my current location using Google Maps

android,google-maps,geolocation,location,locationlistener
I am trying to draw route as I move from my current location. I am facing a big problem in drawing route dynamically please help me to solve it. I am having marker at my current location in my map. As soon as I start moving I want the map...

Obtaining iPhone Latitude & Longitude

ios,iphone,swift,location
I've been attempting to retrieve a iPhone's latitude and longitude for purposes of passing to an external function in order to geotag something. However, I've been rather unsuccessful. Here is the code I'm working with right now. let locationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() // Do any additional...

distanceBetween or other way to check if current position is in radius to marker

java,android,google-maps,location,latitude-longitude
I want to check if the current location of the user is in a certain radius to a marker. Should I do it with distanceBetween()? What arguments to I have to pass this function and what exactly does the result say? LatLng markerPosition = marker.getPosition(); myLocation = locationManager.getLastKnownLocation(provider); double latitude...

Google Map Not Showing (Zoom to) Current Location After Set Latitude and Longitude manually [duplicate]

android,location,google-maps-api-2
This question already has an answer here: How do I get the current GPS location programmatically in Android? 9 answers How to get current location in Android [duplicate] 3 answers I want to show my current location using custom Latitude and Longitude, I have set latitude and longitude in...

startMonitoringForRegion vs startMonitoringSignificantLocationChanges

ios,bluetooth,location
Im building a simple ios app with IBeacon, Im using startMonitoringForRegion for detect beacons. [self.locationManager startMonitoringForRegion:beaconRegion]; That's ok. My problem is that i want to check if the bluetooth is ON or OFF. If the bluetooth is OFF i want to check periodically if the user is near a network...

How can i get the base host in angular JS

javascript,angularjs,location
I have this in url https://192.168.0.10/users/#!/user-profile/20 $location.host is giving me 192.168.0.10 I want to only get https://192.168.0.10 How can i get that...

GPS Icon wont dissapear when remove updates is called from onPause Android

android,location,maps,locationmanager,android-location
Hi i am having a issue where the location icon wont dissaprear after calling location.removeUpdates. I have followed this solution. public class GPSTracker extends Service implements LocationListener { // Get Class Name private static String TAG = GPSTracker.class.getName(); private final Context mContext; // flag for GPS Status boolean isGPSEnabled =...

Mapbox keeps GPS Lock after app is the background on Android

android,gps,location,mapbox
I Want to use mapbox in an app we are building so far it running good, but I keep noticing that even when the app has gone to the background the phone still has a GPS lock. Im using the Mapview component in a fragment and in the initialization of...

CLLocationManagerDelegate delegate not called iOS in 8.1

ios,objective-c,location,static-libraries,cllocationmanager
I'm working with CLLocationManagerDelegate in my static library when i run on iOS 7 device everything works perfectly but when i test it on another device with iOS 8.1.3 the delegate methods aren't getting called. i made a strong property @property (nonatomic, strong) CLLocationManager locationManager i've also added the appropriate...

didEnterRegion and didExitRegion don't work in iOS8

swift,ios8,location
I'm using Core Location to track a region in order to detect if the user enters o exits this region. Unfortunately, my code works in iOS7, but not in iOS8. This is the code that I'm using: func setMonitoredRegion() { var startLocation: CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: +52.53753000, longitude: +13.35971000) var monitoredRegion...

Why do I have java.lang.ClassnotFoundException while implementing location listener? (using ECLIPSE)

java,android,eclipse,location,google-play-services
I know that similar questions have been on SO and I have read through and tried to implement the solutions mentioned but nothing is working. The specific problem is like this (using ECLIPSE): I am trying to implement location awareness in one of the activities (triggered through menu selection) in...

How to get user location continuosly without GPS

android,geolocation,location
There are some questions regarding this issue but I could not find any method works without problem. I implemented the version of the project with GPS provider and now I want to implement a version which can find the location of user without GPS, just using network provider such as...

Scale coordinates on radar

java,android,math,gps,location
I'm currently developing an radar for android. (Following this tutorial: http://www.androidph.com/2009/02/app-10-beer-radar.html ) I'm getting all users within a range of 5KM around my current location from the server after that I draw in my customview like this: float xU = (float)(userLocation.getLongitude() + getWidth() / 2 - currentLong); float yU =...

Window location dynamic on “session”

c#,wpf,window,position,location
I've an application that "popup" a window with a ShowDialog. The ShowDialog can be called many times in the app life cycle. So, I wonder if that possible (simply) to set the Window location to "CenterOwner" by default (like now). But if the user change the position of the window,...

Position JavaFX Button in a specific location

button,layout,javafx,position,location
My Question is how can i position a javafx button in a specific location. All the time that i tried to do this simple code is resulting that the Button is only located in the Center of the screen and not on my desired location. (I'm using StackPane) Code: Button...

Location Menager - Location Updates

java,android,parse.com,geolocation,location
So I'm trying to update the current location of a user every 5 seconds using a locationMenager, but it's not working. Here the code: GPSTracker.java public class GPSTracker extends Service implements LocationListener { private final Context context; boolean isGPSEnabled = false; boolean isNetworkEnabled = false; boolean canGetLocation = false; Location...

periodically send location updates using fusedLocation API

android,location,alarmmanager,periodic-task,fusedlocationproviderapi
Android programming is a brand new thing to me, i've been playing with android's location and i have a same issue, im going to send a periodic location updates to a server in background and i'm using the AlarmManager/LocationManager approach, set an alarmManager with a defined Interval then when the...

update view to a location from onChangeListener

android,location
I am following an Android weather app tutorial where the weather app requests a wether information about a place using an API; However, the app was not "location aware" so I decided to try to do that, but when my app is created it calls the API with the hardcoded...

android.location.Location setters not working as expected

java,android,location
I need to create a Location object from some latitude and longitude values, without going through a location provider. I do the following: Location l = new Location(""); l.setLatitude(32); l.setLongitude(43); The values, however, are not set properly, since both getLatitude() and getLongitude() return 0. Can you please tell me where...

Database Design - Where should user location be stored

database,design,location
Im building a friendship website. The problem I'm having is where should I store the locations of users ( I need to store two variables [country] [state/province]). The friendship site has a question and answer table currently that stores users attributes such as user religion , users eye color etc......

vb.NET Screen Location

vb.net,location,screen
I'm working with a multi monitor setup. I know that you can do Screen.AllScreens(x) to get a specific screen, but is there any way to identify which screen is in which position? I.E. Screen 0 is on the right, screen 1 is on the left, screen 2 is in the...

Location list in ascending order

android,search,text,location
I am working on google place API for getting near location list of user's current location. I am succeed in getting the list in particular radius of user's current location. I want this list of location in ascending of distance.So location which is near to me should be display on...

Android - location not updating

android,android-emulator,gps,location,google-api-client
At the moment when i use the geo fix lng lat command my application doesn't pick up that the location has changed. My simplified code looks like this: if (googleApiClient.isConnected()) { Location lastKnownLocation = LocationServices.FusedLocationApi.getLastLocation(googleApiClient); if (lastKnownLocation!= null){ Log.d("Log", "Lat: " + lastKnownLocation.getLatitude()); Log.d("Log", "Lng: " + lastKnownLocation.getLongitude()); } else...

Get check status 'Location consent' (WiFi & mobile network location)

android,gps,location,settings
in Setting > Location, How can I know check status of 'WiFi & mobile network location'? Click on this, show up 'Location consent' dialog. screenshot link...

Location of file in magento - Credit Memo email

file,magento,location
Trying to find the location of sales_email_order_creditmemo_items to customise the transactional emails...

GsmCellLocation returns a same value

java,android,location
I'm trying to catch cell ids by hand-off. I succeeded to get a cell id that was connecting to my cellphone at first. However, I can't explain this exactly, it seems not to synchronize. I roamed around several times but, it always returns the first cell id. public class MainActivity...

Location updates not received during Fetch background mode

ios,background,location,fetch
I'm using Selene to schedule background fetch tasks. During the fetch task I call requestAlwaysAuthorization and startUpdatingLocation on a CLLocationManager instance. When the fetch task is launched it can be seen on the status bar that location services are on, but the callback locationManager:didUpdateLocations: is not called. I have set...

Why i can't get Location?

swift,location
I want to get my location coordinates. And for any reason my loactionManger:didUpdateLocations does not work. I hope you can help. import CoreLocation class Location: NSObject , CLLocationManagerDelegate { let locationManager = CLLocationManager() var latitude = 0.0 var longitude = 0.0 func getLocation() -> (latitude:Double , longitude: Double ){ if(CLLocationManager.locationServicesEnabled()){...

Android Tracking App - check if someone is getting closer or distancing from specific point

android,location,tracking
I created an android app, which stores user's home location and count distance between home and his/her actual location, in a Service class. Now I would like to programme feature that would decide based on counted distance, if a user is: at home away getting closer distancing from home This...

Android application which allows location selection through google maps

android,google-maps,select,location
I am trying to make an application which allows the user to select a location on google map(on the press of a button). It is not related to his current position. He can select any position he wants(I was reading into markers, some help on that will be greatly appreciated)....

Find closest location from a list of locations in csv file Python

python,sorting,csv,dictionary,location
I have a csv file that looks like this (Location Name, Lat, Long): LocA, 40, 75 LocB, 100, -80 LocC, 45, 50 LocD, 20, -30 ... And I have a hard coded beginning location (Lat, Long): [20, -30] Using Euclidean: d = sqrt((x2 - x1)^2 + (y2 - y1)^2) I...

iOS Swift - Reload location function with NSTimer for app background doesn't work

ios,swift,background,location
I've got a problem with location services. I can't set up a function that updates my location coordinates in the background by a NSTimer. Here is my code from appDelegate: var locationManager = CLLocationManager() func applicationDidEnterBackground(application: UIApplication) { self.locationManager.delegate = self self.locationManager.desiredAccuracy = kCLLocationAccuracyBest self.theTimer = NSTimer(fireDate: NSDate(), interval: 40,...

Getting the location periodically and plotting markers to map

android,google-maps,location
I'm looking to create an app in android that basically tracks a phones location and periodically adds a marker to the google maps api so that a route can be displayed, the problem I have is that I don't know how to get the location periodically and in the background....

How get the current latitud and longitud without use getLastKnownLocation method in Android?

java,android,gps,location,latitude-longitude
I am trying to get the current position of the phone, for this I use the GPSTracker tutorial, the problem is always use the method getLastKnownLocation and return older position. if (isNetworkEnabled) { locationManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this); Log.d("Network", "Network"); if (locationManager != null) { location = locationManager .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); if...

(Android) How to retrieve current location using Google Play Services

java,android,location,google-play-services
I'm fairly new to Android app development and I'm currently looking into retrieving the user's current location (coordinates & city) using Google Play Services. As of now, I fail to find any clear step-by-step tutorial on doing so. Any advise or guidance would be greatly appreciated!

GoogleMap V2 doesn't start with user current location

java,android,google-maps,gps,location
I am newbie on Android. I want to develop a simple GoogleMap application. But my app doesn't start with user current location my user current location object is null on application start, when i press the menu key and rerun my app, it shows but i want to show current...

Javascript Timezone get Location similar to PHP DateTimeZone::getLocation?

javascript,node.js,geolocation,timezone,location
Does anyone know of a library, function or API that functions the same way as the PHP DateTimeZone::getLocation - http://php.net/manual/en/datetimezone.getlocation.php but for Javascript (or NodeJS NPM). Please note not looking for code just to point me in the right direction. Tried looking for something similar could find anything. For example...

Trying to send POST parameters with latitude and longitude

ios,objective-c,location,cllocationmanager
I am trying to send some parameters to my phpMyAdmin tables that contains a filed called latitude and longitude. Since then, i need to obtain the device coordinates and transform them into a string. I have followed the Ray Wenderlich tutorial but i am still getting "nil" in my parameters....

GMSGeometryLength in Android

android,ios,path,location,distance
I am porting a iOS code on Android, and I need to get the length of a polyline, which I have as an Array of LatLng's. This is the code of the IOS app that I'm trying to replicate: GMSPath *pathOfStep = nextDict[@"path"]; double progressOnStep = GMSGeometryLength(pathOfStep); Now how could...

Cannot get the getLastLocation method to work in Android Studio

android,service,location
I am testing with the location services in Android and I was following strictly the developer instructions (here :Google dev. link) on how to do this, but no luck what so ever. In my layout fine I have just two TextViews to display the latitude and longitude of the Location...

Create local location based notifications in swift

ios,swift,notifications,location
I'm a relatively new swift developer and I've heard in iOS 8 you can send local notifications based on a users Location. I have had a look at some code, particularly this one to create simple time based local notifications. var leftNotification1:UILocalNotification = UILocalNotification() leftNotification1.alertBody = "NotidicationA" leftNotification1.repeatInterval = NSCalendarUnit.CalendarUnitHour...

How would I access this specific part of a JSON?

json,location,return
Okay so I have a JSON that is returned from a POST function, but the problem is that the length of the JSON changes, the values are not all in set locations. For example here is one return: http://pastebin.com/dPt4fSgN And here is another return: http://pastebin.com/iALUPBTn Sorry that you have to...

JFrame wrong location with Ubuntu (Unity ?)

java,swing,ubuntu,jframe,location
It seems that there is a bug with Ubuntu (maybe only unity). The decoration of the JFrame is taken into account for getLocation() and getSize(), but not for setLocation() and setSize(). This leads to weird behaviour. For instance, if you use pack() after the frame is displayed and the dimensions...

Android GPS tracker return everytime 0 for the longitude and latitude

android,gps,location
I m trying to get the user location using the service that i call in my mainActivity.I believe i made already all the work needed but the problem i get back everytime 0 for the longitude and 0 for latitude ! I added user permission too but its not working...

Location Based Push Notifications For Android

android,android-studio,push-notification,location
Is there anyways in sending a location based push notification for android devices with out using a third party push notification service such as Parse? I would like to send push notification to my users without the annoyance of getting a notification that doesn't relate to that specific user because...

Beacon behavior when app is in the background

ios,location,ibeacon
Disclaimer - I'm a server side engineer so my knowledge here is limited. Question - if my ios app is in the background, will region monitoring allow multiple events after the initial region has been entered? Use case - with the app in the background, a user enters a facility...

Search Nearby Location by Coordinate? [duplicate]

php,location,webservice-client,location-provider,webservicehost
This question already has an answer here: Measuring the distance between two coordinates in PHP 4 answers i am trying to create a web service for our mobile developers. I have database of coordinates of locations. How do I return the result of nearby coordinates given a coordinate? Lets...

Android location from wifi only

android,gps,location,android-wifi
I've a custom HW running Android 4.4.4. It has a wifi connection but no GPS or cellular modules. I need to determine the location based on wifi only, but it seems Android can't. Visiting google.com in the browser also shows 'unknown' location. The wifi works ok though - browsing internet...

Stop a location listener activity when the user presses the back button, or when a new intent is made

android,location,listener,lifecycle,onpause
This app will beep whenever the user's location changes. The problem is that it will continue monitoring the user's location after they have pressed the back button, and navigated away from the app. How do I make it close nicely? I think that I have to add something to OnPause()...

Is polling gps location data within a non-wakeful Service a good practice?

android,service,gps,location
In a regular activity, it is mandatory to register to LocationManager when we want to receive updates, and remove updates sometime later, e.g. within onPause() for instance. However, in a non-wakeful service, which can die at any given time, how can I assure that the LocationManager is not keeping the...

android locationlistener return null value

java,android,gps,location,illegalargumentexception
Main Java File: public class MainActivity extends Activity implements LocationListener { TextView tv; TextView tv2; TextView tv3; LocationListener locationListener; static final String tag="********MAIN********"; LocationManager lm; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); lm= (LocationManager) getSystemService(LOCATION_SERVICE); } @Override protected void onResume() { super.onResume();...

Swapping character locations in a string (bash)

string,bash,location,character,iccid
I have encountered an issue where I need to change the order of the characters in a string in bash, in order to get the ICCID of a sim card. The number I acquire from the modem looks for example like this; 980136010000006187F5. What I need to do is to...

Code reading and memory locations

java,arrays,location
short[] foo = new short[45]; assuming that a short occupies 2 bytes and that the array starts at address 5342, which locations does foo[24] occupy? If possible please show how you figure it out and individually list ALL the addresses occupied. This is not homework, i'm asking this because i...

Timeout handle email php

php,email,redirect,location,sleep
I would like to redirect my user to a new page, but the current site continues to run a script that sends a threaded message 10 minutes later at a specified address. I tried something like this: Header('Location: xy.com'); sleep(100); do_the_email_sending_here(); But actually it doesn't worked,because the site waited for...