w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Google location service updates ignoring location listener (android)
Typically right before I call and use GoogleMap I instantiate the supportfragmentmanager then use this to instantiate the map. Like below I hope this helps. lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); SupportMapFragment mf= (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); map = mf.getMap(); //map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); ll = new SecondPointLocationListener(); As far as your method for printing the location use this instead... @Override public void onConnected(Bundle arg0) { Toast.makeText(context, "GPS connected", Toast.LENGTH_SHORT).show(); connector = new Connector(); connector.execute("clues", null, null); listener = new LocationListener()

Categories : Android

Google location API: request location updates with pending intent?
You can either register Broardcast Reciever or Activity through pending intent.Sample Example for registering boardcast reciever: String proximitys = "ACTION"; IntentFilter filter = new IntentFilter(proximitys); registerReceiver(mybroadcast, filter); Intent intent = new Intent(proximitys); PendingIntent proximityIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT); locationManager.requestLocationUpdates(provider, mintime, mindistance, proximityIntent); Your Broardcast Reciever: public class ProximityIntentReceiver extends BroadcastReceiver { @SuppressWarnings("deprecation") @Override public void onReceive(Context arg0, Intent intent) { //action to be performed }

Categories : Android

Check if Location is unavailable in Android Location Client
AFAIK, there is no method to check availability. Possible Reason: LocationClient uses fused API which gives location with appropriate combination of GPS,WiFi,Cell,Sensors (according to the Priority you have set for retrieving location). Reference: Fused API - Beyond the blue dot Alternate Solution: You already know it.you can check availability of provider by using location system service and LocationManager

Categories : Android

How to Reconnect the location client(Fused location) in onActivityResult
You have to invoke : if (!mLocationClient.isConnected()) { mLocationClient.connect(); } and then wait connection is done in : @Override public void onConnected(Bundle connectionHint) { startPeriodicUpdates(); }

Categories : Android

Android Google Maps location without GPS vs location retrieved from LocationManager with network provider
i found an article from google for this topic. It supplies at least some indication how they do it. https://developers.google.com/maps/articles/geolocation

Categories : Android

Android Location Client not as Accurate as Google Maps App
When using the method 'getLastLocation()', it offers the best last known location stored by the Location. It is also in respect to what level of permission you have given the app in the manifest file. Try using both: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> in your manifest file and see if it improves the accuracy.

Categories : Android

Google maps API - Center map on client's current location
Try using the below code to get the user's current location (GEOLOCATION): if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (position) { initialLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); map.setCenter(initialLocation); }); } For showing an example, I've removed your php code. Check this JSFiddle Hope you understand.

Categories : Javascript

How to know the source Provider from Location using Google Location Services
The Google Play Location API does not provide a way to determine the source provider as it functions as a Fused Location Provider: The Fused Location Provider intelligently manages the underlying location technology and gives you the best location according to your needs. The location returned may be a combination of cellular, WiFi, GPS, and/or sensor data.

Categories : Android

No Location Bearing when using Google Play Location Services?
This code is functional it is just not the correct way to get compass bearing data. After taking the app outdoors and getting a GPS fix I was able to get new readings. I have since re-read the documentation and have realised the bearing on location is not a compass bearing (i.e. north is not 0.0) but the horizontal direction of travel.

Categories : Android

The Geocoding api returns a wrong location for a pincode, but Google maps returns right location
Geocoding and working with real-world data is hard, and not even the great Google (no sarcasm, I'm a fan) gets it right all the time. Apparently there is a software or data bug in the Google API, since this works (added Country India to the component filter): http://maps.google.com/maps/api/geocode/json?components=postal_code:400001%7Ccountry:IN&sensor=false But this does not, and is not even filtering by country because it still returns Chinese results: http://maps.google.com/maps/api/geocode/json?components=postal_code:400036%7Ccountry:IN&sensor=false If you're a paying customer, you can contact Google for support here: http://www.google.com/enterprise/portal

Categories : Api

Google Location Services getBestProvider will return null even though all location services are enabled
Try to use this instread of locationmanager.getBestProvider() and see if it works for now: String locationProvider = LocationManager.NETWORK_PROVIDER; Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider); Also, if you pass false into getBestProvider() it will return the best Provider regardless if it is turned on or not, it will only depend on your Criteria, so it may return null if,for example, you didn't manually enable your GPS. You may want to check this link: http://developer.android.com/reference/android/location/LocationManager.html#getBestProvider(android.location.Criteria, boolean)

Categories : Android

location updates through 3g
To retrieve the location from a NETWORK_PROVIDER you can use the following: LocationListener locationListenerNetwork = new LocationListener() { public void onLocationChanged(Location location) { timer1.cancel(); locationResult.gotLocation(location); lm.removeUpdates(this); lm.removeUpdates(locationListenerGps); } public void onProviderDisabled(String provider) {} public void onProviderEnabled(String provider) {} public void onStatusChanged(String provider, int status, Bundle extras) {} }; LocationManager lm; if(lm==null) lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); This is however a basic example, so to distinguish between the wi-fi and the 3g network first take a look here and before the code above do:

Categories : Android

iOS background location updates
Varun welcome to SO community. Here is some lines from docs Any app that requests background location services should use those services to provide a tangible benefit to the user. For example, a turn-by-turn navigation app would be a likely candidate for background location services because of its need to track the user’s position and report when it is time to make the next turn. So if you are using standard location service and whenever you get updates and you are not doing anything with that update (in terms of user not coding) then there are very high chances that Apple may reject your app, which they already did. So what's the solution then? 1. Answer is try submitting the app with other approach. 2. Try submitting the app with other name :D Solution Number 1. Instead of using s

Categories : Iphone

Toggling location updates from intentservice
I found my problem. When I start request location updates I needed to register it like so. pinger.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 10, reciever, getMainLooper());

Categories : Android

Not receiving Location Updates in Android
You can find a working example here. It is not calculating the distance, but this should be easy to add.

Categories : Java

LocationListener stopped to receive the location updates
I suggest you Use Log.d(...) to check both locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) and locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)Also use Log.d(...) to capture all calls to onProviderDisabled(...), onProviderEnabled(...) and onStatusChanged(...).I'd expect that the resulting output will allow you to solve your problem.

Categories : Android

Location Updates in Android requestLocationUpdates method
My understanding is that requestLocationUpdates actually makes the request to the provider to send for an updated location? Yes. Why then are we passing a LocationListener callback to a request? How else were you planning on getting the updates? There's a PendingIntent flavor of requestLocationUpdates() if you would prefer it. Seems like the entire point of a LocationListener is to pick up changes in the location when the location provider decides it is time to update. Correct. So is the requestLocationUpdates a search function to see if the providers have looked for and found a new location No. is it an actual request that triggers the providers into activity that actively looks for a new location? Yes. Bear in mind that GPS, in particular, is powered down un

Categories : Java

angularjs $location.path only updates URL on second click
setTimeout() doesn't mix well with Angular (Angular uses an event loop in which it checks for changes to models, but to be able to do that it has to be able to control all parts of your app; setTimeout() is beyond the control of Angular, and when any changes to Angular-parts of your app are made in a setTimeout-handler, it usually takes another 'round' of the Angular event loop before those changes are picked up). If you replace it with Angular's own $timeout() (be sure to also inject it), it works better (jsfiddle).

Categories : Angularjs

Can't receive LocationClient's location updates after screen gone off
I'm not sure where your problem is. I've made a project with your code and it seems to be working as desired here. I received updates even when the screen was off. In any case here are the steps that I took, perhaps your problem isn't in the service, but in how you start it, or somewhere else: I created a default android project with a single main activity. I included your code in a separate file named "LocationService" I added the google play service library to the project. I added the following permissions to the manifest: < uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> < uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> and in the application tag I declared the service: <service android:name=".LocationServic

Categories : Android

Network provider not providing location updates
For network based location, they are a lot less inaccurate than GPS, meaning you need to move the device a much larger distance to allow the signal to hook on to another network tower before onLocationChanged() is called. Also not all network towers provide location.

Categories : Android

Filter location updates when using LocationManager requestLocationUpdates method
It's not needed. However, I also encourage you to look at the new Location Services APIs offered in Google Play Services (http://developer.android.com/google/play-services/location.html)

Categories : Java

Android locationClient returning null, location updates non-responsive
The Google Maps app uses both the GPS and network positioning. Using the GPS, it is normal that the first fix gets some time to arrive. Also, it works well outside, and quite badly inside. (Also, make sure GPS is enabled) This code works for me: public class MainActivity extends Activity implements LocationListener { private LocationManager locationManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { // GPS is disabled } } @Override protected void onStart() {

Categories : Android

Get location updates in GMSMapView without showing myLocation blue dot annotation
According to the Google Maps iOS documentation: myLocationEnabled: Controls whether the My Location dot and accuracy circle is enabled. myLocation: If My Location is enabled, reveals where the user location dot is being drawn. So, setting: _googleMapView.myLocationEnabled = NO; (CLLocation*) myLocation [read, assign]: If My Location is enabled, reveals where the user location dot is being drawn. If it is disabled, or it is enabled but no location data is available, this will be nil. This property is observable using KVO. Should allow you to access the location without having the blue dot appear.

Categories : Iphone

Avoid ng-view getting "wiped" (updated) when $location.search updates GET params
This is because updating the URL params triggers the route again and this is causing the controller to be reloaded. There is a simple fix for this. Use the property reloadOnSearch and set it to false. This will not reload the controller when the $location.search() changes $routeProvider .when('/', { templateUrl: 'views/map.html', controller: 'MapCtrl', reloadOnSearch: false }) .otherwise({ redirectTo: '/', controller: 'MapCtrl', reloadOnSearch: false }); });

Categories : Angularjs

Why Android LocationManager has long delay before location updates start if setting accuracy
I suspect that at least with ACCURACY_FINE, it's waiting to get an initial GPS fix. You may find that if you've already got GPS turned on for another reason (e.g. if you're in the middle of navigation) that it starts reporting immediately. It can take a while to get a GPS fix - I think it's just a natural part of how GPS works.

Categories : Java

PowerShell script to copy two files from a static location to a location with two variables in the in path
First of all create CSV with structure like below (users.csv): Name,Sip login1,login1@gmail.com The run following statement: Import-Csv C:PATH_TO_CSVusers.csv | foreach{cp C:YOUR_PATHYOUR_FILE ("C:Users"+$_.Name+"AppDataLocalMicrosoftCommunicator"+$_.Sip)} Update Script for run for current user: $userName = [Environment]::UserName; $domain = [Environment]::UserDomainName; # Look for a user $Rech = new-object System.DirectoryServices.DirectorySearcher $rc = $Rech.filter = "((sAMAccountName=$userName))" $rc = $Rech.SearchScope = "subtree" $rc = $Rech.PropertiesToLoad.Add("mail"); $rc = $Rech.PropertiesToLoad.Add("msRTCSIP-PrimaryUserAddress"); $theUser = $Rech.FindOne() Write-host "Username is" $userName Write-host "Domain is" $domain if ($theUser -ne $null) { Write-Host "Mail is"

Categories : Powershell

On setting iOS simulator default location from Edit Scheme, does it affect the device location update?
Yes, its affecting the device location as well, i verified with https://developer.apple.com/library/ios/samplecode/LocateMe/Introduction/Intro.html when i simulator it on the device it still give the same location which is configured by Scheme > Edit Scheme > Options > Allow Location Simulation not the actual location of device.

Categories : IOS

Why is "Your location approximate location (network-based)" being added as a permission even though I havent declared it in the manifest?
as stated in the questions comments, here is the solution: see http://swarmconnect.com/admin/docs/faq -> that's the cause for your permissions. for the merging problem, look up your .project.properties in eclipse, if manifestmerger.enabled=true is set, that could be the cause of the merge (like mentioned here: Library Project does the manifest file merge?

Categories : Android

Methods for giving best estimate of Location from three Android location providers
//declare constants // The minimum distance to change Updates in meters private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 20; // 10 meters // The minimum time between updates in milliseconds private static final long MIN_TIME_BW_UPDATES = 2000 * 60 * 1; // 1 minute public void getlocation() { locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); // Define the criteria how to select the locatioin provider Criteria criteria = new Criteria(); provider = locationManager.getBestProvider(criteria, false); locationManager.requestLocationUpdates(provider, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this); if (locationManager != null) { Location location = locationManager.getLastKnownLocatio

Categories : Java

How can I move the detail disclosure of a cell from the default location to another location?
Create a custom cell by overriding UITableViewCell, you haven't done this yet, and poste the method below in your implementation file. -(void)layoutSubviews { [super layoutSubviews]; for (UIView *subview in self.subviews) { if ([NSStringFromClass([subview class]) isEqualToString:@"UIButton"]) { //Just an example, change the frame by your wish here. CGRect newFrame = subview.frame; newFrame.origin.y -= 15; subview.frame = newFrame; } } } This approach can be used to edit any default components of TableViewCell, like the disclosure, the delete button when editing, etc. And will not mess with the views that you put inside your cell, because all your manual added views are really inside the contentView propert

Categories : Iphone

Different GPS Location Reading Of Same Physical Location on Windows Phone GeoCoordinateWatcher
This shows a really bad GPS device. You get a jump of 570m, this should never be the case for GPS signals. Make sure that the location was got only from GPS (on android and ios if you do not care, positions may also come from cell Tower of wifi location service). Check also the timestamp of the first location, and compare it with system time, just to make sure it is not an old location which was cached. It is normal for GPS when you are standing that coordinates move up to 30m. Therfore some smartphone manufacteres enables a "stand still" filter. It seems that you have to write your own "stand still" filter. Simplest is to read the location.getSpeed(): if it is more then 5km/h take the position, otherwise ignore it. (This works well for vehicles but not for walking) And also important,

Categories : C#

Zoom to users location after showing a specific location MKMapkit?
If you want to perform some action after a certain amount of time, you can use the GCD dispatch_after: double delayInSeconds = 0.5; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ [_mapView setRegion:viewRegion animated:YES]; });

Categories : IOS

How to gracefully redirect ember hash location to history location
I would recommend doing this client-side. Add something like this to your app: App = Ember.Application.create({ ready: function() { if (location.hash) { //map known hash values to urls, redirect as needed... } } });

Categories : Ruby On Rails

Application doesn't launch with location key after a significant location change
I have the same problem in my app, when the app was terminated by user from app switcher. But it does launch with location key if it was terminated by OS for low memory or other reason. It is the expected result from iOS7 unfortunately. An official apple response I got from one of their evangelists: If a user swipes up in the app switcher then the OS will not launch the app unless explicitly told to do so by the user. So no, SLC will not be launching the app, nor will silent notifications. The only thing that will launch the app at that point is the user tapping the icon. The intention here is that the user has expressed their choice of not having that app running any more for any reason, so we honor that. In this situation, there's really nothing that you can do. The

Categories : Iphone

What is proper way to get ETA (estimated time arrival) from any location to my current location
I know this post is a bit old but in case someone is looking at the answer since iOS 7 Apple provide an API in MapKit in order to calculate all these info. Here is a snippet of how to use this API MKDirectionsRequest *request = [[MKDirectionsRequest alloc] init]; [request setSource:[MKMapItem mapItemForCurrentLocation]]; [request setDestination:destination]; [request setTransportType:MKDirectionsTransportTypeAutomobile]; [request setRequestsAlternateRoutes:NO]; MKDirections *directions = [[MKDirections alloc] initWithRequest:request]; [directions calculateDirectionsWithCompletionHandler:^(MKDirectionsResponse *response, NSError *error) { if ( ! error && [response routes] > 0) { MKRoute *route = [[response routes] objectAtIndex:0]

Categories : IOS

Find location source using Fused Location Provider
No, Fused location provider: The Fused Location Provider intelligently manages the underlying location technology and gives you the best location according to your needs. It may use combo of that data.

Categories : Android

How to get location names nearby my current location using api v2 in android
REQUEST_DENIED means you are using wrong key. Enable Places API and then try. Also you can use Browser Key after you enable Places API

Categories : Android

Output jbehave report to a different location other than code location
Try using the CodeLocations class to generate the URL; .useStoryReporterBuilder(new StoryReporterBuilder() .withCodeLocation(CodeLocations.codeLocationFromPath("D:\abc")) ... I also replaced the slash with a backslash in the path.

Categories : Java

point a windows 8 app towards a certain location relative to the tablet's location
Here is the link for the geolocation sample in Windows 8: Windows 8 Geolocation Sample You can check the samples in C#, JavaScript, and C++. Below is the specific part where it shows the latitude and longitude in JavaScript. You can find the corresponding in C++/C# by browsing through the code samples: JavaScript function getPositionHandler(pos) { document.getElementById('latitude').innerHTML = pos.coordinate.latitude; document.getElementById('longitude').innerHTML = pos.coordinate.longitude; document.getElementById('accuracy').innerHTML = pos.coordinate.accuracy; document.getElementById('geolocatorStatus').innerHTML = getStatusString(loc.locationStatus); } Regarding location of Trafalgar Square, I'm sure Bing Maps API or Google Maps API, or any Maps API will h

Categories : Javascript

Prevent fake location on iPhone : Location spoofing
I'm working on this too, where the phone sends the lonlat to a server, and I want to prevent people just POSTing any lonlat they choose (e.g. via curl). One idea is to also submit the available Wifi SSIDs along with the location, and if someone claims a location with an SSID list that differs substantially from others', flag that submission for review. Unfortunately iOS doesn't give you a way to obtain the list of available SSIDs. . . .

Categories : Iphone



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.