OsmAnd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
net.osmand.plus.ResourceManager Class Reference

List of all members.

Public Member Functions

 ResourceManager (OsmandApplication context)
MapTileDownloader getMapTileDownloader ()
void resetStoreDirectory ()
OsmandApplication getContext ()
void indexingImageTiles (IProgress progress)
Bitmap getTileImageForMapAsync (String file, ITileSource map, int x, int y, int zoom, boolean loadFromInternetIfNeeded)
Bitmap getTileImageFromCache (String file)
Bitmap getTileImageForMapSync (String file, ITileSource map, int x, int y, int zoom, boolean loadFromInternetIfNeeded)
void tileDownloaded (DownloadRequest request)
synchronized boolean tileExistOnFileSystem (String file, ITileSource map, int x, int y, int zoom)
void clearTileImageForMap (String file, ITileSource map, int x, int y, int zoom)
synchronized String calculateTileId (ITileSource map, int x, int y, int zoom)
List< String > reloadIndexes (IProgress progress)
List< String > indexingMaps (final IProgress progress)
AmenityIndexRepositoryOdb getUpdatablePoiDb ()
void indexingPoi (final IProgress progress, List< String > warnings, File f)
void updateIndexLastDateModified (File f)
List< Amenity > searchAmenities (PoiFilter filter, double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, double lat, double lon, ResultMatcher< Amenity > matcher)
boolean containsAmenityRepositoryToSearch (boolean searchByName)
List< Amenity > searchAmenitiesByName (String searchQuery, double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, double lat, double lon, ResultMatcher< Amenity > matcher)
Map< AmenityType, List< String > > searchAmenityCategoriesByName (String searchQuery, double lat, double lon)
void searchAmenitiesAsync (double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, PoiFilter filter, List< Amenity > toFill)
RegionAddressRepository getRegionRepository (String name)
Collection
< RegionAddressRepository
getAddressRepositories ()
List< TransportIndexRepositorysearchTransportRepositories (double latitude, double longitude)
void searchTransportAsync (double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, List< TransportStop > toFill)
boolean updateRenderedMapNeeded (RotatedTileBox rotatedTileBox, DrawSettings drawSettings)
void updateRendererMap (RotatedTileBox rotatedTileBox)
void interruptRendering ()
MapRenderRepositories getRenderer ()
void closeAmenities ()
void closeAddresses ()
void closeTransport ()
BusyIndicator getBusyIndicator ()
synchronized void setBusyIndicator (BusyIndicator busyIndicator)
synchronized void close ()
BinaryMapIndexReader[] getRoutingMapFiles ()
void closeRouteFiles ()
Map< String, String > getIndexFileNames ()
Map< String, String > getBackupIndexes (Map< String, String > map)
synchronized void reloadTilesFromFS ()
void onLowMemory ()
 On low memory method ///.

Public Attributes

final AsyncLoadingThread asyncLoadingThread = new AsyncLoadingThread(this)

Static Public Attributes

static final String APP_DIR = "osmand/"
static final String POI_PATH = APP_DIR + IndexConstants.POI_INDEX_DIR
static final String VOICE_PATH = APP_DIR + IndexConstants.VOICE_INDEX_DIR
static final String GPX_PATH = "tracks"
static final String MAPS_PATH = APP_DIR
static final String BACKUP_PATH = "backup/"
static final String TILES_PATH = "tiles/"
static final String TEMP_SOURCE_TO_LOAD = "temp"
static final String VECTOR_MAP = "#vector_map"

Protected Member Functions

Bitmap getTileImageForMap (String file, ITileSource map, int x, int y, int zoom, boolean loadFromInternetIfNeeded, boolean sync, boolean loadFromFs)
synchronized Bitmap getTileImageForMap (String tileId, ITileSource map, int x, int y, int zoom, boolean loadFromInternetIfNeeded, boolean sync, boolean loadFromFs, boolean deleteBefore)
Bitmap getRequestedImageTile (TileLoadDownloadRequest req)
synchronized void clearTiles ()

Protected Attributes

int maxImgCacheSize = 28
Map< String, Bitmap > cacheOfImages = new LinkedHashMap<String, Bitmap>()
Map< String, Boolean > imagesOnFS = new LinkedHashMap<String, Boolean>()
File dirWithTiles
final List
< AmenityIndexRepository
amenityRepositories = new ArrayList<AmenityIndexRepository>()
final List
< TransportIndexRepository
transportRepositories = new ArrayList<TransportIndexRepository>()
final Map< String, String > indexFileNames = new LinkedHashMap<String, String>()
final Map< String,
BinaryMapIndexReader > 
routingMapFiles = new LinkedHashMap<String, BinaryMapIndexReader>()
final MapRenderRepositories renderer
final MapTileDownloader tileDownloader
boolean internetIsNotAccessible = false
AmenityIndexRepositoryOdb updatablePoiDb = null
StringBuilder builder = new StringBuilder(40)
char[] tileId = new char[120]

Static Protected Attributes

static ResourceManager manager = null

Detailed Description

Resource manager is responsible to work with all resources that could consume memory (especially with file resources). Such as indexes, tiles. Also it is responsible to create cache for that resources if they can't be loaded fully into memory & clear them on request.


Constructor & Destructor Documentation


Member Function Documentation

synchronized String net.osmand.plus.ResourceManager.calculateTileId ( ITileSource  map,
int  x,
int  y,
int  zoom 
)
void net.osmand.plus.ResourceManager.clearTileImageForMap ( String  file,
ITileSource  map,
int  x,
int  y,
int  zoom 
)
synchronized void net.osmand.plus.ResourceManager.clearTiles ( ) [protected]
Map<String, String> net.osmand.plus.ResourceManager.getBackupIndexes ( Map< String, String >  map)
Bitmap net.osmand.plus.ResourceManager.getRequestedImageTile ( TileLoadDownloadRequest  req) [protected]
Bitmap net.osmand.plus.ResourceManager.getTileImageForMap ( String  file,
ITileSource  map,
int  x,
int  y,
int  zoom,
boolean  loadFromInternetIfNeeded,
boolean  sync,
boolean  loadFromFs 
) [protected]
Parameters:
file- null could be passed if you do not call very often with that param
synchronized Bitmap net.osmand.plus.ResourceManager.getTileImageForMap ( String  tileId,
ITileSource  map,
int  x,
int  y,
int  zoom,
boolean  loadFromInternetIfNeeded,
boolean  sync,
boolean  loadFromFs,
boolean  deleteBefore 
) [protected]
Bitmap net.osmand.plus.ResourceManager.getTileImageForMapAsync ( String  file,
ITileSource  map,
int  x,
int  y,
int  zoom,
boolean  loadFromInternetIfNeeded 
)
Bitmap net.osmand.plus.ResourceManager.getTileImageForMapSync ( String  file,
ITileSource  map,
int  x,
int  y,
int  zoom,
boolean  loadFromInternetIfNeeded 
)
List<String> net.osmand.plus.ResourceManager.indexingMaps ( final IProgress  progress)
void net.osmand.plus.ResourceManager.indexingPoi ( final IProgress  progress,
List< String >  warnings,
File  f 
)

On low memory method ///.

List<String> net.osmand.plus.ResourceManager.reloadIndexes ( IProgress  progress)
List<Amenity> net.osmand.plus.ResourceManager.searchAmenities ( PoiFilter  filter,
double  topLatitude,
double  leftLongitude,
double  bottomLatitude,
double  rightLongitude,
double  lat,
double  lon,
ResultMatcher< Amenity >  matcher 
)
void net.osmand.plus.ResourceManager.searchAmenitiesAsync ( double  topLatitude,
double  leftLongitude,
double  bottomLatitude,
double  rightLongitude,
int  zoom,
PoiFilter  filter,
List< Amenity >  toFill 
)
List<Amenity> net.osmand.plus.ResourceManager.searchAmenitiesByName ( String  searchQuery,
double  topLatitude,
double  leftLongitude,
double  bottomLatitude,
double  rightLongitude,
double  lat,
double  lon,
ResultMatcher< Amenity >  matcher 
)
Map<AmenityType, List<String> > net.osmand.plus.ResourceManager.searchAmenityCategoriesByName ( String  searchQuery,
double  lat,
double  lon 
)
void net.osmand.plus.ResourceManager.searchTransportAsync ( double  topLatitude,
double  leftLongitude,
double  bottomLatitude,
double  rightLongitude,
int  zoom,
List< TransportStop >  toFill 
)
void net.osmand.plus.ResourceManager.tileDownloaded ( DownloadRequest  request)
synchronized boolean net.osmand.plus.ResourceManager.tileExistOnFileSystem ( String  file,
ITileSource  map,
int  x,
int  y,
int  zoom 
)
boolean net.osmand.plus.ResourceManager.updateRenderedMapNeeded ( RotatedTileBox  rotatedTileBox,
DrawSettings  drawSettings 
)

Member Data Documentation

final String net.osmand.plus.ResourceManager.APP_DIR = "osmand/" [static]
final String net.osmand.plus.ResourceManager.BACKUP_PATH = "backup/" [static]
StringBuilder net.osmand.plus.ResourceManager.builder = new StringBuilder(40) [protected]
Map<String, Bitmap> net.osmand.plus.ResourceManager.cacheOfImages = new LinkedHashMap<String, Bitmap>() [protected]
final String net.osmand.plus.ResourceManager.GPX_PATH = "tracks" [static]
Map<String, Boolean> net.osmand.plus.ResourceManager.imagesOnFS = new LinkedHashMap<String, Boolean>() [protected]
final Map<String, String> net.osmand.plus.ResourceManager.indexFileNames = new LinkedHashMap<String, String>() [protected]
final String net.osmand.plus.ResourceManager.POI_PATH = APP_DIR + IndexConstants.POI_INDEX_DIR [static]
final Map<String, BinaryMapIndexReader> net.osmand.plus.ResourceManager.routingMapFiles = new LinkedHashMap<String, BinaryMapIndexReader>() [protected]
final MapTileDownloader net.osmand.plus.ResourceManager.tileDownloader [protected]
char [] net.osmand.plus.ResourceManager.tileId = new char[120] [protected]
final String net.osmand.plus.ResourceManager.TILES_PATH = "tiles/" [static]
final String net.osmand.plus.ResourceManager.VECTOR_MAP = "#vector_map" [static]
final String net.osmand.plus.ResourceManager.VOICE_PATH = APP_DIR + IndexConstants.VOICE_INDEX_DIR [static]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines