use of org.odk.collect.android.application.Collect in project collect by opendatakit.
the class InstanceServerUploader method getServerSubmissionURL.
private String getServerSubmissionURL() {
Collect app = Collect.getInstance();
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(Collect.getInstance());
String serverBase = settings.getString(PreferenceKeys.KEY_SERVER_URL, app.getString(R.string.default_server_url));
if (serverBase.endsWith(URL_PATH_SEP)) {
serverBase = serverBase.substring(0, serverBase.length() - 1);
}
// NOTE: /submission must not be translated! It is the well-known path on the server.
String submissionPath = settings.getString(PreferenceKeys.KEY_SUBMISSION_URL, app.getString(R.string.default_odk_submission));
if (!submissionPath.startsWith(URL_PATH_SEP)) {
submissionPath = URL_PATH_SEP + submissionPath;
}
return serverBase + submissionPath;
}
Aggregations