Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Does anyone know if it is possible to get Spatialite running on Android? Specifically for either Android 2.1 or 2.2.

I've been browsing the web, and although it seems technically possible, I haven't been able to find any procedures,tutorials,examples...etc to accomplish this. I'm new to Android development, so the simpler the instructions the better.

Any tips,comments,warnings welcome.

share|improve this question
add comment

6 Answers

I couldn't say for Android but I've been able to do it for iOS.

The thing you need to consider is that spatialite requires native GEOS and PROJ4 libraries to work properly (for spatial indexes), so those ones also need to be compiled.

The version of sqlite required by spatialite may also be different from the one that is distributed in the platform (this is the case in iOS : the sqlite version is too old to be used directly by spatialite), that's why the right way to do it is to get the "amalgation" version of spatialite (that also encapsulate sqlite) and compile from that.

http://www.gaia-gis.it/spatialite/sources.html

There is a short notice on the spatialite site with some info about how to build spatialite: http://www.gaia-gis.it/spatialite/how_to_build_libspatialite.html

For GEOS and PROJ4, you should be able to compile them from the scripts delivered with the project easily. However, on my side, even if the compilation went fine with the scripts, I had some side effects at runtime with double type (some were NaN), so I compiled them directly in XCode (the iOS dev env) and the runtime behavior was OK then.

share|improve this answer
1  
Cool. Is this app in the App Store? –  Ragi Yaser Burhum Nov 26 '11 at 18:09
    
Also, did you add GEOS? –  Ragi Yaser Burhum Nov 26 '11 at 18:10
    
You should write a book yonel. I can't get enough of this hope you're promulgating, everybody else seems to believe this is nearly impossible –  boulder_ruby Feb 24 at 2:00
add comment

Looks like someone has started some of the hard work already:

https://github.com/mrenouf/android-spatialite

Going to have a look at the project and will provide some feedback over the next little while.

share|improve this answer
add comment

Its also worth noting:

https://bitbucket.org/nutiteq/android-map-samples/src/4c79d8058d55/jni/

There's an NDK build setup with SpatialSQLite

HTH

share|improve this answer
add comment

There is now a stable version of SpatiaLite for Android as announced by Sandro Furieri on the Google Group: https://groups.google.com/forum/?fromgroups=#!topic/spatialite-users/tnmc-sOK1PM

You may also want to check out Bill Dollin's blog post: http://blog.geomusings.com/2012/11/26/spatialite-for-android-available/

share|improve this answer
add comment

Speaking as a somewhat knowledgeable but not expert Android user - you would have to compile spatialite for Android. Remember your android phone is a headless linux machine so it would be possible but you would have to compile. I recommend looking at the NDK (the native dev kit for android (http://developer.android.com/sdk/ndk/index.html)

Hope that helps...

share|improve this answer
add comment

You should check out the Spatialite-Users Google Group if you haven't already. I found the following thread which may be of interest.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.