WorldMap is a simple Android app that displays a map of the world taken from Wikimedia (http://upload.wikimedia.org/wikipedia/commons/3/33/Physical_Political_World_Map.jpg), 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:https://github.com/johnnylambada/WorldMapWorldMap ist ein einfaches Android App, die eine Karte der Welt von Wikimedia (http://upload.wikimedia.org/wikipedia/commons/3/33/Physical_Political_World_Map.jpg) genommen wird, und ermöglicht es dem Benutzer zu blättern um auf sie.
Die Karte selbst ist recht groß (6480,3888), so ist es viel zu groß, um im Speicher auf einmal (6480 x 3888 x 32/8) = 100776960 passen - über 96 Megabyte. Die VM-Heap-Größe Android Stützen ist eith 16 oder 24 Megabyte, so können wir nicht in das Ganze auf einmal im Speicher.
So nutzt die WorldMap BitmapRegionDecoder API (verfügbar ab API 10) zu dekodieren, was es braucht, um anzuzeigen.
WorldMap ist Open Source und der Quellcode ist hier:https://github.com/johnnylambada/WorldMap