Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…IGSEGV :-(
  • Loading branch information...
commit 56c7434c2a0ea58f8de995690d0165ee0d4c4bdd 1 parent 8126166
@mrenouf authored
Showing with 5 additions and 9 deletions.
  1. +5 −9 src/com/bitgrind/android/SpatialiteTestActivity.java
View
14 src/com/bitgrind/android/SpatialiteTestActivity.java
@@ -4,7 +4,6 @@
import jsqlite.Callback;
import jsqlite.Exception;
-
import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
@@ -12,18 +11,15 @@
public class SpatialiteTestActivity extends Activity {
- private static final String TAG = SpatialiteTestActivity.class.getSimpleName();
-
+ private static final String TAG = SpatialiteTestActivity.class.getName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
-
jsqlite.Database db = new jsqlite.Database();
try {
-
- db.open(Environment.getExternalStorageDirectory() + "/spatialite-test.db",
- jsqlite.Constants.SQLITE_OPEN_CREATE);
+ db.open(Environment.getExternalStorageDirectory() + "/spatialite_test.db",
+ jsqlite.Constants.SQLITE_OPEN_READONLY);
Callback cb = new Callback() {
@Override
public void columns(String[] coldata) {
@@ -44,9 +40,9 @@ public boolean newrow(String[] rowdata) {
return false;
}
};
- db.exec("SELECT spatialite_version();", cb);
+ db.exec("SELECT name, peoples, AsText(GaiaGeometry) from Towns where peoples > 350000 order by peoples DESC;", cb);
} catch (Exception e) {
- Log.e(TAG, "Exception caught", e);
+ e.printStackTrace();
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.