Skip to content

Commit

Permalink
Subhas/Akash | Fix HTTP Connection issues in Android
Browse files Browse the repository at this point in the history
  • Loading branch information
Subhas Dandapani committed Feb 7, 2013
1 parent 382330a commit 995c26e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ env:
- ANDROID_HOME=$HOME/android-sdk-linux
- secure: "eATae5kWD2tL3xtUdQjk4T5RWn4zv5OS4QXjwL9q/E4ntzge3rVPRGVSyS5/\nL/d48QLlliDzC6d7ycFVyEZC0OLzpHNER56vhP4YY9yfLygHr+NQJizPEiMJ\nPj5vUu9+qfOb3icQuQYDamuOCT7CxnVXSxVApfpFSSGz1YFpwfs="
matrix:
- ANDROID_SDKS=android-8 ANDROID_TARGET=android-8 ANDROID_ABI=armeabi
- ANDROID_SDKS=android-10 ANDROID_TARGET=android-10 ANDROID_ABI=armeabi
- ANDROID_SDKS=android-17,sysimg-17 ANDROID_TARGET=android-17 ANDROID_ABI=armeabi-v7a
# - ANDROID_SDKS=android-8 ANDROID_TARGET=android-8 ANDROID_ABI=armeabi
# - ANDROID_SDKS=android-10 ANDROID_TARGET=android-10 ANDROID_ABI=armeabi
- ANDROID_SDKS=android-15,sysimg-17 ANDROID_TARGET=android-15 ANDROID_ABI=armeabi-v7a
# - ANDROID_SDKS=android-17,sysimg-17 ANDROID_TARGET=android-17 ANDROID_ABI=armeabi-v7a

branches:
only:
Expand Down
1 change: 0 additions & 1 deletion RapidFTR-Android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.1.3</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public FormService(RapidFtrApplication context) {

public void getPublishedFormSections() throws IOException {
FluentResponse formSectionsResponse = http()
.path("/published_form_sections")
.context(context)
.path("/published_form_sections")
.get();

if (formSectionsResponse.isSuccess()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.http.entity.mime.content.ByteArrayBody;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.SingleClientConnManager;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.BasicHttpParams;
Expand Down Expand Up @@ -61,6 +62,8 @@ public FluentRequest host(String host) {
String[] parts = host.split("\\:\\/\\/");
scheme(parts[0]);
host = parts[1];
} else {
scheme("http");
}

uri.encodedAuthority(host);
Expand Down Expand Up @@ -228,7 +231,7 @@ private static HttpClient createHttpClient() {
registry.register(new Scheme("https", new SelfSignedSSLSocketFactory(trusted), 443));

HttpParams params = new BasicHttpParams();
ClientConnectionManager connectionManager = new ThreadSafeClientConnManager(params, registry);
ClientConnectionManager connectionManager = new SingleClientConnManager(params, registry);

return new DefaultHttpClient(connectionManager, params);
} catch (Exception e) {
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@
<artifactId>crittercism</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j</artifactId>
<version>0.7.2</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
Expand Down Expand Up @@ -170,6 +165,11 @@
<artifactId>commons-codec</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.2</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down

0 comments on commit 995c26e

Please sign in to comment.