Add a AppRTCDemo setting to change the GAE server.

BUG=4041
R=tkchin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36599004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7966 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
jiayl@webrtc.org 2014-12-19 17:32:14 +00:00
parent 5570769210
commit a6f7ba6848
4 changed files with 23 additions and 6 deletions

View File

@ -60,5 +60,9 @@
<string name="pref_value_enabled">Enabled</string>
<string name="pref_value_disabled">Disabled</string>
<string name="pref_room_server_url_key">room_server_url_preference</string>
<string name="pref_room_server_url_title">Room server URL.</string>
<string name="pref_room_server_url_dlg">Enter a room server URL.</string>
<string name="pref_room_server_url_default">https://apprtc.appspot.com</string>
</resources>

View File

@ -43,4 +43,10 @@
android:dialogTitle="@string/pref_cpu_usage_detection_dlg"
android:defaultValue="@string/pref_cpu_usage_detection_default" />
<EditTextPreference
android:key="@string/pref_room_server_url_key"
android:title="@string/pref_room_server_url_title"
android:inputType="text"
android:defaultValue="@string/pref_room_server_url_default"
android:dialogTitle="@string/pref_room_server_url_dlg" />
</PreferenceScreen>

View File

@ -71,7 +71,6 @@ public class ConnectActivity extends Activity {
public static final String EXTRA_HWCODEC = "org.appspot.apprtc.HWCODEC";
public static final String EXTRA_WEBSOCKET = "org.appspot.apprtc.WEBSOCKET";
private static final String TAG = "ConnectRTCClient";
private final String APPRTC_SERVER = "https://apprtc.appspot.com";
private final int CONNECTION_REQUEST = 1;
private static boolean commandLineRun = false;
@ -88,6 +87,7 @@ public class ConnectActivity extends Activity {
private String keyprefBitrateValue;
private String keyprefHwCodec;
private String keyprefCpuUsageDetection;
private String keyprefRoomServerUrl;
private String keyprefRoom;
private String keyprefRoomList;
private ArrayList<String> roomList;
@ -106,6 +106,7 @@ public class ConnectActivity extends Activity {
keyprefBitrateValue = getString(R.string.pref_startbitratevalue_key);
keyprefHwCodec = getString(R.string.pref_hwcodec_key);
keyprefCpuUsageDetection = getString(R.string.pref_cpu_usage_detection_key);
keyprefRoomServerUrl = getString(R.string.pref_room_server_url_key);
keyprefRoom = getString(R.string.pref_room_key);
keyprefRoomList = getString(R.string.pref_room_list_key);
@ -252,8 +253,10 @@ public class ConnectActivity extends Activity {
}
}
String url;
url = APPRTC_SERVER + "/register/" + roomName;
String url = sharedPref.getString(
keyprefRoomServerUrl,
getString(R.string.pref_room_server_url_default));
url = url + "/register/" + roomName;
// Check HW codec flag.
boolean hwCodec = sharedPref.getBoolean(keyprefHwCodec,

View File

@ -43,6 +43,7 @@ public class SettingsActivity extends Activity
private String keyprefHwCodec;
private String keyprefCpuUsageDetection;
private String keyprefSignaling;
private String keyPrefRoomServerUrl;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -53,6 +54,7 @@ public class SettingsActivity extends Activity
keyprefStartBitrateValue = getString(R.string.pref_startbitratevalue_key);
keyprefHwCodec = getString(R.string.pref_hwcodec_key);
keyprefCpuUsageDetection = getString(R.string.pref_cpu_usage_detection_key);
keyPrefRoomServerUrl = getString(R.string.pref_room_server_url_key);
// Display the fragment as the main content.
settingsFragment = new SettingsFragment();
@ -71,6 +73,7 @@ public class SettingsActivity extends Activity
updateSummary(sharedPreferences, keyprefResolution);
updateSummary(sharedPreferences, keyprefFps);
updateSummary(sharedPreferences, keyprefStartBitrateType);
updateSummary(sharedPreferences, keyPrefRoomServerUrl);
updateSummaryBitrate(sharedPreferences, keyprefStartBitrateValue);
setBitrateEnable(sharedPreferences);
updateSummaryB(sharedPreferences, keyprefHwCodec);
@ -89,8 +92,10 @@ public class SettingsActivity extends Activity
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
String key) {
if (key.equals(keyprefResolution) || key.equals(keyprefFps) ||
key.equals(keyprefStartBitrateType)) {
if (key.equals(keyprefResolution) ||
key.equals(keyprefFps) ||
key.equals(keyprefStartBitrateType) ||
key.equals(keyPrefRoomServerUrl)) {
updateSummary(sharedPreferences, key);
} else if (key.equals(keyprefStartBitrateValue)) {
updateSummaryBitrate(sharedPreferences, key);
@ -134,5 +139,4 @@ public class SettingsActivity extends Activity
bitratePreferenceValue.setEnabled(true);
}
}
}