Giter VIP home page Giter VIP logo

hellotospatialite's Introduction

HelloToSpatialite

HelloToSpatialite is a relatively simple 'hello world' application illustrating the usage of spatialite android.

I started with the [original spatialite android tutorial] (https://www.gaia-gis.it/fossil/libspatialite/wiki?name=spatialite-android-tutorial) making changes to bring this tutorial into the more recent Android Studio (v1.3) build environments.

I also deviated a bit from this example by:

  • embedding the sqlite database in the application (versus loading on external storage)
  • using a different sqlite database than in the tutorial
  • See my guide on recreating the source data from this app
  • using different SQL examples
  • See GeoDatabaseHandler.java

This example relies on the Android module Spatialite-Database-Driver. Therefore, you will also need to get a copy of that lib:

git clone https://github.com/kristina-hager/Spatialite-Database-Driver.git

This example assumes you've put the directory for 'Spatialite-Database-Driver' in the same directory as 'HelloToSpatialite'.

Changes to enable usage of Spatialite-Database-Driver

app/build.gradle

  • Add dependency on Spatialite-Database-Driver

compile project(':..:Spatialite-Database-Driver:spatialite-db-driver')

settings.gradle

include ':app', '..:Spatialite-Database-Driver:spatialite-db-driver'

task copyNativeLibs(type: Copy) {
    from(new File(project(':..:Spatialite-Database-Driver:spatialite-db-driver').projectDir, 'src/main/java/jniLibs')) {
        include 'armeabi/libjsqlite.so'
        include 'armeabi-v7a/libjsqlite.so'
    }
    into new File(buildDir, 'native-libs')
}
tasks.withType(JavaCompile) { compileTask -> compileTask.dependsOn copyNativeLibs }
clean.dependsOn 'cleanCopyNativeLibs'

tasks.withType(PackageApplication) { pkgTask ->
    //pkgTask.jniDir new File(buildDir, 'native-libs')
    pkgTask.jniFolders = new HashSet<File>()
    pkgTask.jniFolders.add(new File(buildDir, 'native-libs'))
}

hellotospatialite's People

Contributors

kristina-hager avatar

Stargazers

Francisco Casas Salgado avatar Eric Zhang avatar Matt Roberts avatar  avatar Valentin Sasyan avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

jkyishon mvits

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.