add new pref for relay's proxy/device port

This commit is contained in:
Andy2 2010-09-28 06:43:04 -07:00
parent 1de029f3f0
commit 39827ec894
4 changed files with 22 additions and 3 deletions

View file

@ -28,6 +28,7 @@
<string name="key_clr_crosshairs">key_clr_crosshairs</string>
<string name="key_relay_host">key_relay_host</string>
<string name="key_relay_port">key_relay_port</string>
<string name="key_proxy_port">key_proxy_port</string>
<string name="key_sms_port">key_sms_port</string>
<string name="key_dict_host">key_dict_host</string>
<string name="key_board_size">key_board_size</string>

View file

@ -287,7 +287,8 @@
<string name="advanced_summary">You may never need these...</string>
<string name="relay_host">Relay address</string>
<string name="dict_host">Dictionary download URL</string>
<string name="relay_port">Relay port</string>
<string name="relay_port">Relay game port</string>
<string name="proxy_port">Relay device port</string>
<string name="sms_port">SMS port</string>
<string name="sms_phone_label">sms_phone_label</string>

View file

@ -182,6 +182,11 @@
android:defaultValue="10999"
android:numeric="decimal"
/>
<EditTextPreference android:key="@string/key_proxy_port"
android:title="@string/proxy_port"
android:defaultValue="10998"
android:numeric="decimal"
/>
<!-- <EditTextPreference android:key="@string/key_sms_port" -->
<!-- android:title="@string/sms_port" -->
<!-- android:defaultValue="5432" -->

View file

@ -145,10 +145,22 @@ public class CommonPrefs {
String val = getString( context, R.string.key_relay_port );
int result = 0;
try {
return Integer.parseInt( val );
result = Integer.parseInt( val );
} catch ( Exception ex ) {
return 0;
}
return result;
}
public static int getDefaultProxyPort( Context context )
{
String val = getString( context, R.string.key_proxy_port );
int result = 0;
try {
result = Integer.parseInt( val );
} catch ( Exception ex ) {
}
Utils.logf( "getDefaultProxyPort=>%d", result );
return result;
}
public static String getDefaultDictURL( Context context )