diff --git a/Makefile b/Makefile index 2bee340d..eb3a8921 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,11 @@ MAKEFLAGS += --warn-undefined-variables MAKEFLAGS += --no-builtin-rules -PROJECT = tildefriends +VERSION_CODE := 8 VERSION_NUMBER := 0.0.8 VERSION_NAME := The secret ingredient is love. + +PROJECT = tildefriends BUILD_DIR ?= out BUILD_TYPES := debug release windebug winrelease androiddebug androidrelease androiddebug-x86_64 androidrelease-x86_64 UNAME_M := $(shell uname -m) @@ -438,6 +440,14 @@ src/version.h : $(firstword $(MAKEFILE_LIST)) @echo [version] $@ @echo "#define VERSION_NUMBER \"$(VERSION_NUMBER)\"\n#define VERSION_NAME \"$(VERSION_NAME)\"\n" > $@ +src/android/AndroidManifest.xml : $(firstword $(MAKEFILE_LIST)) + @echo [android_version] $@ + @sed -i \ + -e 's/versionCode=".*"/versionCode="$(VERSION_CODE)"/' \ + -e 's/versionName=".*"/versionName="$(VERSION_NUMBER)"/' \ + -e 's/android:minSdkVersion=".*"/android:minSdkVersion="$(ANDROID_MIN_SDK_VERSION)"/' \ + $@ + # Android support. out/res/layout_activity_main.xml.flat: src/android/res/layout/activity_main.xml @mkdir -p $(dir $@) diff --git a/src/android/AndroidManifest.xml b/src/android/AndroidManifest.xml index f5c1b4f2..029683f3 100644 --- a/src/android/AndroidManifest.xml +++ b/src/android/AndroidManifest.xml @@ -1,9 +1,9 @@ - + versionCode="8" + versionName="0.0.8"> + diff --git a/src/android/com/unprompted/tildefriends/MainActivity.java b/src/android/com/unprompted/tildefriends/MainActivity.java index 81bf5b50..a1f5232b 100644 --- a/src/android/com/unprompted/tildefriends/MainActivity.java +++ b/src/android/com/unprompted/tildefriends/MainActivity.java @@ -82,6 +82,8 @@ public class MainActivity extends Activity { String port_file_path = getFilesDir().toString() + "/port.txt"; base_url = "http://127.0.0.1:12345/"; + MainActivity activity = this; + new Thread(new Runnable() { @Override public void run() { @@ -98,7 +100,9 @@ public class MainActivity extends Activity { if (event.context().toString().equals("port.txt")) { Log.w("tildefriends", "Observed file write: " + event.context().toString()); base_url = "http://127.0.0.1:" + String.valueOf(read_port(port_file_path)) + "/"; - web_view.loadUrl(base_url); + activity.runOnUiThread(() -> { + web_view.loadUrl(base_url); + }); watcher.close(); break; }