what are the possibilities to add markers dynamically depending on the area of the map which is shown?
I have a lot of markers or let´s say my markers need a lot of performance to be rendered, cause they are custom. I implemented it now, that only 40 markers are drawn when a "camerachange" was fired. So at this time i always render 40 new markers when cameraposition was changed.
I read about runnable and handler, are their more options? Does someone know which of these possibilities is the best, so that ui-thread isn´t blocked?
I would suggest using one of clustering libraries available for Google Maps Android API v2.
Android Maps Extensions apart from clustering can do a lot of work for you. The API is very similar to official Google library.
If you don't want to use clustering at all, you can still achieve your goal with:
map.setClustering(new ClusteringSettings() .enabled(false) .addMarkersDynamically(true)); // I didn't change the API to match your title ;)
Clusterkraf mainly focuses on animated clustering.
If you want to code it yourself, I can suggest these approaches:
Markers only in
VisibleRegion(same thing Android Maps Extensions does when using code above), example from my demo project here: AddOnlyVisibleMarkersExampleActivity.java
Handler, example here: AddMarkersInBackgroundExampleActivity.java