kopia lustrzana https://github.com/ge0rg/aprsdroid
				
				
				
			preferences for backends
							rodzic
							
								
									8a0eecba8a
								
							
						
					
					
						commit
						79b5b09db6
					
				|  | @ -20,11 +20,13 @@ | ||||||
|                 <category android:name="android.intent.category.LAUNCHER" /> |                 <category android:name="android.intent.category.LAUNCHER" /> | ||||||
|             </intent-filter> |             </intent-filter> | ||||||
|         </activity> |         </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" |         <activity android:name=".MapAct" android:label="@string/app_map" | ||||||
| 		android:theme="@android:style/Theme.NoTitleBar" > | 		android:theme="@android:style/Theme.NoTitleBar" > | ||||||
|             <intent-filter> |             <intent-filter> | ||||||
|                 <action android:name="android.intent.action.MAIN" /> |                 <action android:name="android.intent.action.MAIN" /> | ||||||
|  | 		<category android:name="android.intent.category.DEFAULT" /> | ||||||
|             </intent-filter> |             </intent-filter> | ||||||
| 	</activity> | 	</activity> | ||||||
| 	<service android:name=".AprsService"> | 	<service android:name=".AprsService"> | ||||||
|  |  | ||||||
|  | @ -5,5 +5,6 @@ | ||||||
| 
 | 
 | ||||||
| <string name="default_status">http://aprsdroid.org/</string> | <string name="default_status">http://aprsdroid.org/</string> | ||||||
| <string name="default_symbol">/$</string> | <string name="default_symbol">/$</string> | ||||||
|  | <string name="p_conntype_default" value="tcp" /> | ||||||
| 
 | 
 | ||||||
| </resources> | </resources> | ||||||
|  |  | ||||||
|  | @ -101,10 +101,12 @@ | ||||||
| <string name="p_status">Status message</string> | <string name="p_status">Status message</string> | ||||||
| <string name="p_status_summary">The text after your coordinates</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_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">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_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 --> | <!-- array of connection types --> | ||||||
| <string-array name="p_conntype_e"> | <string-array name="p_conntype_e"> | ||||||
| 	<item>UDP port 8080</item> | 	<item>UDP port 8080</item> | ||||||
|  | @ -115,6 +117,7 @@ | ||||||
| <string name="p_host">Server</string> | <string name="p_host">Server</string> | ||||||
| <string name="p_host_summary">APRS-IS server (port 8080) to send beacons</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_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__location">Location Settings</string> | ||||||
| <string name="p_interval">Minimum update time</string> | <string name="p_interval">Minimum update time</string> | ||||||
| <string name="p_interval_summary">Minutes between beacon transmissions</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_speedbrg_summary">Keep GPS on longer to get more precise data</string> | ||||||
| <string name="p_netloc">Use network location</string> | <string name="p_netloc">Use network location</string> | ||||||
| <string name="p_netloc_summary">Acquire position from the cellular network</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_afsk">AFSK Preferences</string> | ||||||
| <string name="p_filterdist_summary">Receive packets from stations in this radius</string> | <string name="p_http">HTTP Preferences</string> | ||||||
| <string name="p_filterdist_entry">Radius around you to monitor for packets [km]</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> | </resources> | ||||||
|  |  | ||||||
|  | @ -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> | ||||||
|  | 
 | ||||||
|  | @ -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> | ||||||
|  | 
 | ||||||
|  | @ -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> | ||||||
|  | 
 | ||||||
|  | @ -37,6 +37,7 @@ | ||||||
| 		android:summary="@string/p_ssid_summary" | 		android:summary="@string/p_ssid_summary" | ||||||
|                 android:entries="@array/p_ssid_e" |                 android:entries="@array/p_ssid_e" | ||||||
|                 android:entryValues="@array/p_ssid_ev" |                 android:entryValues="@array/p_ssid_ev" | ||||||
|  | 		android:defaultValue="" | ||||||
| 		android:dialogTitle="@string/p_ssid_entry" /> | 		android:dialogTitle="@string/p_ssid_entry" /> | ||||||
| 
 | 
 | ||||||
|         <EditTextPreference |         <EditTextPreference | ||||||
|  | @ -44,6 +45,7 @@ | ||||||
| 		android:hint="@string/default_symbol" | 		android:hint="@string/default_symbol" | ||||||
| 		android:title="@string/p_symbol" | 		android:title="@string/p_symbol" | ||||||
| 		android:summary="@string/p_symbol_summary" | 		android:summary="@string/p_symbol_summary" | ||||||
|  | 		android:defaultValue="@string/default_symbol" | ||||||
| 		android:dialogTitle="@string/p_symbol_entry" /> | 		android:dialogTitle="@string/p_symbol_entry" /> | ||||||
| 
 | 
 | ||||||
|         <EditTextPreference |         <EditTextPreference | ||||||
|  | @ -85,19 +87,7 @@ | ||||||
|     </PreferenceCategory> |     </PreferenceCategory> | ||||||
|                  |                  | ||||||
|     <PreferenceCategory |     <PreferenceCategory | ||||||
| 	android:title="@string/p__filter"> | 	android:title="@string/p__connection"> | ||||||
| 
 |  | ||||||
|         <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"> |  | ||||||
| 
 | 
 | ||||||
|         <ListPreference |         <ListPreference | ||||||
|                 android:key="conntype" |                 android:key="conntype" | ||||||
|  | @ -105,16 +95,18 @@ | ||||||
| 		android:summary="@string/p_conntype_summary" | 		android:summary="@string/p_conntype_summary" | ||||||
|                 android:entries="@array/p_conntype_e" |                 android:entries="@array/p_conntype_e" | ||||||
|                 android:entryValues="@array/p_conntype_ev" |                 android:entryValues="@array/p_conntype_ev" | ||||||
|  | 		android:defaultValue="@string/p_conntype_default" | ||||||
| 		android:dialogTitle="@string/p_conntype_entry" /> | 		android:dialogTitle="@string/p_conntype_entry" /> | ||||||
| 
 | 
 | ||||||
|         <EditTextPreference |         <PreferenceScreen | ||||||
|                 android:key="host" | 		android:title="@string/p_connsetup" | ||||||
| 		android:hint="@string/aprs_server" | 		android:summary="@string/p_connsetup_summary"> | ||||||
| 		android:inputType="textUri" |  | ||||||
| 		android:title="@string/p_host" |  | ||||||
| 		android:summary="@string/p_host_summary" |  | ||||||
| 		android:dialogTitle="@string/p_host_entry" /> |  | ||||||
| 
 | 
 | ||||||
|  |             <intent android:action="android.intent.action.MAIN" | ||||||
|  |                     android:targetPackage="de.duenndns.aprsdroid" | ||||||
|  |                     android:targetClass="de.duenndns.aprsdroid.BackendPrefs" /> | ||||||
|  | 
 | ||||||
|  |         </PreferenceScreen> | ||||||
|     </PreferenceCategory> |     </PreferenceCategory> | ||||||
| 
 | 
 | ||||||
| </PreferenceScreen> | </PreferenceScreen> | ||||||
|  |  | ||||||
|  | @ -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)) | ||||||
|  | 	} | ||||||
|  | } | ||||||
		Ładowanie…
	
		Reference in New Issue
	
	 Georg Lukas
						Georg Lukas