title: OSMdroid mapview degrades android app performance
body: <p>I'm current using <strong>OSMdroid</strong> for offline maps rendering. Although there are some issues with tile loading every now and then for offline maps in osmdroid, I'm fine with it. But in my android app, I see when I test my <strong>map</strong> by just zooming in and zooming out multiple times, my app responds very slowly gradually over the time. I'm not sure what exactly might be the problem. Is this the issue with <strong>OSMdroid</strong> or my app, i'm unable to find out.</p>
  
  <p>I have a fragment class which loads the mapoffline activity.</p>
  
  <pre><code>public class MapActivityFragment extends Fragment{
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
  
              Bundle savedInstanceState) {
  
           View rootView = inflater.inflate(R.layout.map_view, container, false);
          /*Create my offline MapView*/
          oMapViewOffline     = new MapViewOffline(mapView);
          oMapViewOffline.run();
          return rootView;
  
      }
  </code></pre>
  
  <p>In my <strong>MapViewOffline.java</strong></p>
  
  <pre><code>public void run(){
  
          /*Get custom Tile data*/
          MapTilerCustomDataSource myNewXYTileSource = new MapTilerCustomDataSource();
          myNewXYTileSource.isSourceTMS = true;
          mMapViewOSM.setTileSource(myNewXYTileSource);
          mMapViewOSM.setUseDataConnection(false);
      }
  </code></pre>
  
  <p>My MapTilerCustomDataSource is based on: <a href="https://stackoverflow.com/questions/7634148/osmdroid-how-to-load-offline-map-from-zip-archive-maptilefilearchiveprovider">OSMdroid : How to load offline map from zip archive - MapTileFileArchiveProvider</a></p>
  
  <p>The biggest deal is not just loading of my offline maps, I'm running a expensive <strong>AsyncTask</strong> as well.</p>
  
  <p>What it does is read data from server and draws markers accordingly on mapview. This again is degrading my performance.</p>
  
  <pre><code>@Override
  protected Void doInBackground(Void... arg0) {
        while(true){
            Shadow = new CustomOverlay(getApplicationContext());
            Shadow.getData();
            try {
          Thread.sleep(1000);
            } catch (InterruptedException e) {
          e.printStackTrace();
          }
          publishProgress();
          mCount++;
       }
  }
  
  @Override
  protected void onProgressUpdate(Void... progress){
       Shadow.runDrawing();
       listOfSensorOverlays.add(Shadow);
       mapView.invalidate();
  }
  </code></pre>
  
  <p>How can I make my android app perform better? What might be the reasons that is causing the degrade in performance; Is it the osmdroid or the <strong>Async Task</strong>?</p>