Commit 9d07bd22 authored by Nick Whitelegg's avatar Nick Whitelegg

finalising release 0.2.0

parent 8a1cf509
......@@ -7,11 +7,11 @@ apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "uk.org.mapthepaths.android.dev"
applicationId "uk.org.mapthepaths.android"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "0.2-dev"
versionCode 10
versionName "0.2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
......
......@@ -51,7 +51,7 @@
</li>
</ul>
<h3>View mode</h3>
<p>You can select the mode ("View" or "Edit") via the bottom navigation view on the app.
<p>You can select the mode ("View" or "Live OSM Edit") via the bottom navigation view on the app.
"View"
mode is the default. It provides a view much like the MapThePaths website itself; it shows
council
......@@ -63,7 +63,7 @@
appear
in grey. To view the data you must select "Download council and OSM data" from the menu
system.</p>
<p>You can use "Edit" mode, below to add a designation but <strong>do not copy the council data
<p>You can use "Live OSM Edit" mode, below to add a designation but <strong>do not copy the council data
</strong>, as not all councils license their data in a way which is compatible with OSM. Instead,
<strong>add designations only via on-the-ground observation.</strong></p>
<p>Note that <strong>the OSM data in "View" mode is not live OSM data</strong>. It is OSM data
......@@ -71,11 +71,11 @@
by the <a href='https://www.free-map.org.uk'>Freemap</a> server, which is normally up to a week,
sometimes two weeks, old. So it
is possible that an apparently-missing footpath has been surveyed in the meantime. You can use
"Edit"
"Live OSM Edit"
mode to check the live OSM data to be absolutely sure.</p>
<h3>Edit mode</h3>
<p>"Edit" mode allows you to change the designation of a path. It works
<h3>Live OSM Edit mode</h3>
<p>"Live OSM Edit" mode allows you to change the designation of a path. It works
with live OSM data from the OSM API, so you must select "Download live OSM data" from the menu
first and you must
login to OSM (via the "Login to OSM" menu option). Use your normal OSM account.
......@@ -90,7 +90,7 @@
<h2>Adding notes</h2>
<p>When logged in, you can also add notes for other mappers, e.g. make a note that a hedge is either
to the
left or to the right of the path. The note button is available in both "View" and "Edit"
left or to the right of the path. The note button is available in both "View" and "Live OSM Edit"
modes.</p>
<h2>Performance issues</h2>
<p>The app uses a forked version of the Ordnance Survey OpenSpace SDK for Android
......
......@@ -98,8 +98,6 @@ class GpsService : Service(), LocationListener, CoroutineScope {
override fun onStartCommand(intent: Intent?, startFlags: Int, id: Int): Int {
registerReceiver(receiver, intentFilter)
// Log.d("mapthepaths", "onStartCommand()")
val channelID = "gpsChannel"
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
......@@ -117,7 +115,7 @@ class GpsService : Service(), LocationListener, CoroutineScope {
loading = true
loadSurvey() // we only load the survey if we are not logging
}
// Log.d("mapthepaths", "onStartCommand()")
lMgr = getSystemService(Context.LOCATION_SERVICE) as LocationManager
if (!listeningForUpdates) {
listeningForUpdates = true
......@@ -174,13 +172,6 @@ class GpsService : Service(), LocationListener, CoroutineScope {
if (logging) {
val tp = TrackPoint(loc.longitude, loc.latitude, time)
survey?.add(tp)
/*
if (time - lastUpdateTime > 20000) {
saveSurvey()
lastUpdateTime = time;
}
*/
}
}
......@@ -225,7 +216,6 @@ class GpsService : Service(), LocationListener, CoroutineScope {
private fun sendLocationBroadcast(loc: Location) {
// send msg to any receivers informing them of location
// Log.d("mapthepaths", "sending location broadcast")
val broadcast = Intent("uk.org.mapthepaths.android.onLocationChanged")
broadcast.putExtra("lat", loc.latitude)
broadcast.putExtra("lon", loc.longitude)
......@@ -251,9 +241,6 @@ class GpsService : Service(), LocationListener, CoroutineScope {
try {
withContext(Dispatchers.IO) {
//val tmpFile = "${Environment.getExternalStorageDirectory().getAbsolutePath()}/gpx$t.gpx"
//val pw = PrintWriter(FileWriter(tmpFile))
val pw = PrintWriter(FileWriter(filename))
survey?.toGPX(pw)
pw.close()
......@@ -321,7 +308,6 @@ class GpsService : Service(), LocationListener, CoroutineScope {
private fun broadcastRender() {
val broadcast = Intent("uk.org.mapthepaths.android.renderSurvey")
// Log.d("mapthepaths", "sending render broadcast")
sendBroadcast(broadcast)
}
......
......@@ -32,7 +32,7 @@ fun Survey.getOsmGpsTrace(): ArrayList<GpsTrackpoint> {
return trackpoints
}
class GpxUploader(val apiUrl: String, val userAgent: String, val scope: CoroutineScope, var uploadGpxToOsm: Boolean = false) {
class GpxUploader(val apiUrl: String, val userAgent: String, private val scope: CoroutineScope, var uploadGpxToOsm: Boolean = false) {
fun uploadGpx(unsimplifiedSurvey: Survey, message: String, consumer: OAuthConsumer?, onError: (String) -> Unit, onSuccess: (String) -> Unit) {
val gpsTrace = unsimplifiedSurvey.getOsmGpsTrace()
......
......@@ -402,7 +402,7 @@ class MainActivity : AppCompatActivity() {
}
R.id.about -> {
AlertDialog.Builder(this).setPositiveButton("OK", null).setMessage("MapThePaths app 0.2-dev, (c) Nick Whitelegg 2018-9. Uses OpenStreetMap data, copyright OpenStreetMap contributors, licensed under the Open Database License. Map tiles (c) Ordnance Survey, OS OpenData License. Council data available under varying licenses: please see https://osm.mathmos.net/prow/open-data for details.").show()
AlertDialog.Builder(this).setPositiveButton("OK", null).setMessage("MapThePaths app 0.2.0, (c) Nick Whitelegg 2018-20. Uses OpenStreetMap data, copyright OpenStreetMap contributors, licensed under the Open Database License. Map tiles (c) Ordnance Survey, OS OpenData License. Council data available under varying licenses: please see https://osm.mathmos.net/prow/open-data for details.").show()
}
}
return true
......
......@@ -2,7 +2,6 @@ package uk.org.mapthepaths.android
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.webkit.WebView
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
......@@ -16,8 +15,6 @@ class OSMAuthActivity : AppCompatActivity() {
wv.settings.javaScriptEnabled = true
setContentView(wv)
val oauthManager = OAuthManager(wv, lifecycleScope, {
Log.d("mapthepaths", "OSMOAuthActivity is receiving: token: ${it.token} ${it.tokenSecret} with consumer key/secret ${it.consumerKey} ${it.consumerSecret}")
val intent = Intent()
intent.putExtra("oauthConsumer", it)
setResult(RESULT_OK, intent)
......
......@@ -19,7 +19,6 @@ class OSMOAuthWebViewClient (val onReceivedRequestToken: (String) -> Unit) : Web
components[1].split('&').forEach {
val kv = it.split('=')
if(kv.size == 2) {
// Log.d("mapthepaths", "key=${kv[0]} value=${kv[1]}")
get[kv[0]] = kv[1]
}
}
......
......@@ -6,7 +6,6 @@ import de.westnordost.osmapi.map.MapDataDao
import de.westnordost.osmapi.map.data.*
import de.westnordost.osmapi.map.handler.MapDataHandler
import de.westnordost.osmapi.notes.NotesDao
import de.westnordost.osmapi.traces.GpsTrackpoint
import freemap.data.Point
import kotlinx.coroutines.*
import oauth.signpost.OAuthConsumer
......@@ -16,7 +15,7 @@ import oauth.signpost.basic.DefaultOAuthConsumer
import java.util.*
class OSMProcessor(private val apiUrl: String, private val userAgent: String, val scope: CoroutineScope, private var displayCallback: ((Long, MutableMap<String, String>, DoubleArray) -> Unit)?) {
class OSMProcessor(private val apiUrl: String, private val userAgent: String, private val scope: CoroutineScope, private var displayCallback: ((Long, MutableMap<String, String>, DoubleArray) -> Unit)?) {
data class WayMatch(val wayId: Long, val dist: Double, val segIdx: Int)
......
......@@ -4,7 +4,7 @@
<string name="path_type">Path type:</string>
<string name="downloadLiveOsm">Download live OSM data</string>
<string name="view">View</string>
<string name="edit">Edit</string>
<string name="edit">Live OSM Edit</string>
<string name="loginToOsm">Login to OSM</string>
<string name="newTrack">Save current track</string>
<string name="enterDesignation">Enter designation:</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment