preferences for backends

storage_ts_index
Georg Lukas 2011-01-26 03:32:36 +01:00
rodzic 7a96ec102b
commit e5522ad328
8 zmienionych plików z 124 dodań i 28 usunięć

Wyświetl plik

@ -20,11 +20,13 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".PrefsAct" android:label="@string/app_prefs" />
<activity android:name=".PrefsAct" android:label="@string/app_prefs" />
<activity android:name=".BackendPrefs" android:label="@string/app_prefs" />
<activity android:name=".MapAct" android:label="@string/app_map"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service android:name=".AprsService">

Wyświetl plik

@ -5,5 +5,6 @@
<string name="default_status">http://aprsdroid.org/</string>
<string name="default_symbol">/$</string>
<string name="p_conntype_default" value="tcp" />
</resources>

Wyświetl plik

@ -101,10 +101,12 @@
<string name="p_status">Status message</string>
<string name="p_status_summary">The text after your coordinates</string>
<string name="p_status_entry">Enter your status message</string>
<string name="p__network">Networking</string>
<string name="p__connection">APRS Connection</string>
<string name="p_conntype">Connection Protocol</string>
<string name="p_conntype_summary">Choose UDP (port 8080) or HTTP POST (URL)</string>
<string name="p_conntype_summary">AFSK, HTTP, TCP or UDP</string>
<string name="p_conntype_entry">Choose the connection protocol</string>
<string name="p_connsetup">Connection Preferences</string>
<string name="p_connsetup_summary">Configuration of Connection</string>
<!-- array of connection types -->
<string-array name="p_conntype_e">
<item>UDP port 8080</item>
@ -115,6 +117,7 @@
<string name="p_host">Server</string>
<string name="p_host_summary">APRS-IS server (port 8080) to send beacons</string>
<string name="p_host_entry">Enter the APRS-IS server hostname</string>
<string name="p_host_hint">host:port</string>
<string name="p__location">Location Settings</string>
<string name="p_interval">Minimum update time</string>
<string name="p_interval_summary">Minutes between beacon transmissions</string>
@ -126,8 +129,20 @@
<string name="p_speedbrg_summary">Keep GPS on longer to get more precise data</string>
<string name="p_netloc">Use network location</string>
<string name="p_netloc_summary">Acquire position from the cellular network</string>
<string name="p__filter">Incoming Filter (TCP only)</string>
<string name="p_filterdist">Neighbor radius</string>
<string name="p_filterdist_summary">Receive packets from stations in this radius</string>
<string name="p_filterdist_entry">Radius around you to monitor for packets [km]</string>
<string name="p_afsk">AFSK Preferences</string>
<string name="p_http">HTTP Preferences</string>
<string name="p_udp">UDP Preferences</string>
<string name="p_tcp">TCP Preferences</string>
<!-- TCP server settings -->
<string name="p_tcp_server_summary">APRS-IS TCP server (port 14580) to contact</string>
<string name="p_filter">Message filter</string>
<string name="p_filter_hint">m/10 b/DO1GL*</string>
<string name="p_filter_default">m/10</string>
<string name="p_filter_summary">Filter for incoming packets</string>
<string name="p_filter_entry">Enter a filter for incoming messages ("m/10" filters 10km around own position)</string>
<string name="p_filterhelp">Message filter help</string>
<string name="p_filterhelp_summary">Online reference for APRS-IS filters</string>
</resources>

Wyświetl plik

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="TCP">
<EditTextPreference
android:key="host"
android:hint="@string/aprs_server"
android:inputType="textUri"
android:title="@string/p_host"
android:summary="@string/p_host_summary"
android:dialogTitle="@string/p_host_entry" />
</PreferenceCategory>
</PreferenceScreen>

Wyświetl plik

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="@string/p_tcp">
<EditTextPreference
android:key="tcp.server"
android:inputType="textUri"
android:title="@string/p_host"
android:summary="@string/p_tcp_server_summary"
android:hint="@string/p_host_hint"
android:defaultValue="@string/aprs_server"
android:dialogTitle="@string/p_host_entry" />
<EditTextPreference
android:key="tcp.filter"
android:title="@string/p_filter"
android:summary="@string/p_filter_summary"
android:hint="@string/p_filter_hint"
android:defaultValue="@string/p_filter_default"
android:dialogTitle="@string/p_filter_entry" />
<Preference
android:key="tcp.filter.help"
android:title="@string/p_filterhelp"
android:summary="@string/p_filterhelp_summary" >
<intent android:action="android.intent.action.VIEW"
android:data="http://www.aprs-is.net/javAPRSFilter.aspx" />
</Preference>
</PreferenceCategory>
</PreferenceScreen>

Wyświetl plik

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="@string/p_udp">
<EditTextPreference
android:key="udp.server"
android:defaultValue="@string/aprs_server"
android:hint="@string/p_host_hint"
android:inputType="textUri"
android:title="@string/p_host"
android:summary="@string/p_host_summary"
android:dialogTitle="@string/p_host_entry" />
</PreferenceCategory>
</PreferenceScreen>

Wyświetl plik

@ -37,6 +37,7 @@
android:summary="@string/p_ssid_summary"
android:entries="@array/p_ssid_e"
android:entryValues="@array/p_ssid_ev"
android:defaultValue=""
android:dialogTitle="@string/p_ssid_entry" />
<EditTextPreference
@ -44,6 +45,7 @@
android:hint="@string/default_symbol"
android:title="@string/p_symbol"
android:summary="@string/p_symbol_summary"
android:defaultValue="@string/default_symbol"
android:dialogTitle="@string/p_symbol_entry" />
<EditTextPreference
@ -85,19 +87,7 @@
</PreferenceCategory>
<PreferenceCategory
android:title="@string/p__filter">
<EditTextPreference
android:key="filterdist"
android:inputType="number"
android:title="@string/p_filterdist"
android:summary="@string/p_filterdist_summary"
android:dialogTitle="@string/p_filterdist_entry" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/p__network">
android:title="@string/p__connection">
<ListPreference
android:key="conntype"
@ -105,16 +95,18 @@
android:summary="@string/p_conntype_summary"
android:entries="@array/p_conntype_e"
android:entryValues="@array/p_conntype_ev"
android:defaultValue="@string/p_conntype_default"
android:dialogTitle="@string/p_conntype_entry" />
<EditTextPreference
android:key="host"
android:hint="@string/aprs_server"
android:inputType="textUri"
android:title="@string/p_host"
android:summary="@string/p_host_summary"
android:dialogTitle="@string/p_host_entry" />
<PreferenceScreen
android:title="@string/p_connsetup"
android:summary="@string/p_connsetup_summary">
<intent android:action="android.intent.action.MAIN"
android:targetPackage="de.duenndns.aprsdroid"
android:targetClass="de.duenndns.aprsdroid.BackendPrefs" />
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>

Wyświetl plik

@ -0,0 +1,12 @@
package de.duenndns.aprsdroid
import _root_.android.os.Bundle
import _root_.android.preference.{PreferenceActivity, PreferenceManager}
class BackendPrefs extends PreferenceActivity {
override def onCreate(savedInstanceState: Bundle) {
super.onCreate(savedInstanceState)
val prefs = PreferenceManager.getDefaultSharedPreferences(this)
addPreferencesFromResource(AprsIsUploader.instanciatePrefsAct(prefs))
}
}