Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Launch from /data/data/app/cache

  • Loading branch information...
commit de6b5ee1d93ab53a47b8135f4d420c201d62f42a 1 parent e3fde5a
Dale Harvey authored
View
BIN  assets/release-0.1.tgz.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 src/com/couchbase/libcouch/CouchInstaller.java
@@ -34,7 +34,7 @@
final static String TAG = "CouchDB";
public static String dataPath() {
- return "/data/data/" + appNamespace;
+ return "/data/data/" + appNamespace + "/cache";
}
public static String externalPath() {
return Environment.getExternalStorageDirectory() + "/Android/data/" + appNamespace;
@@ -87,7 +87,7 @@ private static void installPackage(String baseUrl, String pkg, Handler handler,
Map<String, String> allInstalledLinks = new HashMap<String, String>();
InputStream instream = null;
-
+
// If no URL is provided, load tarball from assets.
if (baseUrl == null) {
// XXX Stupid android 2.1 bug
@@ -96,14 +96,14 @@ private static void installPackage(String baseUrl, String pkg, Handler handler,
// XXX Certain files are NOT auto compressed (eg. jpg).
instream = service.getAssets().open(pkg + ".tgz" + ".jpg");
}
-
+
else {
HttpClient pkgHttpClient = new DefaultHttpClient();
HttpGet tgzrequest = new HttpGet(baseUrl + pkg + ".tgz");
HttpResponse response = pkgHttpClient.execute(tgzrequest);
StatusLine status = response.getStatusLine();
Log.d(TAG, "Request returned status " + status);
-
+
if (status.getStatusCode() == 200) {
HttpEntity entity = response.getEntity();
instream = entity.getContent();
@@ -113,7 +113,7 @@ private static void installPackage(String baseUrl, String pkg, Handler handler,
throw new IOException();
}
}
-
+
// Ensure /sdcard/Android/data/com.my.app exists
File externalPath = new File(externalPath() + "/");
if (!externalPath.exists()) {
Please sign in to comment.
Something went wrong with that request. Please try again.