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

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

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

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

Android Service for GPS updates
To get the instance of your service you need to bind the service with the activity. Check these links: http://developer.android.com/guide/components/bound-services.html http://dharmendra4android.blogspot.mx/2012/05/bind-service-using-ibinder-class.html If you need aditional help, plese tell me.

Categories : Android

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

How to display Service text updates on Screen in Android?
From within your service you should create a handler that can be triggered by a timer task, the handler should be the one directly responsible of doing the communication with the currently active UI thread..an example would be long delay = 3000; long period = 3000; TimerTask mDoTask = new TimerTask() { @Override public void run() { xHandler.sendMessage(Message.obtain(xHandler, SOME_OPERATION)); } }; mT.scheduleAtFixedRate(mDoTask, delay, period); Handler xHandler=new Handler(){ @Override public void handleMessage(Message message){ switch (message.what){ case SOME_OPERATION: YourMethod();// in this method you can display your text break; }

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

Frequent, periodic server-side updates to server MySQL database
i would create a cron task (on unix) or scheduled task (on windows) on the server. Have the script run every interval you require populate your db. Cron http://www.pantz.org/software/cron/croninfo.html Windows Schedule Task (obviously you'll need to find to suit your version) http://windows.microsoft.com/en-au/windows7/schedule-a-task Also, cron will only run with every minute of granularity, but i found a simple solution if your wanting to run your script with more frequency than that. #run every minute on the minute * * * * * user /path/to/executable param1 param2 #run every minute on the minute with 30sec pause before exec. * * * * * user ( sleep 30 ; /path/to/executable param1 param2 ) http://stackoverflow.com/a/9619441/1258598

Categories : Mysql

Is it possible to trigger periodic events from a WCF Service?
Not really a good way in a WCF service If the service is going to get some use you may be able to store the NextHeartBeat timestamp and every request check if it's time to send out a message to the master server.

Categories : C#

Use service to get GPS location, android?
The best way would be to use location services by CWAC Location Poller service is already made for us to use it just you have to give the time interval to wake up it Do it like dis way n you'll need the jar file which you can get it from https://www.dropbox.com/sh/pgxk2v9l5vl0h2j/3svyZnuwOK/CWAC-LocationPoller.jar From your activity start LocationPoller and set the alarm repeating to the time you want AlarmManager alarmMgr = (AlarmManager) getSystemService(ALARM_SERVICE); Intent i = new Intent(this, LocationPoller.class); Bundle bundle = new Bundle(); LocationPollerParameter parameter = new LocationPollerParameter(bundle); parameter.setIntentToBroadcastOnCompletion(new Intent(this, LocationReceiver.class)); // try GPS and fall back to NETWORK_PROVIDER parameter.setProviders(n

Categories : Android

Android Geofence Automatically removed when location service is disabled / restarted
Found this Answer::: http://developer.android.com/reference/com/google/android/gms/location/LocationClient.html In case network location provider is disabled by the user, the geofence service will stop updating, all registered geofences will be removed and an intent is generated by the provided pending intent. In this case, hasError(Intent) returns true and getErrorCode(Intent) returns GEOFENCE_NOT_AVAILABLE. Now:::: How can we register the geofence back when the location service is back.. (IN BACKGROUND)

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

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

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

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

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

Playing periodic sound accurately on Android
So you're depending on sleep being accurate. It isn't. It isn't designed to be. It will sleep for at least that time, but may sleep for more. The OS will not do a task switch back to that thread as soon as the sleep is up, but as soon as it becomes the top priority thread in its scheduling queue. You need a far more reliable way of waiting- something based on an RTC. An alarm based on the RTC alarm type might do it. I'm not sure if it actually is an RTC interrupt that will send you an immediate alarm, or if its just the relative clock it uses.

Categories : Android

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

Selecting Members Based on Chosen Service(s) Updates
Revised based on your comment below: I would probably actually consider adding the concept of service packages so you might introduce two new tables (packages and packages_to_services) The tables might have following fields packages -------- pack_id pack_name 1 Breakfast Package 2 Dinner Package 3 Towels Package 4 Taxi Package 5 All Services Package packages_to_services -------------------- pack_id ser_id 1 1 2 2 3 3 4 4 5 1 5 2 5 3 5 4 You would than change your chosen_services table to a chosen_packages table like this resort_id mem_id pack_id cancelled 2 5 5 1 2 5

Categories : PHP

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

how can i play an audio file in background using "App registers for location updates" background mode
Have you explicitly set the Audio Session category? The Audio Session Programming Guide has a useful section "Choosing the Best Category" which describes the different options: Audio Session Programming Guide I'm not in front of a Mac right now, so I can't test this. But I suspect adding the following to your viewDidLoad method might help you out when you multitask away from your app. NSError *sessionError = nil; [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&sessionError];

Categories : IOS

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 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

Android Location not returning Location from Custom Class
I'm not sure what is your problem but this is my code which is under load and fully functional. Since this class extends from Fragment then it can act as parent of your fragment. There is a listener that your class can get new location after each interval. public class LocationFinderFragment extends Fragment implements GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener { public interface OnNewLocationFoundListener { public void OnNewLocationFound(Location location); } private static final String TAG = "LocationFinderFragment"; private static final long DEFAULT_UPDATE_LOCATION_INTERVAL = 30 * 1000; // update every 30 seconds private static final long DEFAULT_TERMINATE_SAT_FINDING = 1 * 60 * 60 * 1

Categories : Java

Cant compare current location to database location android
Do not use == to compare String instead use .equal or .match Something like this : if(arlist.get(i)==Double.toString(location.getLongitude()) && arlistlat.get(i).equal(Double.toString(location.getLatitude()))){

Categories : Android

ClassCastException class extends android.location.Location
Change parameter of the constructor of ExtendedLocation to Location and remove class casting from calling this: currentGpsLocation = new ExtendedLocation(location);

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

Android location update on location change
@Override public void onLocationChanged(final Location location) { // it Returns the name of the provider that generated this fix. String locationProvider = location.getProvider() }

Categories : Android

How to distinguish between no location update and no location fix in Android?
Try using LocationClient.getLastLocation. You can store this location and check against it later.

Categories : Android

Is there a service or a procedure that can generate an IP when given a location
I have a solution for you. First, I'll highlight the high level steps. (1) Download free data that links an IP address block to a zipcode. (the reverse of what you want). (2) Simply query that database for a zipcode, and pick any IP in the "valid range" for that zipcode in the table you downloaded. So for example, you wanted a valid ip address for Chicago, IL 60657, you'd look up the valid range of IP's for 60657 and pick one! Down to specifics now... go to http://dev.maxmind.com/geoip/legacy/geolite/ scroll to the bottom and download Geolite City. This comes with two CSV's that you'll probably want to import into some sort of relational database. One table maps a location ID to a zipcode. The second table matches a location id to a valid IP range. So when you want to come up wit

Categories : PHP

Angular.js - create url using $location service
What you are looking for is $location.search() It would look something like this: $location.search({sort: 'something'}); Update based on comments According to the Developers Guide, you can use the following to read the URL: $location.absUrl(); To read the hash: $location.path(); To read the query params: $location.search();

Categories : Javascript

.NET Service Config File Location
installutil doesn't move the assembly. So if you run installutil on C:FooBarMyService.exe, it's going to read the configuration from C:FooBarMyService.exe.config. Of course, you'll have to restart the service after changing the config. Shouldn't need to reinstall it, though.

Categories : Dotnet

What happens on an android device when the app updates?
From what I could find in researching this, it seems as though the App needs to be closed in order for the files to be reachable for update. Once closed, Google Play updates only the changed pieces of the apk to save time and cost. There are several forum posts I have found that teach you how to rollback app options from flashed ROM (which happens all the time with rooted devices). Perhaps the user attempted to rollback after receiving the update. Either that, or the ID that was in the crash is referenced in part of your apk that was not updated. Sources: Notification of Update What Happens When You Update an App Google Play Saves Cost & Time

Categories : Android

Location Service [ Access ] Enable Listener
I think it is already supported through these functions when you implements LocationListener: @Override public void onProviderDisabled(String provider) { // Called when the provider is disabled by the user. If requestLocationUpdates is called on an already disabled provider, this method is called immediately. } @Override public void onProviderEnabled(String provider) { // Called when the provider is enabled by the user. } @Override public void onStatusChanged(String provider, int status, Bundle extras) { // Called when the provider status changes. This method is called when a provider is unable to fetch a location or if the provider has recently become available after a period of unavailability. } You just need to use these to keep track of the

Categories : Java

Location finder in service blocked by semaphore?
I think getting a tumbleweed badge is a very dubious honor, but here is the answer: Yes, the .acquire() call blocks the thread, and the onLocationChanged() method is not called. The solution is to have a handler run a runnable, such as: public void onLocationChanged(Location location) { xxxService.locHandler.post(xxxService.locationRun); } where Runnable locationRun = new Runnable() { @Override public void run() { // handle stuff for new location } }; The general principle is that you send and handle events, rather than running a polling loop. If you need to handle a non-event, e.g. no new location read, then you set up a countdown timer.

Categories : Android



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