← Back to team overview

openlp-android team mailing list archive

[Merge] lp:~johanmynhardt/openlp/android into lp:openlp/android

 

Johan Mynhardt has proposed merging lp:~johanmynhardt/openlp/android into lp:openlp/android.

Requested reviews:
  Tim Bentley (trb143)
  Jonathan Corwin (j-corwin)

For more details, see:
https://code.launchpad.net/~johanmynhardt/openlp/android/+merge/59897

Removed author and version strings.
Added copyright (without new authors) to classes in utility package.
-- 
https://code.launchpad.net/~johanmynhardt/openlp/android/+merge/59897
Your team OpenLP Android Developers is subscribed to branch lp:openlp/android.
=== modified file '.bzrignore'
--- .bzrignore	2011-04-25 19:50:28 +0000
+++ .bzrignore	2011-05-04 10:36:21 +0000
@@ -1,3 +1,8 @@
 bin/
 assets/
-gen/
\ No newline at end of file
+gen/
+.idea
+out
+Openlp-android.iml
+Openlp-android-working.iml
+.classpath

=== modified file '.classpath'
--- .classpath	2011-03-23 21:33:28 +0000
+++ .classpath	2011-05-04 10:36:21 +0000
@@ -3,6 +3,5 @@
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="src" path="gen"/>
 	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-	<classpathentry kind="lib" path="/home/samme/workspace/android/google-gson-1.6-release.zip"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

=== modified file 'AndroidManifest.xml'
--- AndroidManifest.xml	2011-03-08 21:02:48 +0000
+++ AndroidManifest.xml	2011-05-04 10:36:21 +0000
@@ -1,24 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android";
-      package="org.openlp.android"
-      android:versionCode="1"
-      android:installLocation="auto"
-      android:versionName="0.1">
-    <uses-sdk android:minSdkVersion="3" />
-    <uses-permission android:name="android.permission.INTERNET" />
-    
+          package="org.openlp.android"
+          android:versionCode="1"
+          android:versionName="0.1">
+    <uses-sdk android:minSdkVersion="7"/>
+    <uses-permission android:name="android.permission.INTERNET"/>
+
     <application android:icon="@drawable/openlp_logo" android:label="@string/app_name">
-        <activity android:name=".openlp"
+        <activity android:name=".OpenLP"
                   android:label="@string/app_name">
             <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.LAUNCHER"/>
             </intent-filter>
         </activity>
-	<activity android:name="misc"></activity>
-    <activity android:name="PreferenceActivity"></activity>
-        <activity android:name="preferences"></activity>
-     <activity android:name="slide"></activity>
-    <activity android:name="service"></activity>
+		<activity android:name=".Misc"/>
+		<activity android:name=".Preferences" android:label="@string/preferences"/>
+        <activity android:name=".Slide"/>
+        <activity android:name=".Service"/>
     </application>
 </manifest>
\ No newline at end of file

=== modified file 'default.properties'
--- default.properties	2011-03-08 21:02:48 +0000
+++ default.properties	2011-05-04 10:36:21 +0000
@@ -8,4 +8,4 @@
 # project structure.
 
 # Project target.
-target=android-9
+target=android-7

=== modified file 'res/layout/misc.xml'
--- res/layout/misc.xml	2011-03-08 21:02:48 +0000
+++ res/layout/misc.xml	2011-05-04 10:36:21 +0000
@@ -1,27 +1,26 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<Button android:text="@string/blank"
-android:id="@+id/blank"
-android:layout_width="fill_parent"
-android:layout_height="wrap_content"></Button>
-<Button android:text="@string/unblank"
-android:id="@+id/unblank"
-android:layout_width="fill_parent"
-android:layout_height="wrap_content"></Button>
-<TextView android:text="@string/alert"
-android:layout_width="wrap_content"
-android:layout_height="wrap_content"/>
-<EditText android:id="@+id/alert"
-android:layout_height="wrap_content"
-android:text=""
-android:layout_width="match_parent"></EditText>
-<Button android:text="@string/send"
-android:id="@+id/send"
-android:layout_width="fill_parent"
-android:layout_height="wrap_content"></Button>
+        android:orientation="vertical"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent">
+    <Button android:text="@string/blank"
+            android:id="@+id/blank"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"/>
+    <Button android:text="@string/unblank"
+            android:id="@+id/unblank"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"/>
+    <TextView android:text="@string/alert"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"/>
+    <EditText android:id="@+id/alert"
+            android:layout_height="wrap_content"
+            android:text=""
+            android:layout_width="fill_parent"/>
+    <Button android:text="@string/send"
+            android:id="@+id/send"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"/>
 </LinearLayout>
 

=== modified file 'res/layout/service.xml'
--- res/layout/service.xml	2011-03-24 14:42:34 +0000
+++ res/layout/service.xml	2011-05-04 10:36:21 +0000
@@ -1,22 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<Button android:text="@string/prev"
-android:id="@+id/prev"
-android:layout_width="fill_parent"
-android:layout_height="wrap_content"></Button>
-<Button android:text="@string/next"
-android:id="@+id/next"
-android:layout_width="fill_parent"
-android:layout_height="wrap_content"></Button>
-<TextView
-android:id="@+id/services"
-android:layout_width="fill_parent"
-android:layout_height="wrap_content"></TextView>
-<ListView android:id="@+id/list"
-android:layout_width="wrap_content"
-android:layout_height="wrap_content" />
+              android:orientation="vertical"
+              android:layout_width="fill_parent"
+              android:layout_height="fill_parent"
+        >
+    <Button android:text="@string/prev"
+            android:id="@+id/prev"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"/>
+    <Button android:text="@string/next"
+            android:id="@+id/next"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"/>
+    <TextView
+            android:id="@+id/services"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"/>
+    <ListView android:id="@+id/list"
+              android:layout_width="wrap_content"
+              android:layout_height="wrap_content"/>
 </LinearLayout>

=== modified file 'res/layout/settings.xml'
--- res/layout/settings.xml	2011-03-12 22:22:41 +0000
+++ res/layout/settings.xml	2011-05-04 10:36:21 +0000
@@ -1,28 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<TextView android:text="@string/url"
-android:layout_width="wrap_content"
-android:layout_height="wrap_content"/>
-<EditText android:id="@+id/url"
-android:layout_height="wrap_content"
-android:text="192.168.1."
-android:inputType="number"
-android:layout_width="match_parent"></EditText>
-<TextView android:text="@string/port"
-android:layout_width="wrap_content"
-android:layout_height="wrap_content"/>
-<EditText android:id="@+id/port"
-android:layout_height="wrap_content"
-android:text="4316"
-android:layout_width="match_parent"
-android:inputType="number"></EditText>
-<Button android:text="@string/save"
-android:id="@+id/save"
-android:layout_width="fill_parent"
-android:layout_height="wrap_content"></Button>
+              android:orientation="vertical"
+              android:layout_width="fill_parent"
+              android:layout_height="fill_parent"
+        >
+    <TextView android:text="@string/url"
+              android:layout_width="wrap_content"
+              android:layout_height="wrap_content"/>
+    <EditText android:id="@+id/url"
+              android:layout_height="wrap_content"
+              android:text="192.168.1.1"
+              android:inputType="textUri"
+              android:layout_width="fill_parent"/>
+    <TextView android:text="@string/port"
+              android:layout_width="wrap_content"
+              android:layout_height="wrap_content"/>
+    <EditText android:id="@+id/port"
+              android:layout_height="wrap_content"
+              android:text="@string/portDefaultValue"
+              android:layout_width="fill_parent"
+              android:inputType="number"/>
+    <Button android:text="@string/save"
+            android:id="@+id/save"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"/>
 </LinearLayout>
 

=== modified file 'res/layout/slide.xml'
--- res/layout/slide.xml	2011-03-24 14:42:34 +0000
+++ res/layout/slide.xml	2011-05-04 10:36:21 +0000
@@ -1,22 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<Button android:text="@string/prev"
-android:id="@+id/prev" android:layout_width="fill_parent"
-android:layout_height="wrap_content"></Button>
-<Button android:text="@string/next"
-android:id="@+id/next"
-android:layout_width="fill_parent"
-android:layout_height="wrap_content"></Button>
-<TextView
-android:id="@+id/slides"
-android:layout_width="fill_parent"
-android:layout_height="wrap_content"></TextView>
-<ListView android:id="@+id/list"
-android:layout_width="wrap_content"
-android:layout_height="wrap_content" />
+              android:orientation="vertical"
+              android:layout_width="fill_parent"
+              android:layout_height="fill_parent"
+        >
+    <Button android:text="@string/prev"
+            android:id="@+id/prev" android:layout_width="fill_parent"
+            android:layout_height="wrap_content"/>
+    <Button android:text="@string/next"
+            android:id="@+id/next"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"/>
+    <TextView
+            android:id="@+id/slides"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"/>
+    <ListView android:id="@+id/list"
+              android:layout_width="wrap_content"
+              android:layout_height="wrap_content"/>
 
 </LinearLayout>

=== modified file 'res/menu/menu.xml'
--- res/menu/menu.xml	2011-03-08 21:02:48 +0000
+++ res/menu/menu.xml	2011-05-04 10:36:21 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu
-  xmlns:android="http://schemas.android.com/apk/res/android";>
-    <item android:enabled="true" android:titleCondensed="@string/settings" android:title="@string/settings" android:id="@+id/preferences"></item>
+<menu xmlns:android="http://schemas.android.com/apk/res/android";>
+    <item android:enabled="true" android:titleCondensed="@string/settings" android:title="@string/settings"
+          android:id="@+id/preferences"/>
 </menu>

=== modified file 'res/values-en/strings.xml'
--- res/values-en/strings.xml	2011-03-12 22:22:41 +0000
+++ res/values-en/strings.xml	2011-05-04 10:36:21 +0000
@@ -1,19 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <string name="app_name">Openlp</string>
+    <string name="app_name">OpenLP</string>
     <string name="settings">Settings</string>
+	<string name="preferences">Preferences</string>
     <string name="exit">Exit</string>
     <string name="prev">Previous</string>
     <string name="next">Next</string>
-    <string name="alert">Alert:</string>
     <string name="blank">Blank</string>
     <string name="unblank">Unblank</string>
+    <string name="alert">Alert:</string>
     <string name="send">Send</string>
     <string name="Slide">Slide</string>
     <string name="Service">Service</string>
     <string name="misc">Miscellaneous</string>
     <string name="url">Server</string>
+    <string name="urlDefaultValue">192.168.1.1</string>
     <string name="port">Port</string>
+    <string name="portDefaultValue">4316</string>
+    <string name="keyEnableCustomTimeout">enableCustomTimeout</string>
+    <string name="customTimeout">Custom Timeout</string>
+    <string name="socketTimeout">Socket Timeout</string>
+    <string name="keySocketTimeout">socketTimeout</string>
+    <string name="connectionTimeout">Connection Timout</string>
+    <string name="keyConnectionTimeout">connectionTimeout</string>
     <string name="save">Save</string>
     <string name="unable">Unable to load page -</string>
     <string name="fail">Connection failed</string>

=== modified file 'res/values-sv/strings.xml'
--- res/values-sv/strings.xml	2011-03-12 22:22:41 +0000
+++ res/values-sv/strings.xml	2011-05-04 10:36:21 +0000
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <string name="app_name">Openlp</string>
+    <string name="app_name">OpenLP</string>
     <string name="settings">Inställningar</string>
     <string name="exit">Avsluta</string>
     <string name="prev">Föregående</string>

=== added file 'res/values/httpClientTimeoutValues.xml'
--- res/values/httpClientTimeoutValues.xml	1970-01-01 00:00:00 +0000
+++ res/values/httpClientTimeoutValues.xml	2011-05-04 10:36:21 +0000
@@ -0,0 +1,16 @@
+<resources>
+    <string-array name="socketValueEntries">
+		<item>3000</item>
+		<item>4000</item>
+		<item>5000</item>
+		<item>8000</item>
+		<item>10000</item>
+	</string-array>
+	<string-array name="socketValues">
+		<item>3000</item>
+		<item>4000</item>
+		<item>5000</item>
+		<item>8000</item>
+		<item>10000</item>
+	</string-array>
+</resources>
\ No newline at end of file

=== added file 'res/values/integers.xml'
--- res/values/integers.xml	1970-01-01 00:00:00 +0000
+++ res/values/integers.xml	2011-05-04 10:36:21 +0000
@@ -0,0 +1,4 @@
+<resources>
+    <integer name="socketTimeoutDefaultValue">3000</integer>
+    <integer name="connectionTimeoutDefaultValue">3000</integer>
+</resources>
\ No newline at end of file

=== modified file 'res/values/strings.xml'
--- res/values/strings.xml	2011-03-12 22:22:41 +0000
+++ res/values/strings.xml	2011-05-04 10:36:21 +0000
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <string name="app_name">Openlp</string>
+    <string name="app_name">OpenLP</string>
     <string name="settings">Settings</string>
+	<string name="preferences">Preferences</string>
     <string name="exit">Exit</string>
     <string name="prev">Previous</string>
     <string name="next">Next</string>
@@ -13,11 +14,18 @@
     <string name="Service">Service</string>
     <string name="misc">Miscellaneous</string>
     <string name="url">Server</string>
+    <string name="urlDefaultValue">192.168.1.1</string>
     <string name="port">Port</string>
+    <string name="portDefaultValue">4316</string>
+    <string name="keyEnableCustomTimeout">enableCustomTimeout</string>
+    <string name="customTimeout">Custom Timeout</string>
+    <string name="socketTimeout">Socket Timeout</string>
+    <string name="keySocketTimeout">socketTimeout</string>
+    <string name="connectionTimeout">Connection Timout</string>
+    <string name="keyConnectionTimeout">connectionTimeout</string>
     <string name="save">Save</string>
     <string name="unable">Unable to load page -</string>
     <string name="fail">Connection failed</string>
     <string name="jsonfail">JSON failed</string>
     <string name="loading">Connecting...</string>
-    
 </resources>

=== modified file 'res/xml/preferences.xml'
--- res/xml/preferences.xml	2011-04-26 05:06:53 +0000
+++ res/xml/preferences.xml	2011-05-04 10:36:21 +0000
@@ -1,17 +1,42 @@
 <?xml version="1.0" encoding="utf-8"?>
 <PreferenceScreen
-  xmlns:android="http://schemas.android.com/apk/res/android";>
-  <PreferenceCategory
-		android:title="Server">
-		<EditTextPreference
-			android:title="url"
-			android:key="url"
-			android:defaultValue="192.168.1." android:inputType="phone" android:name="@string/url"/>
-		<EditTextPreference
-			android:defaultValue="4316"
-			android:title="port"
-			android:key="port"
-			android:name="@string/url"
-			android:inputType="number"/>
-</PreferenceCategory>
+        xmlns:android="http://schemas.android.com/apk/res/android";>
+    <PreferenceCategory
+            android:title="Server">
+        <EditTextPreference
+                android:title="@string/url"
+                android:key="url"
+                android:defaultValue="192.168.1.1"
+                android:inputType="phone"
+                android:name="@string/url"/>
+        <EditTextPreference
+                android:defaultValue="@string/portDefaultValue"
+                android:title="@string/port"
+                android:key="port"
+                android:name="@string/url"
+                android:inputType="number"/>
+    </PreferenceCategory>
+    <PreferenceCategory
+            android:title="@string/customTimeout">
+        <CheckBoxPreference
+                android:title="Enable Custom Timeouts"
+                android:key="@string/keyEnableCustomTimeout"
+                android:summary="Check to modify timeout settings"/>
+        <ListPreference
+                android:title="@string/connectionTimeout"
+                android:key="@string/keyConnectionTimeout"
+                android:summary="Select a value (milliseconds)"
+                android:dependency="@string/keyEnableCustomTimeout"
+                android:entries="@array/socketValueEntries"
+                android:entryValues="@array/socketValues"
+                android:defaultValue="@integer/connectionTimeoutDefaultValue"/>
+        <ListPreference
+                android:title="@string/socketTimeout"
+                android:key="@string/keySocketTimeout"
+                android:summary="Select a value (milliseconds)"
+                android:dependency="@string/keyEnableCustomTimeout"
+                android:entries="@array/socketValueEntries"
+                android:entryValues="@array/socketValues"
+                android:defaultValue="@integer/socketTimeoutDefaultValue"/>
+    </PreferenceCategory>
 </PreferenceScreen>

=== renamed file 'src/org/openlp/android/misc.java' => 'src/org/openlp/android/Misc.java'
--- src/org/openlp/android/misc.java	2011-04-26 17:47:33 +0000
+++ src/org/openlp/android/Misc.java	2011-05-04 10:36:21 +0000
@@ -1,98 +1,125 @@
 /******************************************************************************
-* OpenLP - Open Source Lyrics Projection                                      *
-* --------------------------------------------------------------------------- *
-* Copyright (c) 2008-2011 Raoul Snyman                                        *
-* Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
-* Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
-* Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
-* Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
-* --------------------------------------------------------------------------- *
-* This program is free software; you can redistribute it and/or modify it     *
-* under the terms of the GNU General Public License as published by the Free  *
-* Software Foundation; version 2 of the License.                              *
-*                                                                             *
-* This program is distributed in the hope that it will be useful, but WITHOUT *
-* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
-* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
-* more details.                                                               *
-*                                                                             *
-* You should have received a copy of the GNU General Public License along     *
-* with this program; if not, write to the Free Software Foundation, Inc., 59  *
-* Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
-*******************************************************************************/
+ * OpenLP - Open Source Lyrics Projection                                      *
+ * --------------------------------------------------------------------------- *
+ * Copyright (c) 2008-2011 Raoul Snyman                                        *
+ * Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
+ * Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
+ * Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
+ * Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
+ * --------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it     *
+ * under the terms of the GNU General Public License as published by the Free  *
+ * Software Foundation; version 2 of the License.                              *
+ *                                                                             *
+ * This program is distributed in the hope that it will be useful, but WITHOUT *
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
+ * more details.                                                               *
+ *                                                                             *
+ * You should have received a copy of the GNU General Public License along     *
+ * with this program; if not, write to the Free Software Foundation, Inc., 59  *
+ * Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
+ *******************************************************************************/
 package org.openlp.android;
 
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.json.JSONStringer;
-
 import android.content.Intent;
 import android.os.Bundle;
+import android.util.Log;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.widget.Button;
 import android.widget.EditText;
-
-public class misc extends openlpActivity {
-	public Button.OnClickListener mBlank = new Button.OnClickListener() {
-		public void onClick(View v) {
-			String urlAll = getURL() + ":" + getPort() + "/api/display/hide";
-			webCall(urlAll);
-		}
-	};
-
-	public Button.OnClickListener mUnblank = new Button.OnClickListener() {
-		public void onClick(View v) {
-			String urlAll = getURL() + ":" + getPort() + "/api/display/show";
-			webCall(urlAll);
-		}
-	};
-
-	public Button.OnClickListener mSend = new Button.OnClickListener() {
-		public void onClick(View v) {
-			EditText edittext = (EditText) findViewById(R.id.alert);
-			String alert;
-			try {
-				JSONObject jo = new JSONObject();
-				jo.put("text", edittext.getText());
-				alert = new JSONStringer().object().key("request").value(jo)
-						.endObject().toString();
-				alert = java.net.URLEncoder.encode(alert);
-			}
-			catch (JSONException e) {
-				alert = e.toString();
-			}
-			String urlAll = (getURL() + ":" + getPort() + "/api/alert?data=" + alert);
-			webCall(urlAll);
-		}
-	};
-
-	public void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.misc);
-		findViewById(R.id.blank).setOnClickListener(mBlank);
-		findViewById(R.id.unblank).setOnClickListener(mUnblank);
-		findViewById(R.id.send).setOnClickListener(mSend);
-	}
-
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		MenuInflater inflater = getMenuInflater();
-		inflater.inflate(R.menu.menu, menu);
-		return true;
-	}
-
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		// Handle item selection
-		switch (item.getItemId()) {
-		case R.id.preferences:
-			startActivity(new Intent(this, preferences.class));
-			return true;
-		default:
-			return super.onOptionsItemSelected(item);
-		}
-	}
-}
\ No newline at end of file
+import android.widget.Toast;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.json.JSONStringer;
+
+import java.io.UnsupportedEncodingException;
+
+public class Misc extends OpenLPActivity implements OpenLP.ApiActions {
+    public Button.OnClickListener mBlank = new Button.OnClickListener() {
+        @Override
+        public void onClick(View v) {
+            String urlAll = String.format("%s:%s%s", getURL(), getPort(), DISPLAY_HIDE);
+            try {
+                webCall(urlAll);
+            }
+            catch (Exception e) {
+                Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
+            }
+        }
+    };
+
+    public Button.OnClickListener mUnblank = new Button.OnClickListener() {
+        @Override
+        public void onClick(View v) {
+            String urlAll = String.format("%s:%s%s", getURL(), getPort(), DISPLAY_SHOW);
+            try {
+                webCall(urlAll);
+            }
+            catch (Exception e) {
+                Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
+            }
+        }
+    };
+
+    public Button.OnClickListener mSend = new Button.OnClickListener() {
+        @Override
+        public void onClick(View v) {
+            EditText edittext = (EditText) findViewById(R.id.alert);
+            String alert;
+            try {
+                JSONObject jo = new JSONObject();
+                jo.put("text", edittext.getText());
+                alert = new JSONStringer().object().key("request").value(jo).endObject().toString();
+                alert = java.net.URLEncoder.encode(alert, "UTF-8");
+            }
+            catch (JSONException e) {
+                alert = e.toString();
+            }
+            catch (UnsupportedEncodingException e) {
+                alert = e.toString();
+            }
+            String urlAll = String.format("%s:%s%s%s", getURL(), getPort(), ALERT, alert);
+            try {
+                webCall(urlAll);
+            }
+            catch (Exception e) {
+                Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
+            }
+        }
+    };
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        Log.i(LOG_TAG, "onCreate");
+        setContentView(R.layout.misc);
+        findViewById(R.id.blank).setOnClickListener(mBlank);
+        findViewById(R.id.unblank).setOnClickListener(mUnblank);
+        findViewById(R.id.send).setOnClickListener(mSend);
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        MenuInflater inflater = getMenuInflater();
+        inflater.inflate(R.menu.menu, menu);
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        // Handle item selection
+        switch (item.getItemId()) {
+            case R.id.preferences:
+                startActivity(new Intent(this, Preferences.class));
+                return true;
+            default:
+                return super.onOptionsItemSelected(item);
+        }
+    }
+
+    private final String LOG_TAG = Misc.class.getName();
+}

=== added file 'src/org/openlp/android/OpenLP.java'
--- src/org/openlp/android/OpenLP.java	1970-01-01 00:00:00 +0000
+++ src/org/openlp/android/OpenLP.java	2011-05-04 10:36:21 +0000
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * OpenLP - Open Source Lyrics Projection                                      *
+ * --------------------------------------------------------------------------- *
+ * Copyright (c) 2008-2011 Raoul Snyman                                        *
+ * Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
+ * Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
+ * Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
+ * Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
+ * --------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it     *
+ * under the terms of the GNU General Public License as published by the Free  *
+ * Software Foundation; version 2 of the License.                              *
+ *                                                                             *
+ * This program is distributed in the hope that it will be useful, but WITHOUT *
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
+ * more details.                                                               *
+ *                                                                             *
+ * You should have received a copy of the GNU General Public License along     *
+ * with this program; if not, write to the Free Software Foundation, Inc., 59  *
+ * Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
+ *******************************************************************************/
+package org.openlp.android;
+
+import android.app.TabActivity;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.widget.TabHost;
+
+/**
+ * OpenLP-Android initialisation point.
+ */
+public class OpenLP extends TabActivity {
+    /**
+     * Called when the activity is first created.
+     */
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        Log.i(LOG_TAG, "onCreate");
+        setContentView(R.layout.main);
+
+        TabHost tabHost = getTabHost(); // The activity TabHost
+        TabHost.TabSpec spec; // Reusable TabSpec for each tab
+        Intent intent; // Reusable Intent for each tab
+
+        // Create an Intent to launch an Activity for the tab (to be reused)
+        intent = new Intent().setClass(this, Slide.class);
+
+        // Initialise a TabSpec for each tab and add it to the TabHost
+        Log.i(LOG_TAG, "Initialise Slide TabSpec");
+        spec = tabHost.newTabSpec("artists").setIndicator("Slide")
+                .setContent(intent);
+        tabHost.addTab(spec);
+        tabHost.setCurrentTab(1);
+
+        // Do the same for the other tabs
+        intent = new Intent().setClass(this, Service.class);
+        Log.i(LOG_TAG, "Initialise Service TabSpec");
+        spec = tabHost.newTabSpec("albums").setIndicator("Service")
+                .setContent(intent);
+        tabHost.addTab(spec);
+
+        // Do the same for the other tabs
+        intent = new Intent().setClass(this, Misc.class);
+        Log.i(LOG_TAG, "Initialise Misc TabSpec");
+        spec = tabHost.newTabSpec("albums").setIndicator("Misc")
+                .setContent(intent);
+        tabHost.addTab(spec);
+
+        if (getSharedPreferences("prefs", Context.MODE_PRIVATE).getString("url", "NONE").equals("NONE")) {
+            Log.d(LOG_TAG, "URL preference not set. Starting preference activity...");
+            Intent preferenceIntent = new Intent(this, Preferences.class);
+            startActivity(preferenceIntent);
+        }
+    }
+
+    private final String LOG_TAG = OpenLP.class.getName();
+
+    public interface ApiActions {
+        public final String LIVE_NEXT = "/api/controller/live/next";
+        public final String LIVE_PREVIOUS = "/api/controller/live/previous";
+        public final String LIVE_TEXT = "/api/controller/live/text";
+
+        public final String SERVICE_NEXT = "/api/service/next";
+        public final String SERVICE_PREVIOUS = "/api/service/previous";
+        public final String SERVICE_LIST = "/api/service/list";
+
+        public final String DISPLAY_HIDE = "/api/display/hide";
+        public final String DISPLAY_SHOW = "/api/display/show";
+
+        public final String ALERT = "/api/alert?data=";
+    }
+}
\ No newline at end of file

=== added file 'src/org/openlp/android/OpenLPActivity.java'
--- src/org/openlp/android/OpenLPActivity.java	1970-01-01 00:00:00 +0000
+++ src/org/openlp/android/OpenLPActivity.java	2011-05-04 10:36:21 +0000
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * OpenLP - Open Source Lyrics Projection                                      *
+ * --------------------------------------------------------------------------- *
+ * Copyright (c) 2008-2011 Raoul Snyman                                        *
+ * Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
+ * Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
+ * Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
+ * Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
+ * --------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it     *
+ * under the terms of the GNU General Public License as published by the Free  *
+ * Software Foundation; version 2 of the License.                              *
+ *                                                                             *
+ * This program is distributed in the hope that it will be useful, but WITHOUT *
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
+ * more details.                                                               *
+ *                                                                             *
+ * You should have received a copy of the GNU General Public License along     *
+ * with this program; if not, write to the Free Software Foundation, Inc., 59  *
+ * Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
+ *******************************************************************************/
+package org.openlp.android;
+
+import android.app.Activity;
+import android.content.SharedPreferences;
+import android.util.Log;
+import org.openlp.android.utility.OpenLPHttpClient;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+public class OpenLPActivity extends Activity {
+    public String getURL() {
+        SharedPreferences prefs = getSharedPreferences("prefs", MODE_PRIVATE);
+        return "http://"; + prefs.getString("url", getString(R.string.urlDefaultValue));
+    }
+
+    public String getPort() {
+        SharedPreferences prefs = getSharedPreferences("prefs", MODE_PRIVATE);
+        return prefs.getString("port", getString(R.string.portDefaultValue));
+    }
+
+    public void webCall(String url) throws IOException, URISyntaxException {
+        OpenLPHttpClient httpclient = new OpenLPHttpClient(getApplicationContext());
+        httpclient.setUrl(new URL(url));
+
+        Log.d(LOG_TAG, "Executing request: " + httpclient.getUrl().toString());
+        httpclient.execute();
+
+    }
+
+    private String LOG_TAG = OpenLPActivity.class.getName();
+}

=== renamed file 'src/org/openlp/android/preferences.java' => 'src/org/openlp/android/Preferences.java'
--- src/org/openlp/android/preferences.java	2011-04-26 17:47:33 +0000
+++ src/org/openlp/android/Preferences.java	2011-05-04 10:36:21 +0000
@@ -1,63 +1,44 @@
 /******************************************************************************
-* OpenLP - Open Source Lyrics Projection                                      *
-* --------------------------------------------------------------------------- *
-* Copyright (c) 2008-2011 Raoul Snyman                                        *
-* Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
-* Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
-* Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
-* Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
-* --------------------------------------------------------------------------- *
-* This program is free software; you can redistribute it and/or modify it     *
-* under the terms of the GNU General Public License as published by the Free  *
-* Software Foundation; version 2 of the License.                              *
-*                                                                             *
-* This program is distributed in the hope that it will be useful, but WITHOUT *
-* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
-* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
-* more details.                                                               *
-*                                                                             *
-* You should have received a copy of the GNU General Public License along     *
-* with this program; if not, write to the Free Software Foundation, Inc., 59  *
-* Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
-*******************************************************************************/
+ * OpenLP - Open Source Lyrics Projection                                      *
+ * --------------------------------------------------------------------------- *
+ * Copyright (c) 2008-2011 Raoul Snyman                                        *
+ * Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
+ * Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
+ * Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
+ * Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
+ * --------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it     *
+ * under the terms of the GNU General Public License as published by the Free  *
+ * Software Foundation; version 2 of the License.                              *
+ *                                                                             *
+ * This program is distributed in the hope that it will be useful, but WITHOUT *
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
+ * more details.                                                               *
+ *                                                                             *
+ * You should have received a copy of the GNU General Public License along     *
+ * with this program; if not, write to the Free Software Foundation, Inc., 59  *
+ * Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
+ *******************************************************************************/
 package org.openlp.android;
 
-import android.app.Activity;
-import android.content.SharedPreferences;
 import android.os.Bundle;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-
-public class preferences extends Activity {
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.settings);
-		findViewById(R.id.save).setOnClickListener(mSend);
-		EditText url = (EditText) findViewById(R.id.url);
-		EditText port = (EditText) findViewById(R.id.port);
-		SharedPreferences settings = getSharedPreferences("prefs", 0);
-		url.setText(settings.getString("url", "192.168.0.3"));
-		port.setText(settings.getString("port", "4316"));
-	}
-
-	public Button.OnClickListener mSend = new Button.OnClickListener() {
-		public void onClick(View v) {
-			EditText url1 = (EditText) findViewById(R.id.url);
-			EditText port1 = (EditText) findViewById(R.id.port);
-			String url = "" + url1.getText();
-			String port = "" + port1.getText();
-			// We need an Editor object to make preference changes.
-			// All objects are from android.context.Context
-			SharedPreferences settings = getSharedPreferences("prefs", 0);
-			SharedPreferences.Editor editor = settings.edit();
-			editor.putString("url", url);
-			editor.putString("port", port);
-			url1.setText(settings.getString("url", "192.168.0.3"));
-			port1.setText(settings.getString("port", "4316"));
-			// Commit the edits!
-			editor.commit();
-		}
-	};
+import android.preference.PreferenceActivity;
+import android.util.Log;
+
+/**
+ * Credits:
+ *  http://www.kaloer.com/android-preferences
+ *  http://androidpartaker.wordpress.com/2010/07/11/android-preferences/
+ */
+public class Preferences extends PreferenceActivity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        Log.d(LOG_TAG, "Launching preferences");
+        getPreferenceManager().setSharedPreferencesName("prefs");
+        addPreferencesFromResource(R.xml.preferences);
+    }
+
+    private final String LOG_TAG = Preferences.class.getName();
 }

=== renamed file 'src/org/openlp/android/service.java' => 'src/org/openlp/android/Service.java'
--- src/org/openlp/android/service.java	2011-04-26 17:47:33 +0000
+++ src/org/openlp/android/Service.java	2011-05-04 10:36:21 +0000
@@ -1,43 +1,30 @@
 /******************************************************************************
-* OpenLP - Open Source Lyrics Projection                                      *
-* --------------------------------------------------------------------------- *
-* Copyright (c) 2008-2011 Raoul Snyman                                        *
-* Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
-* Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
-* Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
-* Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
-* --------------------------------------------------------------------------- *
-* This program is free software; you can redistribute it and/or modify it     *
-* under the terms of the GNU General Public License as published by the Free  *
-* Software Foundation; version 2 of the License.                              *
-*                                                                             *
-* This program is distributed in the hope that it will be useful, but WITHOUT *
-* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
-* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
-* more details.                                                               *
-*                                                                             *
-* You should have received a copy of the GNU General Public License along     *
-* with this program; if not, write to the Free Software Foundation, Inc., 59  *
-* Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
-*******************************************************************************/
+ * OpenLP - Open Source Lyrics Projection                                      *
+ * --------------------------------------------------------------------------- *
+ * Copyright (c) 2008-2011 Raoul Snyman                                        *
+ * Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
+ * Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
+ * Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
+ * Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
+ * --------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it     *
+ * under the terms of the GNU General Public License as published by the Free  *
+ * Software Foundation; version 2 of the License.                              *
+ *                                                                             *
+ * This program is distributed in the hope that it will be useful, but WITHOUT *
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
+ * more details.                                                               *
+ *                                                                             *
+ * You should have received a copy of the GNU General Public License along     *
+ * with this program; if not, write to the Free Software Foundation, Inc., 59  *
+ * Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
+ *******************************************************************************/
 package org.openlp.android;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
+import android.app.ProgressDialog;
 import android.content.Intent;
+import android.os.AsyncTask;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.Menu;
@@ -48,167 +35,178 @@
 import android.widget.Button;
 import android.widget.ListView;
 import android.widget.TextView;
-
-public class service extends openlpActivity {
-
-	private ListView lv1;
-
-	public void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-
-		setContentView(R.layout.service);
-		findViewById(R.id.prev).setOnClickListener(mPrev);
-		findViewById(R.id.next).setOnClickListener(mNext);
-		TextView txt = (TextView) findViewById(R.id.services);
-		// Set the text and call the connect function.
-		txt.setText(R.string.loading);
-		String urlAll = getURL() + ":" + getPort() + "/api/service/list";
-		txt.setText(connect(urlAll));
-	}
-
-	private String connect(String url) {
-
-		// Create the httpclient
-		HttpClient httpclient = new DefaultHttpClient();
-
-		// Prepare a request object
-		HttpGet httpget = new HttpGet(url);
-
-		// Execute the request
-		HttpResponse response;
-
-		// return string
-		String returnString = null;
-
-		try {
-
-			// Open the webpage
-			response = httpclient.execute(httpget);
-			if (response.getStatusLine().getStatusCode() == 200) {
-				// Connection was established. Get the content.
-
-				HttpEntity entity = response.getEntity();
-				// If the response does not enclose an entity, there is no need
-				// to worry about connection release
-
-				if (entity != null) {
-					// A Simple JSON Response Read
-					InputStream instream = entity.getContent();
-
-					String result = convertStreamToString(instream);
-					Log.i("Praeda", result);
-
-					// Load the requested page converted to a string into a
-					// JSONObject.
-
-					// Build the return string.
-					JSONObject jObject = new JSONObject(result);
-
-					JSONObject results = jObject.getJSONObject("results");
-
-					JSONArray items = results.getJSONArray("items");
-
-					ArrayList<String> result1 = new ArrayList<String>();
-
-					returnString = "";
-
-					for (int i = 0; i < items.length(); i++) {
-
-						result1.add(items.getJSONObject(i).getString("title")
-								.toString());
-					}
-					lv1 = (ListView) findViewById(R.id.list);
-
-					lv1.setAdapter(new ArrayAdapter<String>(this,
-							android.R.layout.simple_list_item_1, result1));
-
-					// Cose the stream.
-					instream.close();
-				}
-			}
-			else {
-				// code here for a response other than 200. A response 200 means
-				// the webpage was ok
-				// Other codes include 404 - not found, 301 - redirect etc...
-				// Display the response line.
-				returnString = "Unable to load page - "
-						+ response.getStatusLine();
-			}
-		}
-		catch (IOException ex) {
-			// thrown by line 80 - getContent();
-			// Connection was not established
-			returnString = "Connection failed; " + ex.getMessage();
-		}
-		catch (JSONException ex) {
-			// JSON errors
-			returnString = "JSON failed; " + ex.getMessage();
-		}
-		return returnString;
-	}
-
-	private static String convertStreamToString(InputStream is) {
-		/*
-		 * To convert the InputStream to String we use the
-		 * BufferedReader.readLine() method. We iterate until the BufferedReader
-		 * return null which means there's no more data to read. Each line will
-		 * appended to a StringBuilder and returned as String.
-		 */
-		BufferedReader reader = new BufferedReader(new InputStreamReader(is));
-		StringBuilder sb = new StringBuilder();
-
-		String line = null;
-		try {
-			while ((line = reader.readLine()) != null) {
-				sb.append(line + "\n");
-			}
-		}
-		catch (IOException e) {
-			e.printStackTrace();
-		} finally {
-			try {
-				is.close();
-			}
-			catch (IOException e) {
-				e.printStackTrace();
-			}
-		}
-		return sb.toString();
-	}
-
-	;
-
-	public Button.OnClickListener mPrev = new Button.OnClickListener() {
-		public void onClick(View v) {
-			String urlAll = getURL() + ":" + getPort()
-					+ "/api/service/previous";
-			webCall(urlAll);
-		}
-	};
-
-	public Button.OnClickListener mNext = new Button.OnClickListener() {
-		public void onClick(View v) {
-			String urlAll = getURL() + ":" + getPort() + "/api/service/next";
-			webCall(urlAll);
-		}
-	};
-
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		MenuInflater inflater = getMenuInflater();
-		inflater.inflate(R.menu.menu, menu);
-		return true;
-	}
-
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		// Handle item selection
-		switch (item.getItemId()) {
-		case R.id.preferences:
-			startActivity(new Intent(this, preferences.class));
-			return true;
-		default:
-			return super.onOptionsItemSelected(item);
-		}
-	}
+import android.widget.Toast;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.openlp.android.utility.OpenLPHttpClient;
+import org.openlp.android.utility.StringHelper;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Activity for managing service objects.
+ */
+public class Service extends OpenLPActivity implements OpenLP.ApiActions {
+    private final String LOG_TAG = Service.class.getName();
+
+    private TextView txt;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        Log.i(LOG_TAG, "onCreate");
+
+        setContentView(R.layout.service);
+        findViewById(R.id.prev).setOnClickListener(mPrev);
+        findViewById(R.id.next).setOnClickListener(mNext);
+        txt = (TextView) findViewById(R.id.services);
+        txt.setText(R.string.loading);
+
+        String urlAll = String.format("%s:%s%s", getURL(), getPort(), SERVICE_LIST);
+
+        new FetchServiceItemsTask(this).execute(urlAll);
+    }
+
+    private void setTextViewText(String text) {
+        txt.setText(text);
+    }
+
+    public Button.OnClickListener mPrev = new Button.OnClickListener() {
+        @Override
+        public void onClick(View v) {
+            String urlAll = String.format("%s:%s%s", getURL(), getPort(), SERVICE_PREVIOUS);
+            try {
+                webCall(urlAll);
+            }
+            catch (Exception e) {
+                Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
+            }
+        }
+    };
+
+    public Button.OnClickListener mNext = new Button.OnClickListener() {
+        @Override
+        public void onClick(View v) {
+            String urlAll = String.format("%s:%s%s", getURL(), getPort(), SERVICE_NEXT);
+            try {
+                webCall(urlAll);
+            }
+            catch (Exception e) {
+                Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
+            }
+        }
+    };
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        MenuInflater inflater = getMenuInflater();
+        inflater.inflate(R.menu.menu, menu);
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        // Handle item selection
+        switch (item.getItemId()) {
+            case R.id.preferences:
+                startActivity(new Intent(this, Preferences.class));
+                return true;
+            default:
+                return super.onOptionsItemSelected(item);
+        }
+    }
+
+    /**
+     * Asynchronous task to fetch the service items.
+     */
+    class FetchServiceItemsTask extends AsyncTask<String, String[], String> {
+        Service serviceActivity;
+        ProgressDialog progressDialog;
+
+        FetchServiceItemsTask(Service serviceActivity) {
+            this.serviceActivity = serviceActivity;
+        }
+
+        @Override
+        protected void onPreExecute() {
+            super.onPreExecute();
+            progressDialog = ProgressDialog.show(Service.this, getString(R.string.loading), "Loading service items...");
+        }
+
+        @Override
+        protected String doInBackground(String... strings) {
+            OpenLPHttpClient httpClient = new OpenLPHttpClient(getApplicationContext());
+            HttpResponse response;
+            String returnString = null;
+
+            Log.d(LOG_TAG, "Processing:" + Arrays.asList(strings));
+
+            try {
+                httpClient.setUrl(new URL(strings[0]));
+                response = httpClient.execute();
+
+                if (response.getStatusLine().getStatusCode() == 200) {
+                    HttpEntity entity = response.getEntity();
+                    // If the response does not enclose an entity, there is no need
+                    // to worry about connection release
+
+                    if (entity != null) {
+                        InputStream instream = entity.getContent();
+                        String result = StringHelper.convertStreamToString(instream);
+                        Log.i(LOG_TAG, result);
+
+                        // Build the return string.
+                        JSONObject jObject = new JSONObject(result);
+                        JSONObject results = jObject.getJSONObject("results");
+                        JSONArray items = results.getJSONArray("items");
+                        List<String> result1 = new ArrayList<String>();
+                        returnString = "";
+
+                        for (int i = 0; i < items.length(); i++) {
+                            result1.add(items.getJSONObject(i).getString("title"));
+                        }
+
+                        instream.close();
+                        publishProgress(result1.toArray(new String[]{}));
+                    }
+                }
+                else {
+                    returnString = String.format("Unable to load page - %s", response.getStatusLine());
+                }
+            }
+            catch (JSONException ex) {
+                returnString = "JSON failed; " + ex.getMessage();
+            }
+            catch (IOException e) {
+                returnString = "IOException: " + e.getMessage();
+            }
+            catch (URISyntaxException e) {
+                returnString = "URISyntaxException: " + e.getMessage();
+            }
+            return returnString;
+        }
+
+        @Override
+        protected void onProgressUpdate(String[]... values) {
+            super.onProgressUpdate(values);
+            ListView lv1 = (ListView) findViewById(R.id.list);
+            lv1.setAdapter(new ArrayAdapter<String>(serviceActivity, android.R.layout.simple_list_item_1, values[0]));
+        }
+
+        @Override
+        protected void onPostExecute(String s) {
+            super.onPostExecute(s);
+            serviceActivity.setTextViewText(s);
+            progressDialog.dismiss();
+        }
+    }
 }
\ No newline at end of file

=== renamed file 'src/org/openlp/android/slide.java' => 'src/org/openlp/android/Slide.java'
--- src/org/openlp/android/slide.java	2011-04-26 17:47:33 +0000
+++ src/org/openlp/android/Slide.java	2011-05-04 10:36:21 +0000
@@ -1,43 +1,30 @@
 /******************************************************************************
-* OpenLP - Open Source Lyrics Projection                                      *
-* --------------------------------------------------------------------------- *
-* Copyright (c) 2008-2011 Raoul Snyman                                        *
-* Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
-* Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
-* Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
-* Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
-* --------------------------------------------------------------------------- *
-* This program is free software; you can redistribute it and/or modify it     *
-* under the terms of the GNU General Public License as published by the Free  *
-* Software Foundation; version 2 of the License.                              *
-*                                                                             *
-* This program is distributed in the hope that it will be useful, but WITHOUT *
-* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
-* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
-* more details.                                                               *
-*                                                                             *
-* You should have received a copy of the GNU General Public License along     *
-* with this program; if not, write to the Free Software Foundation, Inc., 59  *
-* Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
-*******************************************************************************/
+ * OpenLP - Open Source Lyrics Projection                                      *
+ * --------------------------------------------------------------------------- *
+ * Copyright (c) 2008-2011 Raoul Snyman                                        *
+ * Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
+ * Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
+ * Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
+ * Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
+ * --------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it     *
+ * under the terms of the GNU General Public License as published by the Free  *
+ * Software Foundation; version 2 of the License.                              *
+ *                                                                             *
+ * This program is distributed in the hope that it will be useful, but WITHOUT *
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
+ * more details.                                                               *
+ *                                                                             *
+ * You should have received a copy of the GNU General Public License along     *
+ * with this program; if not, write to the Free Software Foundation, Inc., 59  *
+ * Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
+ *******************************************************************************/
 package org.openlp.android;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import android.app.ProgressDialog;
 import android.content.Intent;
+import android.os.AsyncTask;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.Menu;
@@ -48,159 +35,179 @@
 import android.widget.Button;
 import android.widget.ListView;
 import android.widget.TextView;
-
-public class slide extends openlpActivity {
-	private ListView lv1;
-
-	public void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-
-		setContentView(R.layout.slide);
-		findViewById(R.id.prev).setOnClickListener(mPrev);
-		findViewById(R.id.next).setOnClickListener(mNext);
-		TextView txt = (TextView) findViewById(R.id.slides);
-		// Set the text and call the connect function.
-		txt.setText(R.string.loading);
-		final String urlAll = getURL() + ":" + getPort()
-				+ "/api/controller/live/text";
-		txt.setText(connect(urlAll));
-	}
-
-	private String connect(String url) {
-
-		// Create the http client
-		HttpClient httpclient = new DefaultHttpClient();
-
-		// Prepare a request object
-		HttpGet httpget = new HttpGet(url);
-
-		// Execute the request
-		HttpResponse response;
-
-		// return string
-		String returnString = null;
-
-		try {
-
-			// Open the webpage
-			response = httpclient.execute(httpget);
-			if (response.getStatusLine().getStatusCode() == 200) {
-				// Connection was established. Get the content.
-
-				HttpEntity entity = response.getEntity();
-				// If the response does not enclose an entity, there is no need
-				// to worry about connection release
-
-				if (entity != null) {
-					// A Simple JSON Response Read
-					InputStream instream = entity.getContent();
-
-					String result = convertStreamToString(instream);
-					Log.i("Praeda", result);
-
-					// Load the requested page converted to a string into a
-					// JSONObject.
-
-					// Build the return string.
-					JSONObject jObject = new JSONObject(result);
-					JSONObject results = jObject.getJSONObject("results");
-					JSONArray slides = results.getJSONArray("slides");
-					ArrayList<String> result1 = new ArrayList<String>();
-					returnString = "";
-
-					for (int i = 0; i < slides.length(); i++) {
-						result1.add(slides.getJSONObject(i).getString("text")
-								.toString());
+import android.widget.Toast;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.openlp.android.utility.OpenLPHttpClient;
+import org.openlp.android.utility.StringHelper;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class Slide extends OpenLPActivity implements OpenLP.ApiActions {
+    private final String LOG_TAG = Slide.class.getName();
+    private TextView txt;
+
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        Log.i(LOG_TAG, "Creating view");
+        setContentView(R.layout.slide);
+        findViewById(R.id.prev).setOnClickListener(mPrev);
+        findViewById(R.id.next).setOnClickListener(mNext);
+        txt = (TextView) findViewById(R.id.slides);
+        txt.setText(R.string.loading);
+
+        final String urlAll = String.format("%s:%s%s", getURL(), getPort(), LIVE_TEXT);
+        new FetchSlideItemsTask(this).execute(urlAll);
+    }
+
+    public Button.OnClickListener mPrev = new Button.OnClickListener() {
+        public void onClick(View v) {
+            String urlAll = String.format("%s:%s%s", getURL(), getPort(), LIVE_PREVIOUS);
+            try {
+                webCall(urlAll);
+            }
+            catch (Exception e) {
+                Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
+                Log.e(LOG_TAG, e.toString(), e);
+            }
+        }
+    };
+
+    public Button.OnClickListener mNext = new Button.OnClickListener() {
+        public void onClick(View v) {
+            String urlAll = getURL() + ":" + getPort() + LIVE_NEXT;
+            try {
+                webCall(urlAll);
+            }
+            catch (Exception e) {
+                Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
+                Log.e(LOG_TAG, e.toString(), e);
+            }
+        }
+    };
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        MenuInflater inflater = getMenuInflater();
+        inflater.inflate(R.menu.menu, menu);
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        // Handle item selection
+        switch (item.getItemId()) {
+            case R.id.preferences:
+                startActivity(new Intent(this, Preferences.class));
+                return true;
+            default:
+                return super.onOptionsItemSelected(item);
+        }
+    }
+
+    void setTextViewText(String text) {
+        txt.setText(text);
+    }
+
+    class FetchSlideItemsTask extends AsyncTask<String, String[], String> {
+        Slide slideActivity;
+        ProgressDialog progressDialog;
+
+        FetchSlideItemsTask(Slide slideActivity) {
+            this.slideActivity = slideActivity;
+        }
+
+        @Override
+        protected void onPreExecute() {
+            super.onPreExecute();
+            progressDialog = ProgressDialog.show(Slide.this, getString(R.string.loading), "Loading slide items...");
+        }
+
+        @Override
+        protected String doInBackground(String... strings) {
+            OpenLPHttpClient httpClient = new OpenLPHttpClient(getApplicationContext());
+            HttpResponse response;
+            String returnString = null;
+
+            Log.d(LOG_TAG, "Processing:" + Arrays.asList(strings));
+            try {
+                httpClient.setUrl(new URL(strings[0]));
+                response = httpClient.execute();
+
+                if (response.getStatusLine().getStatusCode() == 200) {
+                    Log.d(LOG_TAG, "Connection Established. Getting content.");
+                    HttpEntity entity = response.getEntity();
+                    // If the response does not enclose an entity, there is no need
+                    // to worry about connection release
+
+                    if (entity != null) {
+                        InputStream instream = entity.getContent();
+
+                        String result = StringHelper.convertStreamToString(instream);
+                        Log.i(LOG_TAG, result);
+
+                        // Load the requested page converted to a string into a
+                        // JSONObject.
+
+                        // Build the return string.
+                        JSONObject jObject = new JSONObject(result);
+                        JSONObject results = jObject.getJSONObject("results");
+                        JSONArray slides = results.getJSONArray("slides");
+                        List<String> result1 = new ArrayList<String>();
+                        returnString = "";
+
+                        for (int i = 0; i < slides.length(); i++) {
+                            result1.add(slides.getJSONObject(i).getString("text"));
+						}
+
+						instream.close();
+						publishProgress(result1.toArray(new String[]{}));
 					}
-					lv1 = (ListView) findViewById(R.id.list);
-					lv1.setAdapter(new ArrayAdapter<String>(this,
-							android.R.layout.simple_list_item_1, result1));
-					// Close the stream.
-					instream.close();
-				}
-			}
-			else {
-				// code here for a response other than 200. A response 200 means
-				// the webpage was ok
-				// Other codes include 404 - not found, 301 - redirect etc...
-				// Display the response line.
-				returnString = "Unable to load page - "
-						+ response.getStatusLine();
-			}
-		}
-		catch (IOException ex) {
-			// thrown by line 80 - getContent();
-			// Connection was not established
-			returnString = "Connection failed; " + ex.getMessage();
-		}
-		catch (JSONException ex) {
-			// JSON errors
-			returnString = "JSON failed; " + ex.getMessage();
-		}
-		return returnString;
-	}
-
-	private static String convertStreamToString(InputStream is) {
-		/*
-		 * To convert the InputStream to String we use the
-		 * BufferedReader.readLine() method. We iterate until the BufferedReader
-		 * return null which means there's no more data to read. Each line will
-		 * appended to a StringBuilder and returned as String.
-		 */
-		BufferedReader reader = new BufferedReader(new InputStreamReader(is));
-		StringBuilder sb = new StringBuilder();
-
-		String line = null;
-		try {
-			while ((line = reader.readLine()) != null) {
-				sb.append(line + "\n");
-			}
-		}
-		catch (IOException e) {
-			e.printStackTrace();
-		} finally {
-			try {
-				is.close();
-			}
-			catch (IOException e) {
-				e.printStackTrace();
-			}
-		}
-		return sb.toString();
-	}
-
-	public Button.OnClickListener mPrev = new Button.OnClickListener() {
-		public void onClick(View v) {
-			String urlAll = getURL() + ":" + getPort()
-					+ "/api/controller/live/previous";
-			webCall(urlAll);
-		}
-	};
-
-	public Button.OnClickListener mNext = new Button.OnClickListener() {
-		public void onClick(View v) {
-			String urlAll = getURL() + ":" + getPort()
-					+ "/api/controller/live/next";
-			webCall(urlAll);
-		}
-	};
-
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		MenuInflater inflater = getMenuInflater();
-		inflater.inflate(R.menu.menu, menu);
-		return true;
-	}
-
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		// Handle item selection
-		switch (item.getItemId()) {
-		case R.id.preferences:
-			startActivity(new Intent(this, preferences.class));
-			return true;
-		default:
-			return super.onOptionsItemSelected(item);
-		}
-	}
+                }
+                else {
+                    returnString = "Unable to load page - " + response.getStatusLine();
+                }
+            }
+            catch (JSONException ex) {
+                returnString = "JSON failed: " + ex.getMessage();
+            }
+            catch (MalformedURLException e) {
+                returnString = "MalformedURLException: " + e.getMessage();
+            }
+            catch (IOException e) {
+                returnString = "IOException: " + e.getMessage();
+            }
+            catch (URISyntaxException e) {
+                returnString = "URISyntaxException: " + e.getMessage();
+            }
+            catch (IllegalArgumentException e) {
+                returnString = "IllegalArgumentException: " + e.getMessage();
+            }
+            return returnString;
+        }
+
+        @Override
+        protected void onPostExecute(String s) {
+            super.onPostExecute(s);
+            progressDialog.dismiss();
+            slideActivity.setTextViewText(s);
+        }
+
+        @Override
+        protected void onProgressUpdate(String[]... values) {
+            super.onProgressUpdate(values);
+            ListView lv1 = (ListView) findViewById(R.id.list);
+            lv1.setAdapter(new ArrayAdapter<String>(slideActivity, android.R.layout.simple_list_item_1, values[0]));
+        }
+    }
 }

=== removed file 'src/org/openlp/android/openlp.java'
--- src/org/openlp/android/openlp.java	2011-04-26 16:47:40 +0000
+++ src/org/openlp/android/openlp.java	1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
-package org.openlp.android;
-
-import android.app.TabActivity;
-import android.content.Intent;
-import android.os.Bundle;
-import android.widget.TabHost;
-
-public class openlp extends TabActivity {
-	/** Called when the activity is first created. */
-	@Override
-	public void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-
-		setContentView(R.layout.main);
-
-		TabHost tabHost = getTabHost(); // The activity TabHost
-		TabHost.TabSpec spec; // Reusable TabSpec for each tab
-		Intent intent; // Reusable Intent for each tab
-
-		// Create an Intent to launch an Activity for the tab (to be reused)
-		intent = new Intent().setClass(this, slide.class);
-
-		// Initialise a TabSpec for each tab and add it to the TabHost
-		spec = tabHost.newTabSpec("artists").setIndicator("Slide")
-				.setContent(intent);
-		tabHost.addTab(spec);
-		tabHost.setCurrentTab(1);
-
-		// Do the same for the other tabs
-		intent = new Intent().setClass(this, service.class);
-		spec = tabHost.newTabSpec("albums").setIndicator("Service")
-				.setContent(intent);
-		tabHost.addTab(spec);
-
-		// Do the same for the other tabs
-		intent = new Intent().setClass(this, misc.class);
-		spec = tabHost.newTabSpec("albums").setIndicator("Misc")
-				.setContent(intent);
-		tabHost.addTab(spec);
-
-	}
-}
\ No newline at end of file

=== removed file 'src/org/openlp/android/openlpActivity.java'
--- src/org/openlp/android/openlpActivity.java	2011-04-26 17:47:33 +0000
+++ src/org/openlp/android/openlpActivity.java	1970-01-01 00:00:00 +0000
@@ -1,64 +0,0 @@
-/******************************************************************************
-* OpenLP - Open Source Lyrics Projection                                      *
-* --------------------------------------------------------------------------- *
-* Copyright (c) 2008-2011 Raoul Snyman                                        *
-* Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
-* Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
-* Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
-* Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
-* --------------------------------------------------------------------------- *
-* This program is free software; you can redistribute it and/or modify it     *
-* under the terms of the GNU General Public License as published by the Free  *
-* Software Foundation; version 2 of the License.                              *
-*                                                                             *
-* This program is distributed in the hope that it will be useful, but WITHOUT *
-* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
-* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
-* more details.                                                               *
-*                                                                             *
-* You should have received a copy of the GNU General Public License along     *
-* with this program; if not, write to the Free Software Foundation, Inc., 59  *
-* Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
-*******************************************************************************/
-package org.openlp.android;
-
-import java.io.IOException;
-
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.DefaultHttpClient;
-
-import android.app.Activity;
-import android.content.SharedPreferences;
-
-/**
- * @author timali
- * 
- */
-public class openlpActivity extends Activity {
-	public String getURL() {
-		SharedPreferences prefs = getSharedPreferences("prefs", MODE_PRIVATE);
-		return "http://"; + prefs.getString("url", "192.168.0.3");
-	}
-
-	public String getPort() {
-		SharedPreferences prefs = getSharedPreferences("prefs", MODE_PRIVATE);
-		return prefs.getString("port", "4316");
-	}
-
-	public void webCall(String url) {
-		// Create a new HttpClient and post header
-		HttpClient httpclient = new DefaultHttpClient();
-		HttpGet httpget = new HttpGet(url);
-		try {
-			// Execute HTTP Post Request
-			httpclient.execute(httpget);
-		}
-		catch (ClientProtocolException e) {
-		}
-		catch (IOException e) {
-		}
-	}
-
-}

=== added directory 'src/org/openlp/android/utility'
=== added file 'src/org/openlp/android/utility/OpenLPHttpClient.java'
--- src/org/openlp/android/utility/OpenLPHttpClient.java	1970-01-01 00:00:00 +0000
+++ src/org/openlp/android/utility/OpenLPHttpClient.java	2011-05-04 10:36:21 +0000
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * OpenLP - Open Source Lyrics Projection                                      *
+ * --------------------------------------------------------------------------- *
+ * Copyright (c) 2008-2011 Raoul Snyman                                        *
+ * Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
+ * Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
+ * Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
+ * Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
+ * --------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it     *
+ * under the terms of the GNU General Public License as published by the Free  *
+ * Software Foundation; version 2 of the License.                              *
+ *                                                                             *
+ * This program is distributed in the hope that it will be useful, but WITHOUT *
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
+ * more details.                                                               *
+ *                                                                             *
+ * You should have received a copy of the GNU General Public License along     *
+ * with this program; if not, write to the Free Software Foundation, Inc., 59  *
+ * Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
+ *******************************************************************************/
+package org.openlp.android.utility;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.util.Log;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.params.BasicHttpParams;
+import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.HttpParams;
+import org.openlp.android.R;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+/**
+ * Personalised HttpClient to be used throughout OpenLP with customisable parameters.
+ */
+public class OpenLPHttpClient extends DefaultHttpClient {
+
+    private HttpGet httpGet;
+    private URL url;
+    private final String LOG_TAG = OpenLPHttpClient.class.getName();
+
+    public OpenLPHttpClient(Context context) {
+        SharedPreferences preferences = context.getSharedPreferences("prefs", Context.MODE_PRIVATE);
+        HttpParams httpParams = new BasicHttpParams();
+
+        int connectionTimeout = context.getResources().getInteger(R.integer.connectionTimeoutDefaultValue);
+        int socketTimeout = context.getResources().getInteger(R.integer.socketTimeoutDefaultValue);
+
+        if (preferences.getBoolean(context.getString(R.string.keyEnableCustomTimeout), false)) {
+            Log.d(LOG_TAG, String.format("Retrieving values for %s and %s...", context.getString(R.string.keyConnectionTimeout), context.getString(R.string.keySocketTimeout)));
+            connectionTimeout = Integer.parseInt(preferences.getString(context.getString(R.string.keyConnectionTimeout), String.valueOf(context.getResources().getInteger(R.integer.connectionTimeoutDefaultValue))));
+            socketTimeout = Integer.parseInt(preferences.getString(context.getString(R.string.keySocketTimeout), String.valueOf(context.getResources().getInteger(R.integer.socketTimeoutDefaultValue))));
+        }
+        HttpConnectionParams.setConnectionTimeout(httpParams, connectionTimeout);
+        HttpConnectionParams.setSoTimeout(httpParams, socketTimeout);
+
+        setParams(httpParams);
+
+        httpGet = new HttpGet();
+    }
+
+    public URL getUrl() {
+        return url;
+    }
+
+    public void setUrl(URL url) throws URISyntaxException {
+        this.url = url;
+        httpGet.setURI(getUrl().toURI());
+    }
+
+    public HttpResponse execute() throws IOException {
+        return super.execute(httpGet);
+    }
+}

=== added file 'src/org/openlp/android/utility/StringHelper.java'
--- src/org/openlp/android/utility/StringHelper.java	1970-01-01 00:00:00 +0000
+++ src/org/openlp/android/utility/StringHelper.java	2011-05-04 10:36:21 +0000
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * OpenLP - Open Source Lyrics Projection                                      *
+ * --------------------------------------------------------------------------- *
+ * Copyright (c) 2008-2011 Raoul Snyman                                        *
+ * Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
+ * Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
+ * Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
+ * Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
+ * --------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it     *
+ * under the terms of the GNU General Public License as published by the Free  *
+ * Software Foundation; version 2 of the License.                              *
+ *                                                                             *
+ * This program is distributed in the hope that it will be useful, but WITHOUT *
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
+ * more details.                                                               *
+ *                                                                             *
+ * You should have received a copy of the GNU General Public License along     *
+ * with this program; if not, write to the Free Software Foundation, Inc., 59  *
+ * Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
+ *******************************************************************************/
+package org.openlp.android.utility;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+/**
+ * String helper utility to do common string processing.
+ */
+public class StringHelper {
+    public synchronized static String convertStreamToString(InputStream is) {
+        /*
+                     * To convert the InputStream to String we use the
+                     * BufferedReader.readLine() method. We iterate until the BufferedReader
+                     * return null which means there's no more data to read. Each line will
+                     * appended to a StringBuilder and returned as String.
+                     */
+        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+        StringBuilder sb = new StringBuilder();
+
+        String line = null;
+        try {
+            while ((line = reader.readLine()) != null) {
+                sb.append(line + "\n");
+            }
+        }
+        catch (IOException e) {
+            e.printStackTrace();
+        }
+        finally {
+            try {
+                is.close();
+            }
+            catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return sb.toString();
+    }
+
+}


Follow ups