diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NetUtils.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NetUtils.java index 3f37ad620..aff714afa 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NetUtils.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NetUtils.java @@ -226,8 +226,7 @@ public class NetUtils { protected static HttpsURLConnection makeHttpsMQTTConn( Context context, String proc ) { - // String url = XWPrefs.getDefaultMQTTUrl( context ); - String url = "https://liquidsugar.net/xw4/api/v1"; + String url = XWPrefs.getDefaultMQTTUrl( context ); return makeHttpsConn( context, url, proc ); } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWPrefs.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWPrefs.java index 28b314efa..096b3a3ec 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWPrefs.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWPrefs.java @@ -148,6 +148,15 @@ public class XWPrefs { return result; } + public static String getDefaultMQTTUrl( Context context ) + { + String result = getPrefsString( context, R.string.key_mqtt_url ); + if ( result == null || 0 == result.length() ) { + result = context.getString( R.string.default_mqtt_url ); + } + return result; + } + public static boolean getRelayEnabled( Context context ) { boolean enabled = ! getPrefsBoolean( context, R.string.key_disable_relay, diff --git a/xwords4/android/app/src/main/res/values/common_rsrc.xml b/xwords4/android/app/src/main/res/values/common_rsrc.xml index 1182c4138..6b89e703d 100644 --- a/xwords4/android/app/src/main/res/values/common_rsrc.xml +++ b/xwords4/android/app/src/main/res/values/common_rsrc.xml @@ -39,6 +39,7 @@ key_relay_via_http_first key_update_url2 key_relay_url2 + key_mqtt_url key_mqtt_host key_mqtt_port key_mqtt_qos @@ -170,9 +171,7 @@ https://eehouse.org/sms.html https://eehouse.org/xw4/info.py https://eehouse.org/xw4/relay.py - - - + https://liquidsugar.net/xw4/api/v1 15x15 diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index 101ad1197..4fe38432d 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -2230,6 +2230,7 @@ Pending packet count Update checks URL URL for relay web API + URL for new mqtt-based relay API Fetch default wordlist for language Don\'t try a second time SMS Stuff diff --git a/xwords4/android/app/src/main/res/xml/xwprefs.xml b/xwords4/android/app/src/main/res/xml/xwprefs.xml index fe597a62b..160bc4f77 100644 --- a/xwords4/android/app/src/main/res/xml/xwprefs.xml +++ b/xwords4/android/app/src/main/res/xml/xwprefs.xml @@ -456,6 +456,11 @@ android:entryValues="@array/mqtt_qos_values" android:defaultValue="2" /> +