OSMDroid updated to version 3.23
This update adds a new object and a new MapView method:
AttributionObject
Properties:
- Html As String
Get the licensing and attribution Strings as HTML.
- LibraryName As String
Get the name of the 3rd party library that this AttributionObject refers to.
- PlainText As String
Get the licensing and attribution Strings as plain text.
GetAttributionObjects As AttributionObject()
Returns an Array of AttributionObjects.
An AttributionObject contains licensing and attribution Strings relating to 3rd party libraries used in this B4A library.
You are required to display some or all of these Strings in your application if you use the related B4A library object(s).
This is a result of this thread:
http://www.b4x.com/forum/libraries-...ice-about-libraries-license-2.html#post109368 where it was discussed to better document the terms and conditions of B4A libraries that wrap other 3rd party libraries.
The attribution text is available as plain text or HTML - you can display it in a TextView, or add it to a WebView and the HTML contains links that refer back to the original licence.
Here's some example code:
Sub Process_Globals
End Sub
Sub Globals
Dim MapView1 As MapView
End Sub
Sub Activity_Create(FirstTime As Boolean)
MapView1.Initialize("")
Activity.AddView(MapView1, 0, 0, 100%x, 100%y)
MapView1.SetZoomEnabled(True)
MapView1.SetMultiTouchEnabled(True)
MapView1.Zoom=14
MapView1.SetCenter(52.75192, 0.40505)
' the new GetAttributionObjects method enables you to ensure your B4A application more properly complies with the terms & conditions
' of the various 3rd party components which make up the B4A OSMDroid library
Dim AttributionObjects() As AttributionObject
AttributionObjects=MapView1.GetAttributionObjects
For i=0 To AttributionObjects.Length-1
Log(AttributionObjects(i).LibraryName)
Log(AttributionObjects(i).PlainText)
Log(AttributionObjects(i).Html)
Log("----------------------------")
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
And that logs:
** Activity (main) Create, isFirst = true **
OSMDroid
OSMDroid is licensed under the terms and conditions of the GNU Lesser General Public Licence.
<a href=http://code.google.com/p/osmdroid/>OSMDroid</a> is licensed under the terms and conditions of the <a href=http://www.gnu.org/licenses/lgpl.html>GNU Lesser General Public Licence</a>.
----------------------------
OpenStreetMap
OSMDroid displays map data provided by the OpenStreetMap project. This map data is licensed under the terms and conditions of the Creative Commons Attribution 3.0 Unported Licence.
OSMDroid displays map data provided by the <a href=http://www.openstreetmap.org/>OpenStreetMap</a> project.<br />This map data is licensed under the terms and conditions of the <a href=http://creativecommons.org/licenses/by-sa/3.0/>Creative Commons Attribution 3.0 Unported Licence</a>.
----------------------------
MarkersBalloonOverlay
MarkersBalloonOverlay is a modification of the Android MapViewBalloons project. MapViewBalloons is licensed under the terms and conditions of the Apache License, Version 2.0.
MarkersBalloonOverlay is a modification of the Android <a href=https://github.com/jgilfelt/android-mapviewballoons>MapViewBalloons</a> project.<br />MapViewBalloons is licensed under the terms and conditions of the <a href=http://www.apache.org/licenses/LICENSE-2.0>Apache License, Version 2.0</a>.
----------------------------
So to make sure your B4A application complies with the various 3rd party licences you now have the info you need - for example, if your application has an About Activity then you could display the attribution text there.
Otherwise it is up to
you - the developer - to ensure that somewhere in your application you properly display the attributions.
I have made the B4A library source code publicly available here:
Index of /b4a/osmdroid/src so as long as you display the attributions in your app, the terms and conditions of the various 3rd party licences are satisfied.
Versions 3.23 of OSMDroid is attached to the first post in this thread.
Version 3.23 contains a new resource file 'values\attribution_strings.xml' that must be added to your project's 'Objects\res' foler.
Ensure you make it READ-ONLY so that the B4A compiler does not delete it.
Martin.