I recently started to see this logs I/Counters: exceeded sample count in FrameTime multiple times in my app logcat, I understood it comes from Google Maps.
Any idea what it means? and how to get rid of it?
Try disabling a few layers of the widget (like say 'myLocation' layer enabled by using 'myLocationEnabled' parameter) and enable them back in the release build. Also make sure you are disposing your Google Maps Controller in the dispose method (if you are storing it somewhere after taking it from onMapCreated).
As far as I can figure out from the error and the API docs, GoogleMaps has multiple layers and each layer needs to be built in a given FrameTime. Since the added burden of multiple layers slow down the processing, it may exceed given FrameTime and trigger the error.
The reason may also include the fact that debug builds have no optimisations and that really affects the GoogleMaps package. I tried the same app with the constant barrage of 'I/Counters: exceeded sample count in FrameTime' errors in release build on a real device and the errors seem to not appear, implying these errors can simply be ignored.
While we wait for a fix you can set these to fold (in Android Studio) by going to File->Setting->Editor->General->Console and adding "exceeded sample count in FrameTime" to the list "Fold console lines that contain:"
I had the same issue since this morning, it was gone when after I:
stopped my emulator
wiped the data
cold booted it.
NOTE: this is with android
For Android emulators it's enough to wipe the data of the device and the FrameTime messages will go away.
EDIT: Sadly, this isn't a permanent solution as messages will start appearing after re-opning the emulator. I will be back with another update if I stumble upon a permanent fix.
I had a similar issue, for me I had setup a location listener:
location.onLocationChanged.listen(l) {
controller.animateCamera(...);
}
This appeared to be called even though the phone location had not changed, so I added a check to store the previous known location and in the listen, I compared the streamData with my location and only performed the update if there was a change.
Perhaps you can post your code to see if this could be the reason?
It's happening inside onLocationChanged method.
When I set isMyLocationEnabled to false at some extent it was removed but fully, now there were lesser log statement.
It happens when the map moves (or probably more specifically when it is redrawn). Both when animating, and also when manually sliding it around. My logcat is spammed full of Counters: exceeded sample count in FrameTime messages. This explains why you'll see less when not having my location enabled: The map doesn't move as much...
It's so annoying.
For flutter: I was using setState() method with a google map and there was also a locationListener(). So I removed the setState() and instead I did update my screen using provider. And the warnings were gone.
Related
I am using the HERE Android SDK embedded in a QT application, and am trying to do turn by turn directions simulated, but without a map display. There is no Map or MapFragment in my app, I'm using the MapEngine and NavigationManager directly. And I am initializing the map engine on the main UI thread, as that is recommended (not sure if that could be an issue here).
I am able to initialize the map engine, create the route and dump it successfully. However, when I use NavigationManager to simulate the route, I can see navigation movement (the coordinates in position updates progressing). However, I have ManeuverEventListeners and NewInstructionEventListeners, and they are never called.
And in my position listener, if I call getNextManeuverDistance() or getETA() I get error responses. All other functions had success, and the simulated navigation will complete eventually (at the expected time) but without ever delivering any instructions.
I have the same code working fine in a sample app, but running in the QT framework I'm never getting valid distances or maneuvers. In the API reference it says getNextManeuver() will return null (and get distance returns MAX_INT) if the next maneuver is not available yet. What can be causing this?
Is it valid to run this in an app without a Map nor a MapFragment? Any ideas why NavigateManager simulate would act this way?
Yes, I eventually figured out that the map data must be manually preloaded. Seems that calculating the route is not enough, and the data fetching is normally done by the map view, and the navigation manager is just waiting for the map data.
In my case, as soon as I have a calculated route I start the mMapDataPrefetcher.fetchMapData(route,radius), and then immediately start the mNavigationManager.simulate(route,speed). The navigation is a little wonky until the map data is loaded, but starts responding immediately after the map loading is complete. The loading can be slow in some of my testing, not sure why. But in frequent uses, the map data is often already present, so works better in that case.
I'm not sure what a good radius is; I tried 500m and the call failed; 2000m is working for me right now.
See the pages here:
https://developer.here.com/documentation/android-premium/topics/map-data.html
https://developer.here.com/documentation/android-premium/topics/maps-offline.html
These features are described as beta, so I'm not sure if there is any way to do this in a supported, production fashion.
This is the call that I make:
https://maps.googleapis.com/maps/api/directions/json?alternatives=true&key=my_key&origin=52.370060,4.925040&destination=52.37913,4.90027&departure_time=1518168706&mode=transit
I This route, which should have atleast 3 metro's and some buses in between them, should find me results.
This is what I send as the departure_time to get that value:
(System.currentTimeMillis() / 1000
And sometimes it works, sometimes no. I tried using the same + 30 (adding 30 seconds to current time) but, again, sometimes I get results, sometimes just ZERO_RESULTS. Why?
I noticed that if I set the time to 5 minutes in the past, it works. but I need it to start at this moment. This makes no sense, why would the call return me results for the past, but not future, for planning
I am afraid your questions is a bit broad since the understanding of how google works internally is a mistery for most mortals, but there is a few cases where you can have zero_results.
The first one is that you use times that are already in the pasts. so always make sure the epoch time you use has not already passed.
Another could be that in the moment you requested the directions, there are no posible routes for your desire destinations, since google collects data from other sources like Live Traffic(for driving), etc.
What I found is that if this issue persist (that you keep getting zero_results) for a specific directions could be actually a Bug of the API, and you can report it in the issue tracker https://issuetracker.google.com/ since I found reported/accepted Bugs (like https://issuetracker.google.com/issues/63884989) related with your issue.
If I found more info I will update this answer.
I'm using HERE SDK trial and I want to ask that RealisticViewListener and LaneInformationListener works with trial license? Because I have registered listeners but I don't get any event.
navigationManager.addLaneInformationListener(new WeakReference<>(laneInformationListener));
navigationManager.setRealisticViewMode(NavigationManager.RealisticViewMode.DAY);
navigationManager.addRealisticViewAspectRatio(NavigationManager.AspectRatio.AR_4x3);
navigationManager.addRealisticViewListener(new WeakReference<NavigationManager.RealisticViewListener>(realisticViewListener));
Both features are available in the trial (as well as all other features). Your implementation looks correct, but it will be hard to determine where things go wrong without seeing more code.
Also, please be aware that in rare cases there is simply no lane- or signposts information available, e.g. the callback only occurs when the user has arrived at a point in the route where lane information is available such as before a highway exit.
I suggest to try out the SDK navigation example on GitHub and hook your listeners in from there to see how it works. You can also start navigation simulation (if you are unsure if your local area has enough data):
// if user wants to start simulation, submit calculated route
// and a simulation speed in meters per second
error = navigationManager.simulate(route, 60);
I am developing an Android application using skobbler/telenav SDK also known as SKMaps. I am currently implementing a simple gps navigation system using SKRouteManager and SKNavigation manager and the corresponding Listeners. So far I have been able to set the destination for my navigation by geocoding postcodes into gps locations using the google api. I also have alternative routes and the onReRoutingStarted() event of the SKNavigationListener is working right. However, I have a problem with onDestinationReached() - it seems like it does not get called when I reach my destination so my navigation does not stop. So if I keep driving and pass the destination point the app starts rerouting me again. Is there an issue with the onDestinationReached() or any special requirements when implementing it?
I thought it should work because it successfully calculates the route in the first place so it should know the destination point and I shouldnt have to specify it in any other way. But the method does not get called by the app when I reach the end of the route.
I have also encountered another issue with the SKNavigationListener events - onUpdateNavigationState(SKNavigationState navigationState). Inside the method I am trying to obtain some of the information the SKNavigationState object should be able to provide me with. The problems are as follows:
Eclipse cannot recognise the method getDistanceToDestination() - acts as if it is not defined inside the class SKNavigationState.
getCurrentAdviceCurrentStreetName() returns null
As far as I understand getCurrentAdviceDistanceToAdvice() should give me the distance to the point where I will receive another advice and getCurrentAdviceDistanceToDestination() should give me the remaining distance to the end point of the route. Both methods are supposed to return the distance in meters but they provide me with some really large numbers (more than a billion) when my route is only 5 kilometers long. Also, sometimes they return 0.
The onUpdateNavigationState(SKNavigationState navigation state) is supposed to get called multiple times while following the route and every time provide me with new information about the state of my navigation. It does get called multiple times but when I use the above methods they keep returning the same values (if I restart the application the values change but during a single test they give me the same values).
If anyone has any clue what could be going wrong. It is really confusing because I can successfully get the current speed from the SKNavigationState object using getCurrentSpeed(). But somehow some of the methods seem to not exist and others return values that dont make sense.
This issue was a bug on the 2.0.2 SDK version - it was fixed in vs 2.1.0 (which should be out on the 30'th of June 2014)
I've searched through a number of the questions and answers in regards to the LocPoller from Commonsware and haven't found the answer to my problem. I have tried using the demo of the latest from github and I'm having issues. First I must admit that I modified the PERIOD in the demo so the alarm fires every 15 seconds. I realize this will be a large drain on the batter and it's just for testing. I would expect that the LocationReceiver's onReceive() would be called ever 15 seconds but that isn't happening.
Debugging things I see that the alarm is triggering and everything seems good in that it's getting to the PollerThread and calling sendBroadcast. So I assume I have something setup wrong, but I'm not sure what. Other than changing the PERIOD in the demo everything else is as is. I've tried running this on a device and emulator (Level 8). Any help in debugging this would be appreciated.
In the end the functionality I'm looking for is to have the ability to keep track of a phones location so at any point my app can get the current location. I saw this in my research and though it fit the bill perfect. If someone has a better idea of different approach I'd love to hear it.
Thanks,
Rindress
In the end the functionality I'm looking for is to have the ability to keep track of a phones location so at any point my app can get the current location. I saw this in my research and though it fit the bill perfect.
No, it is not.
If someone has a better idea of different approach I'd love to hear it.
Step #1: Call requestLocationUpdates() when you want to start receiving location updates in your app
Step #2: Use the location fixes delivered to your LocationListener, or call getLastKnownLocation(), as needed
Step #3: Call removeUpdates() when you no longer want to receive location updates in your app