Skip to content

Commit 312a8dc

Browse files
committed
Initial commit
0 parents  commit 312a8dc

File tree

272 files changed

+13321
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+13321
-0
lines changed

.gitignore

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
# Created by https://www.gitignore.io/api/android,objective-c,swift,osx,windows,linux,java,intellij,gradle,maven
2+
3+
### Android ###
4+
# Built application files
5+
*.apk
6+
*.ap_
7+
8+
# Files for the Dalvik VM
9+
*.dex
10+
11+
# Java class files
12+
*.class
13+
14+
# Generated files
15+
bin/
16+
gen/
17+
18+
# Gradle files
19+
.gradle/
20+
build/
21+
22+
# Captures
23+
captures/
24+
25+
# Local configuration file (sdk path, etc)
26+
local.properties
27+
28+
# Proguard folder generated by Eclipse
29+
proguard/
30+
31+
# Log Files
32+
*.log
33+
34+
# Android Studio Navigation editor temp files
35+
.navigation/
36+
37+
### Android Patch ###
38+
gen-external-apklibs
39+
40+
### Swift ###
41+
# Xcode
42+
#
43+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
44+
45+
## Build generated
46+
build/
47+
DerivedData
48+
49+
## Various settings
50+
*.pbxuser
51+
!default.pbxuser
52+
*.mode1v3
53+
!default.mode1v3
54+
*.mode2v3
55+
!default.mode2v3
56+
*.perspectivev3
57+
!default.perspectivev3
58+
xcuserdata
59+
60+
## Other
61+
*.xccheckout
62+
*.moved-aside
63+
*.xcuserstate
64+
*.xcscmblueprint
65+
66+
## Obj-C/Swift specific
67+
*.hmap
68+
*.ipa
69+
70+
# CocoaPods
71+
#
72+
# We recommend against adding the Pods directory to your .gitignore. However
73+
# you should judge for yourself, the pros and cons are mentioned at:
74+
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
75+
#
76+
Pods/
77+
78+
# Carthage
79+
#
80+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
81+
# Carthage/Checkouts
82+
83+
Carthage/Build
84+
85+
# Fastlane / Bundler
86+
Gemfile.lock
87+
88+
89+
### OSX ###
90+
.DS_Store
91+
.AppleDouble
92+
.LSOverride
93+
94+
# Icon must end with two \r
95+
Icon
96+
97+
98+
# Thumbnails
99+
._*
100+
101+
# Files that might appear in the root of a volume
102+
.DocumentRevisions-V100
103+
.fseventsd
104+
.Spotlight-V100
105+
.TemporaryItems
106+
.Trashes
107+
.VolumeIcon.icns
108+
109+
# Directories potentially created on remote AFP share
110+
.AppleDB
111+
.AppleDesktop
112+
Network Trash Folder
113+
Temporary Items
114+
.apdisk
115+
116+
117+
### Windows ###
118+
# Windows image file caches
119+
Thumbs.db
120+
ehthumbs.db
121+
122+
# Folder config file
123+
Desktop.ini
124+
125+
# Recycle Bin used on file shares
126+
$RECYCLE.BIN/
127+
128+
# Windows Installer files
129+
*.cab
130+
*.msi
131+
*.msm
132+
*.msp
133+
134+
# Windows shortcuts
135+
*.lnk
136+
137+
138+
### Linux ###
139+
*~
140+
141+
# KDE directory preferences
142+
.directory
143+
144+
# Linux trash folder which might appear on any partition or disk
145+
.Trash-*
146+
147+
148+
### Java ###
149+
*.class
150+
151+
# Mobile Tools for Java (J2ME)
152+
.mtj.tmp/
153+
154+
# Package Files #
155+
*.jar
156+
*.war
157+
*.ear
158+
159+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
160+
hs_err_pid*
161+
162+
163+
### Intellij ###
164+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
165+
166+
*.iml
167+
168+
## Directory-based project format:
169+
.idea/
170+
# if you remove the above rule, at least ignore the following:
171+
172+
# User-specific stuff:
173+
# .idea/workspace.xml
174+
# .idea/tasks.xml
175+
# .idea/dictionaries
176+
177+
# Sensitive or high-churn files:
178+
# .idea/dataSources.ids
179+
# .idea/dataSources.xml
180+
# .idea/sqlDataSources.xml
181+
# .idea/dynamic.xml
182+
# .idea/uiDesigner.xml
183+
184+
# Gradle:
185+
# .idea/gradle.xml
186+
# .idea/libraries
187+
188+
# Mongo Explorer plugin:
189+
# .idea/mongoSettings.xml
190+
191+
## File-based project format:
192+
*.ipr
193+
*.iws
194+
195+
## Plugin-specific files:
196+
197+
# IntelliJ
198+
/out/
199+
200+
# mpeltonen/sbt-idea plugin
201+
.idea_modules/
202+
203+
# JIRA plugin
204+
atlassian-ide-plugin.xml
205+
206+
# Crashlytics plugin (for Android Studio and IntelliJ)
207+
com_crashlytics_export_strings.xml
208+
crashlytics.properties
209+
crashlytics-build.properties
210+
211+
212+
### Gradle ###
213+
.gradle
214+
build/
215+
216+
# Ignore Gradle GUI config
217+
gradle-app.setting
218+
219+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
220+
!gradle-wrapper.jar
221+
222+
223+
### Maven ###
224+
target/
225+
pom.xml.tag
226+
pom.xml.releaseBackup
227+
pom.xml.versionsBackup
228+
pom.xml.next
229+
release.properties
230+
dependency-reduced-pom.xml
231+
buildNumber.properties
232+
.mvn/timing.properties
233+
report.xml
234+
235+
testapp/src/main/assets/products.revision
236+
testapp/src/main/assets/products.major
237+
testapp/src/main/assets/products.minor
238+
testapp/src/main/assets/products.sqlite3
239+
testapp/src/main/assets/metadata.json
240+
maven-repository

.travis.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
language: android
2+
jdk: oraclejdk8
3+
sudo: false
4+
android:
5+
components:
6+
- platform-tools
7+
- tools
8+
- build-tools-27.0.3
9+
- android-27
10+
- extra-android-m2repository
11+
before_install:
12+
- yes | sdkmanager "platforms;android-27"
13+
script:
14+
- "./gradlew build"
15+
cache:
16+
directories:
17+
- "$HOME/.gradle/caches/"
18+
- "$HOME/.gradle/wrapper/"
19+
- "$HOME/.android/build-cache"
20+
env:
21+
global:
22+
secure: kA7y4Rhci3it9k2kW4/tKmoLR14HKsEj5FU+Jfg+zV00x6pW0LLe4qcMCr8/NsfrdaxIxeomMeXImyrAJdNoqeZBX+TMNWVuS+K+PGzQNeRgTiflVjel9hQvoBdGDdja8KcpKbrGw++YBku4x+EWiOrkY4lIZYHyp5vknKT1+l64nHtiWk0o47MY+0dc3/+S+VMG8MHV8OU0pPlMRN+KAaBCs8/6kHK4+850Q7/A7uEsKv6UVoGPhvSVlNU54VeetV2A4rb3j/uzm+ozpx2HNBQa60VbqvIHhguv6ZYnAzncIbAi0CJ08jVDkdI3FrotNTjuAFOgBgX9jm/a9+1NxrZ03DeKNlQkzyvdzmXKSj7uSt1OhLpCOwNJnhDNbg0dbD+WV9vqUdXBKRfvqfLsKo6wsYLCH0fhw4DEAl41VK5FwqozgfCJgiMBQL6ZpJHthaYhpzGzrNIDNS8eqZHvFSs8HYna74p86imNE7C4sZXBdUq1LLnGN7S8y1BwjzPqgAZIBK3scBtaOwoPUMYfcK/NqQ+w7ovW2t0cK/gwb+82DCaOUauie/RlqWeR7cnAqU7Hiu4526cz0qOGvfL5BRUtrnBFoR+47L5STiuEDSnDOGE6l19h6qRNB+EtfjXmufOwYho4W/ra9p1JzPAWd7uCdMiqhdx2Il+5XSxNT3w=
23+
deploy:
24+
- provider: script
25+
script: bash travis_release.sh
26+
skip_cleanup: true
27+
on:
28+
repo: snabble/Android-SDK
29+
tags: true
30+
branch: master
31+
- provider: releases
32+
skip_cleanup: true
33+
api_key:
34+
secure: RSusFhQL4TcENHK6SmeJvDWuHGJ8Rsit4cN2Qk2/L86i/dVJhL6YqH9ADQbkubNI/x6hSb9MabPJq6dc3dfKDLA6sDDLCBNKYmEtFQQDsAsTv0eh4PBsve5aKlENU+4JNXdvMM0Z/Cc7fRiKLk1KrwqmHgPjxOKEMmsigLw4UCaIc59PfuNe9CoFQXRroCc7xETwdQbQ+v5TdsbRH6Ic3CNTCEUSNsgTNIOmegzcNkQ+SiWw+uZzj656VfogpbTOmfqpSlxXMU8mcKWIeP5vgCZIKiJ+78M/brner+XzprStnKmwLIrg2EXOdAn+QZHiayonju1fRp45EwqVSR48vk7g9Vt1dmeYeWMfqvrzoQJU41eJ8S4jt/cOrvbz5Bde6Eme+NC1Zu8mSy9SGyyRd31IVu2A3DmajvwicD7zfXG2BlXTvFGyamnmcMnedNxVtKCWHeMzE7sDMVmOOMGuzZYoO/o+wBW7M1QgFQMU2ADk9xvHbYtqELZlZwIkNNkYAV+TeIxahr8FINpTUmQbF53uRWLdgNu4NENhoq5Vrbj9jY4BVSNqOXPv3ZZekIhAwfpUl0t97WILrHCH/RVUmOhswo46JBWy3gF1uMFRp3pi+/AWapKsbycdSARPVl1tCyjw7ZRqmdYAZvu+tZZrmZ+563V7qm0YAu0nOusac3c=
35+
file:
36+
- "core/build/outputs/aar/core-release.aar"
37+
- "ui/build/outputs/aar/ui-release.aar"
38+
- "ui-integration/build/outputs/aar/ui-integration-release.aar"
39+
- "utils/build/outputs/aar/utils-release.aar"
40+
on:
41+
repo: snabble/Android-SDK
42+
tags: true
43+
branch: master

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2018 snabble GmbH
4+
5+
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:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
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: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Snabble
2+
3+
Android SDK for Snabble
4+
5+
## Installation
6+
7+
#### Using the snabble github Repository
8+
9+
Add the snabble Repository to your gradle Repositories
10+
11+
```
12+
repositories {
13+
maven {
14+
url 'https://raw.githubusercontent.com/snabble/maven-repository/releases'
15+
}
16+
}
17+
```
18+
19+
Then add the library to your dependencies.
20+
21+
```gradle
22+
dependencies {
23+
// core library
24+
implementation 'io.snabble.sdk:core:{currentVersion}'
25+
26+
// user interface library
27+
implementation 'io.snabble.sdk:ui:{currentVersion}'
28+
29+
// user interface integration library, entirely optional,
30+
// for more seamless and easier integration in apps
31+
implementation 'io.snabble.sdk:ui-integration:{currentVersion}'
32+
}
33+
```
34+
35+
#### Locally
36+
37+
The library can be installed to the local maven repository using:
38+
39+
```sh
40+
./gradlew install
41+
```
42+
43+
Make sure you add maven local to your repositories in your gradle script.
44+
45+
```gradle
46+
repositories {
47+
mavenLocal()
48+
}
49+
```
50+
51+
Then add the library to your dependencies. (Note: The + means it always uses the latest version)
52+
53+
```gradle
54+
dependencies {
55+
implementation 'io.snabble.sdk:core:+'
56+
implementation 'io.snabble.sdk:ui:+'
57+
implementation 'io.snabble.sdk:ui-integration:+'
58+
}
59+
```
60+
61+
## Usage
62+
```
63+
//you may enable debug logging to see requests made by the sdk, and other various logs
64+
SnabbleSdk.setDebugLoggingEnabled(true);
65+
66+
SnabbleSdk.Config config = new SnabbleSdk.Config();
67+
config.metadataUrl = "/api/{projectId}/metadata/app/android/android/{appVersion}";
68+
config.endpointBaseUrl = "api.snabble.io";
69+
config.clientToken = clientToken;
70+
config.projectId = "demo";
71+
config.bundledMetadataAssetPath = "metadata.json";
72+
config.productDbName = "products.sqlite3";
73+
config.productDbBundledAssetPath = "products.sqlite3";
74+
config.productDbBundledRevisionId = getBundledRevisionId();
75+
config.productDbBundledSchemaVersionMajor = getBundledMajor();
76+
config.productDbBundledSchemaVersionMinor = getBundledMinor();
77+
78+
SnabbleSdk.setup(this, config, new SnabbleSdk.SetupCompletionListener() {
79+
@Override
80+
public void onReady(SnabbleSdk sdk) {
81+
//registers this sdk instance globally for use with ui components
82+
SnabbleUI.registerSdkInstance(sdk);
83+
}
84+
85+
@Override
86+
public void onError(final SnabbleSdk.Error error) {
87+
//various errors, like no space left on device
88+
//network connections could not be made (if no bundled data is provided)
89+
//see the enum declaration for more info
90+
}
91+
});
92+
```
93+
94+
## Author
95+
96+
snabble GmbH, Bonn

0 commit comments

Comments
 (0)