WorldMap is a simple Android app that displays a map of the world taken from Wikimedia (<a href="https://www.google.com/url?q=https://www.google.com/url?q%3Dhttp://upload.wikimedia.org/wikipedia/commons/3/33/Physical_Political_World_Map.jpg%26sa%3DD%26usg%3DAFQjCNESDnrJcwHkkYFkffDlskDAGnZFZQ&sa=D&usg=AFQjCNEdpjjdY_xocUkn9ZPReqXUT5dyaA" target="_blank">http://upload.wikimedia.org/wikipedia/commons/3/33/Physical_Political_World_Map.jpg</a>), and allows the user to scroll around on it.
The map itself is quite large (6480,3888), so it's way too big to fit in memory all at once (6480 x 3888 x 32 / 8) = 100,776,960 -- over 96 megs. The VM heap size Android supports is eith 16 or 24 megs, so we can't fit the whole thing in memory at once.
So WorldMap uses the BitmapRegionDecoder API (available as of API 10) to decode just what it needs to display.
WorldMap is open source, and the source code is here: <a href="https://www.google.com/url?q=https://www.google.com/url?q%3Dhttps://github.com/johnnylambada/WorldMap%26sa%3DD%26usg%3DAFQjCNFjTDyRNkPbqRdFcLUv6DO96-S7FQ&sa=D&usg=AFQjCNH_CItSqJyXiaP7uQUoLHmCI1g5wA" target="_blank">https://github.com/johnnylambada/WorldMap</a>
</div> <div jsname="WJz9Hc" style="display:none">Dünya haritası Wikimedia (<a href="https://www.google.com/url?q=http://upload.wikimedia.org/wikipedia/commons/3/33/Physical_Political_World_Map.jpg&sa=D&usg=AFQjCNESDnrJcwHkkYFkffDlskDAGnZFZQ" target="_blank">http://upload.wikimedia.org/wikipedia/commons/3/33/Physical_Political_World_Map.jpg</a>) alınan dünya haritası görüntüleyen basit bir Android uygulaması ve kullanıcı etrafında kaydırma sağlar.
Harita kendisi (6480,3888) oldukça büyük, bu nedenle tüm (6480 x 3888 x 32/8) = 100.776.960 bellekte aynı anda sığmayacak kadar büyük bir şekilde var - 96 üzerinde meg. VM yığın boyutu Android destekler eith 16 veya 24 meg, bu yüzden bellekte aynı anda her şeyi sığamaz.
Bu yüzden Dünya haritası görüntülemek için ihtiyacı olan şey çözmek için BitmapRegionDecoder API (API 10 olarak mevcuttur) kullanır.
Dünya haritası açık kaynak ve kaynak kodu burada: <a href="https://www.google.com/url?q=https://github.com/johnnylambada/WorldMap&sa=D&usg=AFQjCNFjTDyRNkPbqRdFcLUv6DO96-S7FQ" target="_blank">https://github.com/johnnylambada/WorldMap</a></div> <div class="show-more-end">