Skip to content

Commit

Permalink
persist trajectories in sqlite
Browse files Browse the repository at this point in the history
this is work in progress. i'm not happy with this:
- the sqlite binding is incredibly slow for some reason.
- we don't have spatial operators (can't offload inference work to DB)
- we drop support for browsers (need a fallback)

spatial queries could be enabled by forking the plugin and using a
custom spatialite binding instead of sqlcipher, though thats gonna
be quite some effort.
  • Loading branch information
noerw committed Oct 15, 2020
1 parent bc68574 commit 88146d2
Show file tree
Hide file tree
Showing 11 changed files with 537 additions and 204 deletions.
2 changes: 1 addition & 1 deletion android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {

apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {

implementation project(':capacitor-community-sqlite')
implementation "com.google.android.gms:play-services-location:11+"
implementation "com.android.support:support-v4:26+"
implementation "com.android.support:appcompat-v7:26+"
Expand Down
6 changes: 4 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@

<!-- Permissions -->

<!-- fetch basemap tiles -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Camera, Photos, input file -->
<!-- read: import trajectories. write: store sqlite DB -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- Geolocation API -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-feature android:name="android.hardware.location.gps" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.getcapacitor.BridgeActivity;
import com.getcapacitor.Plugin;
import com.getcapacitor.community.database.sqlite.CapacitorSQLite;

import java.util.ArrayList;

Expand All @@ -16,6 +17,7 @@ public void onCreate(Bundle savedInstanceState) {
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(CapacitorSQLite.class);
}});
}
}
3 changes: 3 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')

include ':capacitor-community-sqlite'
project(':capacitor-community-sqlite').projectDir = new File('../node_modules/@capacitor-community/sqlite/android')
1 change: 1 addition & 0 deletions ios/App/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def capacitor_pods
# Automatic Capacitor Pod dependencies, do not delete
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCommunitySqlite', :path => '../../node_modules/@capacitor-community/sqlite'
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
# Do not delete
end
Expand Down
Loading

0 comments on commit 88146d2

Please sign in to comment.