Saving offline map atlas inside osmdroid - osmdroid

Is there a solution to save the map tiles inside the app like the Mobile Atlas Creator works on the desktop?
I only found a way by using PC application.

There sure is. It probably needs some more testing, but the example is located here:
https://github.com/osmdroid/osmdroid/blob/master/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/SampleCacheDownloaderArchive.java
Essentially, when you fire up an instance of CacheManager, it gets the map view's IFileSystemCache instance, which is normally the Sqlite tile cache (the kind that expires). This example feeds in an alternate implementation that produces a permanent sql tile archive (no expiration dates in it).
Use it with caution has many tile sources do not allow you to do this in their terms of service and you can get banned for doing so
Edit: there's more info the wiki
https://github.com/osmdroid/osmdroid/wiki/Offline-Map-Tiles#use-osmdroids-cache-manager-on-device---version-52

Related

How to fetch Edge browsing history programmatically? Is there is any way using COM/Windows API to fetch it? [duplicate]

I used FindFirstUrlCacheEntry/FindNextUrlCacheEntry Win API to get Internet Explorer's history programmatically in C++.
Can you tell me how to get Microsoft Edge History using C++ (Windows API)?
Not possible at this point in time. Might want to use the 'suggestions routes' at some of the links below.
Developer Feedback Home - https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer
Developer Feedback Twitter - https://www.twitter.com/msedgedev
Feature Suggestions - https://windowsphone.uservoice.com/forums/101801-feature-suggestions/category/18985-web-browsing
Healy in Tampa
The history is stored in \AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat. It uses Microsoft’s Extensible Storage Engine to store data. There is a C++ wrapper for accessing Extensible Storage Engine files I've used to access data from this file.
The "Containers" table inside WebCacheV01.dat tells which "Container_X" tables have type of "Content" or "History", as well as the Secure Directories and their order. You can use the ESEDatabaseView utility to view the data inside the WebCacheV01.dat file.

Use map data offline with osmdroid

My ultimate goal is to have map data (offline, because I will customize it myself) and display it in an app (Android). I could make osmdroid work to load maps online and I was trying to figure out how to download and display offline maps. I downloaded MOBAC (Mobile Atlas Creator) and export the data to SQLite format and when I had a look at it I realized that tiles are saved in image format (PNG).
What I would like to do is to import data to the phone to later use it in algorithms such as a search engine or a routing algorithm, so I need the "nodes" and "ways" (as I get them from the original OSM XML), import them to the phone and visualize it to later have this data available for the algorithms I want to develop. Basically, what MAPS.ME does. I think it wouldn't be difficult to convert the XML into the SQLite since a simple script could make it, but then, how can I generate the tiles from this custom SQLite database? Or, is there a way I can download the data in a more appropriate way to do what I'm planning to do?
Thanks.
Rendering the tiles in an app from raw Openstreetmap data would be computation heavy and inefficient. I would suggest to use image tiles you exported for visual representation.
In addition to tiles you should export a data set you will need in the application for desired functionality. You will not need all data from Openstreetmap so you should identify what you need and build your custom export (there are tools and libraries for processing and filtering of Openstreetmap data. I have used pyosmium for some filtering and processing but there are others.) For example, you can build your custom database with POIs you want to search for.
Routing is another chapter. You can implement it yourself but it is a very complex task. There is java library called Graphopper which can do the data extraction (from Openstreetmap) and offline routing for you. They have an online API too but it is possible to make it working completely offline (I did it for one application). Try to look at the source code because than you can see how complex topic routing is. Final note: data exported from Graphopper contains information about some POIs along routes. It may be possible to search for some things via its java API but I haven't investigated this yet.

How to use sqlite database with Osmdroid?

While it is said that sqlite database is recommended format for offline map tiles (https://github.com/osmdroid/osmdroid/wiki/Offline-Map-Tiles) there is no really example how to use it. I have my sqlite file generated with mobac app but how to load it?
Any example would be helpful!
My environment is Xamarin, VS, Android.
Well I can't speak for Xamarin, but to use sqlite databases with osmdroid, simply get the file on device at /sdcard/osmdroid/yourfile.sqlite
then start osmdroid or whatever app it's running in
Then you need to tell osmdroid to display whatever tile source is in the sqlite's 'provider' column. This is documented at the following links
https://github.com/osmdroid/osmdroid/wiki/Map-Sources#using-a-different-tile-source
I agree, the wiki could use some clarification on this. In short, osmdroid runs a routine to discover all tile sources available offline when it starts up (with the default tile provider). Then when you switch tile sources, it will attempt to fulfill the tile request with all available sources until trying online source.
To summarize,
prepare your sqlite file
transfer to device /sdcard/osmdroid/
tell osmdroid to use a tile source that matches the 'provider' column in the database (and optionally set offline mode mapview.setUseDataConnection(false))
start it up

what's the efficiency of qsqlite data base in Qt?

I am very new to database and I am trying to implement a offline map viewer. What would be the efficiency of the qsqldatabase?
To make it extreme, for example, is it possible to download all satellite image of all the detail levels of US from the google's map server and store it in a local sqlite database and still perform real time query based on my current gps location?
The Qt Database driver for SQLite uses SQLite internally (surprise!). So the question is more like: Is SQLite the right database to use? My answer: I would not use it to store geographical data, consider to look for a database which is optimized for this task.
If this is not an option; SQLite is really efficient. First check if your data is within the limits. Do not forget to create indexes and analyze the database. Then it should be able to handle your task. Here I assume you just want to get an image by its geographical position (but other solutions can be a lot faster because your data is sortable — if I remember correctly SQLite is not optimized for that).
As you will store large blobs, you may want to have a look at the Internal Versus External BLOBs in SQLite document. Maybe this gives you the answer already.

Debug iCloud key-value data in the cloud

I have been banging my head against the wall trying to figure out how to determine what is actually in the key-value store for a given app. Using the api to detect data seems dubious to me as I am afraid of getting false positives. Also I would have to guess at what else might be there (i.e. from previous versions of the app or whatever). So far as I can tell, the developer test website only shows files in the cloud, and not the key-value store. Does anyone know how to access this data, or where in the filesystem the local .plist file is stored (I assume it is in a .plist anyway)?
I finally found it. There is a circuitous route to get there. ~/Library/SyncedPreferences/com.apple.syncedpreferences.plist has a dictionary entry for each application bundle. Inside that dictionary is the key plistPath. This points to the actual plist file that contains the key-value data for your app (on the local device anyway). This file is stored in your app's container at ~/Library/Containers/<bundleName>/Data/Library/SyncedPreferences and appears to be named <bundleName>.plist. Still don't know how to view what is actually in the cloud, so I guess I will have to trust what is in the local file. :)
I know this question is old but shows up in google search so it may help others.
In case that the device is a simulator the path are as follows:
Directory for application bundle list is:
~/Library/Developer/CoreSimulator/Devices/<Device-ID>/data/Library/SyncedPreferences/com.apple.syncedpreferences.plist
File with key-value data for your app:
~/Library/Developer/CoreSimulator/Devices/<Device-ID>/data/Containers/Data/Application/<App-ID>/Library/SyncedPreferences/<bundleName>.plist