Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Test Activity: Restore the full test with sample db since it causes S…

…IGSEGV :-(
  • Loading branch information...
commit 56c7434c2a0ea58f8de995690d0165ee0d4c4bdd 1 parent 8126166
Mark Renouf authored

Showing 1 changed file with 5 additions and 9 deletions. Show diff stats Hide diff stats

  1. +5 9 src/com/bitgrind/android/SpatialiteTestActivity.java
14 src/com/bitgrind/android/SpatialiteTestActivity.java
@@ -4,7 +4,6 @@
4 4
5 5 import jsqlite.Callback;
6 6 import jsqlite.Exception;
7   -
8 7 import android.app.Activity;
9 8 import android.os.Bundle;
10 9 import android.os.Environment;
@@ -12,18 +11,15 @@
12 11
13 12 public class SpatialiteTestActivity extends Activity {
14 13
15   - private static final String TAG = SpatialiteTestActivity.class.getSimpleName();
16   -
  14 + private static final String TAG = SpatialiteTestActivity.class.getName();
17 15 @Override
18 16 protected void onCreate(Bundle savedInstanceState) {
19 17 super.onCreate(savedInstanceState);
20 18 setContentView(R.layout.main);
21   -
22 19 jsqlite.Database db = new jsqlite.Database();
23 20 try {
24   -
25   - db.open(Environment.getExternalStorageDirectory() + "/spatialite-test.db",
26   - jsqlite.Constants.SQLITE_OPEN_CREATE);
  21 + db.open(Environment.getExternalStorageDirectory() + "/spatialite_test.db",
  22 + jsqlite.Constants.SQLITE_OPEN_READONLY);
27 23 Callback cb = new Callback() {
28 24 @Override
29 25 public void columns(String[] coldata) {
@@ -44,9 +40,9 @@ public boolean newrow(String[] rowdata) {
44 40 return false;
45 41 }
46 42 };
47   - db.exec("SELECT spatialite_version();", cb);
  43 + db.exec("SELECT name, peoples, AsText(GaiaGeometry) from Towns where peoples > 350000 order by peoples DESC;", cb);
48 44 } catch (Exception e) {
49   - Log.e(TAG, "Exception caught", e);
  45 + e.printStackTrace();
50 46 }
51 47 }
52 48 }

0 comments on commit 56c7434

Please sign in to comment.
Something went wrong with that request. Please try again.