moovida/geopaparazzi — pull request #12 by mj10777 (2013-10-04 11:18:36+00:00)
Title: Mbtiles - offered changes im mbtiles classes and recursive directories and implemnetation in all affected classes

MbtilesDatabaseHandler,MBTilesDroidSpitter and MbTilesMetadata are complete replacements
SpatialiteDatabaseHandler and SpatialRasterTable have been adapted to implement the needed changes.

SpatialiteDatabaseHandler: getSpatialRasterTables and getCenterCoordinate4326
- have been adapted to retrieve the proper bounds for geopackage databases

SpatialRasterTable:
- added bounds values and default centre values
- Function: checkCenterLocation has been added to check if the given position/zoom is inside the bounds of the database and to [optional parameter] to change these value
- this function is used in MapsActivity.onCreate

FilesUtilities
added Function search_directory_recursive [for support of directories inside sdcard/maps]
- used in GeoPaparazziActivity.onCreate and onMenuItemSelected

DataListActivity
- refreshList : added column of table : so that a table with more that one geometry columns would be unique

SpatialDatabasesManager
- added a global logging function 'app_log' which can be call from app and spatialitelibrary.
- simplifies usage of StackTrace and used a default tag name for logcat

CustomTileDownloader
- added MbtilesDatabaseHandler to class
- added mbtiles specific parameters which are read during construction
- if the 'mbtiles' parameter is set [path/filename]
-- MbtilesDatabaseHandler will be opened if file exists
- MbtilesDatabaseHandler will create a new mbtiles file with given parameters
CustomTileDownloader.executeJob will
- check if MbtilesDatabaseHandler is not null
- if not : will retrieve image and return if found -
- otherwise normal request : when image is received, and MbtilesDatabaseHandler is not null,will be stored in mbtiles.db
Function public void close() : should be renamed to cleanup() when 'final' has been remove from 'TileDownloader'
- at the moment, the application will crash upon MapView exit and the database is not closed.
-- with cleanup() I hope this will be resolved
- Function: checkCenterLocation has been added to check if the given position/zoom is inside the bounds of the database and to [optional parameter] to change these value

MapsActivity:
- Function: checkCenterLocation has been added to check if the given position/zoom is inside the bounds of the .map files and to [optional parameter] to change these value
The first portion of MapsActivity.onCreate has be changed in many ways, so this should be looked at cloasly
- here the logic has been implemented that if the present position / zoom [result of getMapCenterFromPreferences] is outside of .maps,.mapsurl and SpatialRasterTable a valid postion inside the bounds and nearest valid zoom level will be set [checkCenterLocation]

I believe that is all