ad #1: the reason to avoid designer (which is a great tool !!) is only because I like to integrate a small OSM viewer in an older B4A application without any designer implication. However, a mix between with/without designer may be possible but makes this tweak more complex.
This is my try ...
- Create a AddToParent routine in the class
Public Sub AddToParent(Parent As Activity, Left As Int, Top As Int, Width As Int, Height As Int)
mBase = fxui.CreatePanel("mBase")
Parent.AddView(mBase, Left, Top, Width, Height)
End Sub
- Define a panel (<100% dimension of screen)
'' Activity.LoadLayout("main")
fcvPanel.Initialize("")
Activity.Addview(fcvPanel,0dip,0dip,90%x,90%y)
fcvPanel.Color=Colors.Cyan
fcvMap.Initialize(Me,"fcvMap")
fcvMap.AddToParent(fcvPanel,0dip,0dip,100%x,100%y)
Result is a nice cyan colored panel but no map at all. When I open the LoadLayout (what I don't want to do) and comment the fvMap.initialize statement everything is fine. The map is showing up in the panel as expected. The fvMap.initialize statement seems to be wrong (wrong callback function?).
ad #2: I saw the SQLite usage in clsMapTileManager (which is a good solution) and I'm wondering why I run in such a situation. I have not changed anything in the tile management at all. When I compile and run the app again the resulting access problems are the same. The planned (integrated) usage is only about a small region in Germany. Small means maximum 25km radius around a fix point (could be a different point over time but mostly the same all times) meaning not so much tiles are impacted. This amount of tiles should be easily fetched through internet and stored in DB. I will look into the SQLite DB in detail after solving #1. Of course, my final idea is to use the tiles (in addition?) which are already stored on my device by the OSMAnd+ app (perfect for offline usage) with the hope that the data format matches ;-)
Wosl