Skip to content

Commit 5a9a629

Browse files
committed
first commit
0 parents  commit 5a9a629

14 files changed

Lines changed: 613 additions & 0 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
# OSX
3+
#
4+
.DS_Store
5+
6+
# node.js
7+
#
8+
node_modules/
9+
npm-debug.log
10+
yarn-error.log
11+
12+
13+
# Xcode
14+
#
15+
build/
16+
*.pbxuser
17+
!default.pbxuser
18+
*.mode1v3
19+
!default.mode1v3
20+
*.mode2v3
21+
!default.mode2v3
22+
*.perspectivev3
23+
!default.perspectivev3
24+
xcuserdata
25+
*.xccheckout
26+
*.moved-aside
27+
DerivedData
28+
*.hmap
29+
*.ipa
30+
*.xcuserstate
31+
project.xcworkspace
32+
33+
34+
# Android/IntelliJ
35+
#
36+
build/
37+
.idea
38+
.gradle
39+
local.properties
40+
*.iml
41+
42+
# BUCK
43+
buck-out/
44+
\.buckd/
45+
*.keystore
46+

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright National Institute of Statistics and Census of Argentina and other contributors
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
# react-native-spatialite
3+
4+
React Native Spatialite Plugin for Android
5+
6+
## Getting started
7+
8+
`$ npm install react-native-spatialite --save`
9+
10+
### Manual installation
11+
12+
#### Android
13+
14+
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
15+
- Add `import ar.gov.indec.react.spatialite.SpatialiteReactPackage;` to the imports at the top of the file
16+
- Add `new SpatialiteReactPackage()` to the list returned by the `getPackages()` method
17+
18+
2. Append the following lines to `android/settings.gradle`:
19+
20+
```
21+
include ':react-native-spatialite'
22+
23+
project(':react-native-spatialite').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-spatialite/android')
24+
```
25+
26+
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
27+
28+
```
29+
compile project(':react-native-spatialite')
30+
```
31+
32+
4. Add JitPack in `android/build.gradle` as repository
33+
```
34+
allprojects {
35+
repositories {
36+
...
37+
maven { url 'https://jitpack.io' }
38+
...
39+
}
40+
}
41+
```
42+
43+
## Usage
44+
```javascript
45+
import db from 'react-native-spatialite';
46+
47+
db.createConnection('test.db').then(connected => {
48+
console.log('Database is connected', connected);
49+
return db.getVersion();
50+
}).then(
51+
array => {
52+
console.log({arr});
53+
return db.executeQuery('SELECT * FROM MyTable');
54+
}
55+
).then(
56+
rows => {
57+
console.log({rows});
58+
}
59+
).catch(
60+
err => {
61+
throw err;
62+
}
63+
);
64+
```
65+

android/build.gradle

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
buildscript {
3+
repositories {
4+
jcenter()
5+
}
6+
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:1.3.1'
9+
}
10+
}
11+
12+
apply plugin: 'com.android.library'
13+
14+
android {
15+
compileSdkVersion 23
16+
buildToolsVersion "23.0.1"
17+
18+
defaultConfig {
19+
minSdkVersion 16
20+
targetSdkVersion 22
21+
versionCode 1
22+
versionName "1.0"
23+
}
24+
lintOptions {
25+
abortOnError false
26+
}
27+
}
28+
29+
repositories {
30+
mavenCentral()
31+
maven { url 'https://jitpack.io' }
32+
}
33+
34+
dependencies {
35+
compile 'com.facebook.react:react-native:+'
36+
compile 'com.github.sevar83:android-spatialite:1.0.7'
37+
}
38+
52.4 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Fri Feb 24 09:59:14 ART 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip

android/gradlew

Lines changed: 160 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)