# project structure.
# Project target.
-target=android-18
+target=android-19
<resources>
<!-- TODO: make URLs HTTPS -->
<string name="ou_library_url">http://bark.cwmars.org</string>
- <string name="ou_gateway_url">http://bark.cwmars.org/osrf-gateway-v1</string>
<string name="ou_app_name">C/W Mars Library</string>
<string name="ou_app_label">C/W Mars</string>
<string name="ou_app_welcome_label">Welcome</string>
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:key="first_preferencescreen">
- <PreferenceCategory
- android:summary="@string/preference_login_information"
- android:title="@string/preference_login_informantion_summary" >
- <EditTextPreference
- android:key="username"
- android:summary="@string/preference_username_summary"
- android:title="@string/preference_username" />
- <EditTextPreference
- android:key="password"
- android:summary="@string/preference_password_summary"
- android:title="@string/preference_password"
- android:inputType="textPassword"
- />
- </PreferenceCategory>
-
-
- <PreferenceCategory
- android:summary="@string/preference_server_information_summary"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <PreferenceCategory
android:title="@string/preference_server_information_title" >
<EditTextPreference
android:key="library_url"
android:summary="@string/preference_library_url_address_summary"
- android:title="@string/preference_library_url_address" />
-
+ android:title="@string/preference_library_url_address"
+ android:defaultValue="@string/ou_library_url"/>
</PreferenceCategory>
<PreferenceCategory
- android:title="@string/preference_notifications_title" >
+ android:title="@string/preference_notifications_title" >
<PreferenceScreen
android:key="NotificationsPrefScreen"
@Override
public void onClick(View v) {
- final String name = bookbag_name.getText().toString();
+ final String name = bookbag_name.getText().toString();
- Thread createBookbag = new Thread(new Runnable() {
- @Override
- public void run() {
-
- if (name.length() > 1) {
+ Thread createBookbag = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ if (name.length() > 1) {
+ try {
+ accountAccess.createBookbag(name);
+ } catch (SessionNotFoundException e) {
try {
- accountAccess.createBookbag(name);
- } catch (SessionNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NoNetworkAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NoAccessToServer e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ if (accountAccess.reauthenticate(BookbagsListView.this))
+ accountAccess.createBookbag(name);
+ } catch (Exception eauth) {
+ System.out.println("Exception in reAuth");
}
-
- runOnUiThread(new Runnable() {
- @Override
- public void run() {
- progressDialog.dismiss();
- }
- });
-
- Thread getBookBags = new Thread(getBookbagsRunnable);
- getBookBags.start();
}
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ progressDialog.dismiss();
+ }
+ });
+
+ Thread getBookBags = new Thread(getBookbagsRunnable);
+ getBookBags.start();
}
- });
+ }
+ });
- if (name.length() > 1) {
- progressDialog = ProgressDialog.show(context,
- "Please wait", "Creating Bookbag");
- createBookbag.start();
- } else
- Toast.makeText(context,
- "Bookbag name must be at least 2 characters long",
- Toast.LENGTH_SHORT).show();
+ if (name.length() > 1) {
+ progressDialog = ProgressDialog.show(context,
+ "Please wait", "Creating Bookbag");
+ createBookbag.start();
+ } else
+ Toast.makeText(context,
+ "Bookbag name must be at least 2 characters long",
+ Toast.LENGTH_SHORT).show();
}
});
try {
accountAccess.retrieveBookbags();
- bookBags = accountAccess.getBookbags();
-
- } catch (NoNetworkAccessException e) {
- Utils.showSessionNotAvailableDialog(context);
- } catch (NoAccessToServer e) {
- Utils.showServerNotAvailableDialog(context);
-
} catch (SessionNotFoundException e) {
- // TODO other way?
try {
- if (accountAccess.authenticate())
- accountAccess.getBookbags();
+ if (accountAccess.reauthenticate(BookbagsListView.this))
+ accountAccess.retrieveBookbags();
} catch (Exception eauth) {
System.out.println("Exception in reAuth");
}
}
+ bookBags = accountAccess.getBookbags();
runOnUiThread(new Runnable() {
public class ItemsCheckOutListView extends Activity {
- private String TAG = "ItemsCheckOutListView";
+ private String TAG = ItemsCheckOutListView.class.getName();
private AccountAccess accountAccess = null;
try {
circRecords = accountAccess.getItemsCheckedOut();
- } catch (NoNetworkAccessException e) {
- Utils.showSessionNotAvailableDialog(context);
- } catch (NoAccessToServer e) {
- Utils.showServerNotAvailableDialog(context);
-
} catch (SessionNotFoundException e) {
- // TODO other way?
try {
-
- Log.d(TAG, "REAUTH " + "in process");
-
- if (accountAccess.authenticate())
+ if (accountAccess.reauthenticate(ItemsCheckOutListView.this))
circRecords = accountAccess.getItemsCheckedOut();
} catch (Exception eauth) {
- System.out.println("Exception in reAuth");
+ Log.d(TAG, "Exception in reauth", eauth);
}
}
// Get item
final CircRecord record = getItem(position);
- // if it is the right type of view
- if (row == null) {
-
- Log.d(tag, "Starting XML Row Inflation ... ");
- LayoutInflater inflater = (LayoutInflater) this
- .getContext().getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
- row = inflater.inflate(R.layout.checkout_list_item, parent,
- false);
- Log.d(tag, "Successfully completed XML Row Inflation!");
-
- }
+ // if it is the right type of view
+ if (row == null) {
- // Get reference to TextView - title
- recordTitle = (TextView) row
- .findViewById(R.id.checkout_record_title);
+ Log.d(tag, "Starting XML Row Inflation ... ");
+ LayoutInflater inflater = (LayoutInflater) this
+ .getContext().getSystemService(
+ Context.LAYOUT_INFLATER_SERVICE);
+ row = inflater.inflate(R.layout.checkout_list_item, parent,
+ false);
+ Log.d(tag, "Successfully completed XML Row Inflation!");
- // Get reference to TextView - author
- recordAuthor = (TextView) row
- .findViewById(R.id.checkout_record_author);
-
- // Get reference to TextView - record Publisher date+publisher
- recordDueDate = (TextView) row
- .findViewById(R.id.checkout_due_date);
-
- renewButton = (TextView) row.findViewById(R.id.renew_button);
-
- renewButton.setText("renew : " + record.getRenewals());
-
- renewButton.setOnClickListener(new OnClickListener() {
+ }
- @Override
- public void onClick(View v) {
+ // Get reference to TextView - title
+ recordTitle = (TextView) row
+ .findViewById(R.id.checkout_record_title);
+
+ // Get reference to TextView - author
+ recordAuthor = (TextView) row
+ .findViewById(R.id.checkout_record_author);
+
+ // Get reference to TextView - record Publisher date+publisher
+ recordDueDate = (TextView) row
+ .findViewById(R.id.checkout_due_date);
+
+ renewButton = (TextView) row.findViewById(R.id.renew_button);
+
+ renewButton.setText("renew : " + record.getRenewals());
+
+ renewButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Thread renew = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ boolean refresh = true;
+ AccountAccess ac = AccountAccess
+ .getAccountAccess();
+
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ progressDialog = new ProgressDialog(
+ context);
+ progressDialog
+ .setMessage("Renewing item");
+ progressDialog.show();
+ }
+ });
- Thread renew = new Thread(new Runnable() {
+ try {
+ ac.renewCirc(record.getTargetCopy());
+ } catch (MaxRenewalsException e1) {
+ runOnUiThread(new Runnable() {
- @Override
- public void run() {
- boolean refresh = true;
- AccountAccess ac = AccountAccess
- .getAccountAccess();
+ @Override
+ public void run() {
+ progressDialog.dismiss();
+ Toast.makeText(context,
+ "Max renewals reached",
+ Toast.LENGTH_LONG).show();
+ }
+ });
+ refresh = false;
+ } catch (ServerErrorMessage error) {
+ final String errorMessage = error.message;
runOnUiThread(new Runnable() {
+
@Override
public void run() {
- progressDialog = new ProgressDialog(
- context);
- progressDialog
- .setMessage("Renewing item");
- progressDialog.show();
+ progressDialog.dismiss();
+ Toast.makeText(context,
+ errorMessage,
+ Toast.LENGTH_LONG).show();
}
});
-
+ } catch (SessionNotFoundException e1) {
try {
- ac.renewCirc(record.getTargetCopy());
- } catch (MaxRenewalsException e1) {
- runOnUiThread(new Runnable() {
-
- @Override
- public void run() {
- progressDialog.dismiss();
- Toast.makeText(context,
- "Max renewals reached",
- Toast.LENGTH_LONG).show();
- }
- });
-
- refresh = false;
- } catch (ServerErrorMessage error) {
-
- final String errorMessage = error.message;
- runOnUiThread(new Runnable() {
+ if (accountAccess.reauthenticate(ItemsCheckOutListView.this))
+ ac.renewCirc(record.getTargetCopy());
+ } catch (Exception eauth) {
+ Log.d(TAG, "Exception in reauth", eauth);
+ }
+ }
- @Override
- public void run() {
- progressDialog.dismiss();
- Toast.makeText(context,
- errorMessage,
- Toast.LENGTH_LONG).show();
- }
- });
- } catch (SessionNotFoundException e1) {
+ if (refresh) {
+ try {
+ circRecords = accountAccess.getItemsCheckedOut();
+ } catch (SessionNotFoundException e) {
try {
- if (accountAccess.authenticate())
- ac.renewCirc(record.getTargetCopy());
+ if (accountAccess.reauthenticate(ItemsCheckOutListView.this))
+ circRecords = accountAccess.getItemsCheckedOut();
} catch (Exception eauth) {
- System.out
- .println("Exception in reAuth");
+ Log.d(TAG, "Exception in reauth", eauth);
}
- } catch (NoNetworkAccessException e1) {
- Utils.showSessionNotAvailableDialog(context);
- } catch (NoAccessToServer e1) {
- Utils.showServerNotAvailableDialog(context);
}
- if (refresh) {
-
- try {
- circRecords = accountAccess
- .getItemsCheckedOut();
- } catch (NoNetworkAccessException e) {
- Utils.showSessionNotAvailableDialog(context);
- } catch (NoAccessToServer e) {
- Utils.showServerNotAvailableDialog(context);
-
- } catch (SessionNotFoundException e) {
- // TODO other way?
- try {
- if (accountAccess.authenticate())
- circRecords = accountAccess
- .getItemsCheckedOut();
- } catch (Exception eauth) {
- System.out
- .println("Exception in reAuth");
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ listAdapter.clear();
+ for (int i = 0; i < circRecords.size(); i++) {
+ listAdapter.add(circRecords.get(i));
}
+ progressDialog.dismiss();
+ listAdapter.notifyDataSetChanged();
}
-
- runOnUiThread(new Runnable() {
-
- @Override
- public void run() {
- listAdapter.clear();
- for (int i = 0; i < circRecords
- .size(); i++) {
- listAdapter.add(circRecords
- .get(i));
- }
-
- progressDialog.dismiss();
- listAdapter.notifyDataSetChanged();
- }
- });
- }
+ });
}
- });
-
- renew.start();
- }
- });
+ }
+ });
- // set text
- System.out.println("Row" + record.getTitle() + " "
- + record.getAuthor() + " " + record.getDueDate() + " "
- + record.getRenewals());
- recordTitle.setText(record.getTitle());
- recordAuthor.setText(record.getAuthor());
- recordDueDate.setText(record.getDueDate());
+ renew.start();
+ }
+ });
+
+ // set text
+ recordTitle.setText(record.getTitle());
+ recordAuthor.setText(record.getAuthor());
+ recordDueDate.setText(record.getDueDate());
+ Log.d(TAG, "title: " + record.getTitle());
+ Log.d(TAG, "author: " + record.getAuthor());
+ Log.d(TAG, "due: " + record.getDueDate());
+ Log.d(TAG, "renew: " + record.getRenewals());
return row;
}
} catch (Exception eauth) {
System.out.println("Exception in reauth");
}
- } catch (NoNetworkAccessException e) {
- Utils.showSessionNotAvailableDialog(context);
- } catch (NoAccessToServer e) {
- Utils.showServerNotAvailableDialog(context);
}
runOnUiThread(new Runnable() {
holdsNoText.setText(" " + listAdapter.getCount());
progressDialog.dismiss();
listAdapter.notifyDataSetChanged();
-
}
});
}
};
- // 1 NPE
- if (accountAccess.isAuthenticated()) {
- progressDialog = new ProgressDialog(context);
- progressDialog.setMessage("Loading holds");
- progressDialog.show();
+ progressDialog = new ProgressDialog(context);
+ progressDialog.setMessage("Loading holds");
+ progressDialog.show();
- // thread to retrieve holds
- Thread getHoldsThread = new Thread(getHoldsRunnable);
- getHoldsThread.start();
-
- } else
- Toast.makeText(context,
- "You must be authenticated to retrieve circ records",
- Toast.LENGTH_LONG);
+ // thread to retrieve holds
+ Thread getHoldsThread = new Thread(getHoldsRunnable);
+ getHoldsThread.start();
lv.setOnItemClickListener(new OnItemClickListener() {
switch (resultCode) {
- case HoldDetails.RESULT_CODE_CANCEL: {
+ case HoldDetails.RESULT_CODE_CANCEL:
// nothing
Log.d(TAG, "Do nothing");
- }
break;
- case HoldDetails.RESULT_CODE_DELETE_HOLD: {
+ case HoldDetails.RESULT_CODE_DELETE_HOLD:
+ case HoldDetails.RESULT_CODE_UPDATE_HOLD:
// refresh ui
progressDialog = new ProgressDialog(context);
progressDialog.setMessage("Loading holds");
// thread to retrieve holds
Thread getHoldsThread = new Thread(getHoldsRunnable);
getHoldsThread.start();
- Log.d(TAG, "Update on delete hold");
- }
+ Log.d(TAG, "Update on result "+resultCode);
break;
-
- case HoldDetails.RESULT_CODE_UPDATE_HOLD: {
- // refresh ui
- progressDialog = new ProgressDialog(context);
- progressDialog.setMessage("Loading holds");
- progressDialog.show();
- // thread to retrieve holds
- Thread getHoldsThread = new Thread(getHoldsRunnable);
- getHoldsThread.start();
- Log.d(TAG, "Update on update hold");
- }
- break;
-
}
}
long duration_ms = System.currentTimeMillis() - start_ms;
Log.d(TAG, "loadIDLFile parse took "+duration_ms+"ms");
} catch (Exception e) {
- Log.e(TAG, "Error in parsing IDL file", e);
+ Log.w(TAG, "Error in parsing IDL file", e);
}
- ;
loadedIDL = true;
}
import java.util.ArrayList;
import org.evergreen.android.R;
+import org.evergreen.android.accountAccess.SessionNotFoundException;
import org.evergreen.android.globals.Utils;
import org.evergreen.android.utils.ui.BaseSampleActivity;
import org.evergreen.android.utils.ui.BasicDetailsFragment;
}
});
- try {
- searchRecords = search.getSearchResults(search.searchText,
- records.size());
- } catch (NoNetworkAccessException e) {
- runOnUiThread(Utils
- .showSessionNotAvailableDialog(context));
- } catch (NoAccessToServer e) {
- runOnUiThread(Utils
- .showServerNotAvailableDialog(context));
- }
+ searchRecords = search.getSearchResults(search.searchText, records.size());
runOnUiThread(new Runnable() {
@Override
public void run() {
-
// don't clear record list
// recordList.clear();
if (searchRecords.size() > 0) {
// serialize object and pass it to next activity
intent.putExtra("recordInfo", info);
intent.putExtra("orgID", search.selectedOrganization.id);
- intent.putExtra("depth",
- (search.selectedOrganization.level - 1));
-
+ intent.putExtra("depth", (search.selectedOrganization.level - 1));
intent.putExtra("recordList", recordList);
intent.putExtra("recordPosition", position);
startActivityForResult(intent, 10);
if (!loadingElements) {
+ /*
Log.d(TAG, " Scroll adapter " + totalItemCount + " "
+ visibleItemCount + " " + firstVisibleItem + " "
+ adapter.getCount() + " " + search.visible);
+ */
if (totalItemCount > 0
&& (((totalItemCount - visibleItemCount) <= (firstVisibleItem)) && adapter
.getCount() < search.visible)) {
import java.util.Date;
import java.util.List;
+import android.accounts.AccountManager;
+import android.accounts.AccountManagerFuture;
+import android.os.Bundle;
import org.androwrapee.db.DefaultDAO;
import org.evergreen.android.accountAccess.AccountAccess;
import org.evergreen.android.accountAccess.SessionNotFoundException;
import org.evergreen.android.database.DatabaseManager;
import org.evergreen.android.globals.GlobalConfigs;
import org.evergreen.android.globals.Utils;
+import org.evergreen_ils.auth.Const;
import org.open_ils.idl.IDLParser;
import android.app.AlarmManager;
public static Date lastUpdateServiceDate;
- public static String TAG = "ScheduledIntentService";
+ public static String TAG = ScheduledIntentService.class.getName();
- public static String ACTION = "org.evergreen.updateservice";
+ public static String ACTION = "org.evergreen_ils.updateservice";
// fire up once a day
public static int SCHEDULE_TIME_INTERVAL = 1;
return super.onStartCommand(intent, flags, startId);
}
+ //TODO: share some of this code with LoadingTask.doInBackground
+ //TODO: this code needs major work. I never saw it work so I don't
+ // feel bad about disabling it for now.
@Override
protected void onHandleIntent(Intent intent) {
String idlFile = GlobalConfigs.IDL_FILE_FROM_ROOT
+ "?class=circ&class=au&class=mvr&class=acp";
try {
- Log.d("debug", "Read fm");
- InputStream in_IDL = Utils
- .getNetInputStream(GlobalConfigs.httpAddress + idlFile);
+ Log.d(TAG, "Load IDL start");
+ InputStream in_IDL = Utils.getNetInputStream(GlobalConfigs.httpAddress + idlFile);
IDLParser parser = new IDLParser(in_IDL);
+ parser.setKeepIDLObjects(false);
parser.parse();
} catch (Exception e) {
- System.err.println("Error in parsing IDL file " + idlFile + " "
- + e.getMessage());
+ Log.w("Error in parsing IDL", e);
}
- ;
- // login with the user credentials
+ /*
AccountAccess accountAccess = AccountAccess.getAccountAccess(GlobalConfigs.httpAddress);
- boolean auth = true;
- try {
- accountAccess.authenticate();
- } catch (Exception e) {
- auth = false;
- e.printStackTrace();
- }
-
- // if we managed to authenticate we start
+ Log.d(TAG, tag+"Signing in");
+ AccountManager accountManager = AccountManager.get(this);
+
+ // what needs to be done is
+ // 1. get last used account name
+ // 2. see if the account still exists
+ // 3. get an auth token for it
+ // 4. start an evergreen session
+ AccountManagerFuture<Bundle> future = accountManager.getAuthTokenByFeatures(Const.ACCOUNT_TYPE, Const.AUTHTOKEN_TYPE, null, mCallingActivity, null, null, null, null);
+ Bundle bnd = future.getResult();
+ String auth_token = bnd.getString(AccountManager.KEY_AUTHTOKEN);
+ String account_name = bnd.getString(AccountManager.KEY_ACCOUNT_NAME);
+ Log.d(TAG, tag+"account_name="+account_name+" token="+auth_token);
+
+ boolean auth = false;
if (auth) {
SharedPreferences sharedPreferences = PreferenceManager
Log.d(TAG, "set last service update date " + lastUpdateServiceDate);
}
-
+ */
}
-
}
@Override
public void run() {
-
- boolean routeToAddress = true;
- AccountAccess account = AccountAccess.getAccountAccess(GlobalConfigs.httpAddress);
-
- if (routeToAddress) {
- try {
- if (account.authenticate()) {
-
- runOnUiThread(new Runnable() {
-
- @Override
- public void run() {
- if (reference != null) {
- progressDialog.dismiss();
- Toast.makeText(
- context,
- "Autenthication successfully established :"
- + GlobalConfigs.httpAddress,
- Toast.LENGTH_LONG).show();
- }
- }
- });
- } else {
- runOnUiThread(new Runnable() {
-
- @Override
- public void run() {
- if (reference != null) {
- progressDialog.dismiss();
- Toast.makeText(
- context,
- "Please check username and password ",
- Toast.LENGTH_LONG).show();
- }
- }
- });
- }
-
- } catch (Exception e) {
- }
-
- } else
- runOnUiThread(new Runnable() {
-
- @Override
- public void run() {
- if (reference != null)
- progressDialog.dismiss();
- }
- });
}
});
boolean checkConnection = false;
- if (key.equals("username")) {
- AccountAccess.userName = sharedPreferences
- .getString("username", "");
- checkConnection = true;
- } else if (key.equals("library_url")) {
+ if (key.equals("library_url")) {
checkConnection = true;
GlobalConfigs.httpAddress = sharedPreferences.getString(
"library_url", "");
// cancel the service
am.cancel(sender);
}
- // register the
-
- }
-
- // test connection
- if (!isFinishing() && httpAddressChange == false
- && checkConnection == true) {
- progressDialog = ProgressDialog
- .show(this, "Account login",
- "Signing in with new credentials");
-
- connectionThread.start();
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
- // TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.configure_application);
context = this;
server_http = (EditText) findViewById(R.id.server_http_adress);
- username = (EditText) findViewById(R.id.username);
- password = (EditText) findViewById(R.id.password);
-
-
- SharedPreferences preferences = PreferenceManager
- .getDefaultSharedPreferences(context);
- username.setText(preferences.getString("username", ""));
- server_http.setText(preferences.getString("library_url", "https://bark.cwmars.org"));
- password.setText(preferences.getString("password", ""));
-
+
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
+ server_http.setText(preferences.getString("library_url", "https://bark.cwmars.org"));
+
Button connect = (Button) findViewById(R.id.connect_button);
connect.setOnClickListener(new OnClickListener() {
.getText().toString());
if (server_address == true) {
-
- SharedPreferences preferences = PreferenceManager
- .getDefaultSharedPreferences(context);
- SharedPreferences.Editor editor = preferences
- .edit();
- // store into preference
- editor.putString("library_url", server_http
- .getText().toString());
-
- editor.putString("username", username.getText()
- .toString());
- editor.putString("password", password.getText()
- .toString());
-
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
+ SharedPreferences.Editor editor = preferences.edit();
+ editor.putString("library_url", server_http.getText().toString());
editor.commit();
- GlobalConfigs.httpAddress = server_http.getText()
- .toString();
+ GlobalConfigs.httpAddress = server_http.getText().toString();
AccountAccess accountAccess = AccountAccess.getAccountAccess(GlobalConfigs.httpAddress);
try {
- auth = accountAccess.authenticate();
- Log.d(TAG, "Auth " + auth);
+ auth = accountAccess.reauthenticate(ConfigureApplicationActivity.this);
} catch (Exception e) {
- System.out.println("Exception "
- + e.getMessage());
+ Log.w(TAG, "caught", e);
}
if (auth == true) {
-
runOnUiThread(new Runnable() {
@Override
progressDialog.dismiss();
setResult(RESULT_CONFIGURE_SUCCESS);
finish();
-
}
});
Toast.LENGTH_LONG).show();
}
});
-
}
-
}
});
}
});
-
}
-
}
});
}
+ //TODO: share some of this code with ScheduledIntentService.onHandleIntent
protected String doInBackground() {
final String tag ="doInBackground> ";
Log.d(TAG, tag);
HttpConnection conn;
try {
- conn = new HttpConnection(context.getString(R.string.ou_gateway_url));
+ conn = new HttpConnection(context.getString(R.string.ou_library_url) + "/osrf-gateway-v1");
} catch (MalformedURLException e) {
throw new AuthenticationException(e);
}