import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
-
- // TODO surely this belongs somewhere else
- private static final String defserver = "tcp://ctfws-mqtt.ietfng.org:1883";
-
private final MainActivityBuildHooks mabh = new MainActivityBuildHooksImpl();
private MainService.LocalBinder mSrvBinder; // set once connection completed
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
if (sp.getString("server", null) == null) {
- sp.edit().putString("server", defserver).apply();
+ sp.edit().putString("server", getString(R.string.server_default)).apply();
}
if (BuildConfig.DEBUG && sp.getString("server", null) == null) {
throw new AssertionError("Shared Preferences not sticking!");
<resources xmlns:tools="http://schemas.android.com/tools">
+ <string name="server_default">tcp://ctfws-mqtt.acmetensortoys.com:1883</string>
+
<string name="app_name">CMUKGB CtFwS Timer</string>
<string name="ctfws_gameend">Game\nEnd</string>
android:selectAllOnFocus="true"\r
android:singleLine="true"\r
android:key="server"\r
- android:defaultValue="tcp://ctfws-mqtt.ietfng.org:1883"\r
+ android:defaultValue="@string/server_default"\r
android:title="@string/preftext_mqtt" />\r
<CheckBoxPreference\r
android:defaultValue="true"\r
android:title="@string/preftext_vibrate"\r
android:key="prf_vibr" />\r
-</PreferenceScreen>
\ No newline at end of file
+</PreferenceScreen>\r