Skip to content

Commit ed7861c

Browse files
committed
Revert "remove dokka documentation in favor of docs.snabble.io"
This reverts commit f95a729.
1 parent 2f0a8f4 commit ed7861c

File tree

19 files changed

+745
-5
lines changed

19 files changed

+745
-5
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,11 @@ jobs:
2525
env:
2626
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2727
run: ./gradlew publishAllPublicationsToGitHubPackagesRepository
28+
- name: Generate documentation
29+
run: ./gradlew dokkaGfmMultiModule && sed -E 's/^## \[([^[]+)\]$/## \1/g' CHANGELOG.md | sed -E 's/^### (.+)$/**\1**\n/g' | sed -E 's/All notable changes to this project will be documented in this file./All notable changes of the Android SDK are noted in this document./' > docs/docs/changelog.md
30+
- name: Deploy documentation
31+
uses: mhausenblas/mkdocs-deploy-gh-pages@nomaterial
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
CONFIG_FILE: docs/mkdocs.yml
35+
REQUIREMENTS: docs/requirements.txt

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44

55
Android SDK for Snabble
66

7-
## Documentation
8-
9-
You can find the full documentation of the snabble Platform at [docs.snabble.io](https://docs.snabble.io).
10-
117
## Requirements
128

139
```

build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ buildscript {
99

1010
dependencies {
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12+
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$kotlin_version"
13+
classpath "org.jetbrains.dokka:dokka-base:$kotlin_version"
1214
classpath 'com.android.tools.build:gradle:7.2.0'
1315
classpath 'gradle.plugin.com.github.jlouns:gradle-cross-platform-exec-plugin:0.5.0'
1416
classpath 'gradle.plugin.gmazzo:sqlite-plugin:0.2'
@@ -17,6 +19,7 @@ buildscript {
1719

1820
plugins {
1921
id 'maven-publish'
22+
id 'org.jetbrains.dokka'
2023
}
2124

2225
allprojects {
@@ -65,6 +68,17 @@ afterEvaluate {
6568
}
6669
}
6770

71+
tasks.named("dokkaHtml").configure {
72+
dokkaSourceSets {
73+
configureEach {
74+
skipDeprecated.set(true)
75+
}
76+
}
77+
}
78+
tasks.withType(org.jetbrains.dokka.gradle.AbstractDokkaTask).configureEach {
79+
outputDirectory.set(rootDir.toPath().resolve("docs/docs/api").toFile())
80+
}
81+
6882
task printVersion() {
6983
println project.sdkVersion
7084
}

core/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply from: '../scripts/maven.gradle'
44
apply plugin: 'org.jetbrains.kotlin.plugin.parcelize'
5+
apply plugin: 'org.jetbrains.dokka'
56

67
android {
78
compileSdkVersion project.compileSdkVersion

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
api

docs/docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
api
2+
changelog.md

docs/docs/android-api.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Installation
2+
3+
## Requirements
4+
5+
minSdkVersion = 21
6+
compileSdkVersion = 29
7+
java 8
8+
androidx
9+
10+
### Using the snabble GitHub Repository
11+
12+
Add the snabble maven repository for out and the Datatrans SDK:
13+
14+
``` groovy
15+
repositories {
16+
maven {
17+
url 'https://raw.githubusercontent.com/snabble/maven-repository/releases'
18+
}
19+
}
20+
```
21+
22+
Then add the library to your dependencies.
23+
24+
``` groovy
25+
dependencies {
26+
// core library
27+
implementation 'io.snabble.sdk:core:{{ extra.sdk_version }}'
28+
29+
// user interface library
30+
implementation 'io.snabble.sdk:ui:{{ extra.sdk_version }}'
31+
}
32+
```
33+
34+
### Locally
35+
36+
The library can be installed to the local maven repository using:
37+
38+
``` sh
39+
./gradlew publishToMavenLocal
40+
```
41+
42+
Make sure you add maven local to your repositories in your gradle script.
43+
44+
``` groovy
45+
repositories {
46+
mavenLocal()
47+
}
48+
```
49+
50+
Then add the library to your dependencies. (Note: The + means it always uses the latest version)
51+
52+
``` groovy
53+
dependencies {
54+
implementation 'io.snabble.sdk:core:{{ extra.sdk_version }}'
55+
implementation 'io.snabble.sdk:ui:{{ extra.sdk_version }}'
56+
implementation 'io.snabble.sdk:ui-integration:{{ extra.sdk_version }}'
57+
}
58+
```
59+
60+
## Usage
61+
``` java
62+
//you may enable debug logging to see requests made by the sdk, and other various logs
63+
Snabble.setDebugLoggingEnabled(true);
64+
65+
Snabble.Config config = new Snabble.Config();
66+
config.appId = <your app id>
67+
config.secret = <your secret>
68+
69+
// optional: provide a metadata file, store in the assets. That allows the sdk
70+
// init without requiring a network connection.
71+
config.bundledMetadataAssetPath = "metadata.json";
72+
73+
final Snabble snabble = Snabble.getInstance();
74+
snabble.setup(this, config, new Snabble.SetupCompletionListener() {
75+
@Override
76+
public void onReady() {
77+
// get the first project, there can be multiple projects per app
78+
project = snabble.getProjects().get(0);
79+
80+
// registers this project globally for use with ui components
81+
SnabbleUI.setProject(project);
82+
83+
// select the first shop for demo purposes, ideally this should be done with
84+
// geofencing or a manual user selection
85+
if (project.getShops().length > 0) {
86+
project.getCheckout().setShop(project.getShops()[0]);
87+
}
88+
89+
// optional: set a loyalty card id for identification, for demo purposes
90+
// we invent one here
91+
project.setLoyaltyCardId("testAppUserLoyaltyCardId");
92+
93+
// optional: load a bundled database file from the assets folder
94+
// this lowers the download size of database updates and the database is immediatly
95+
// available offline
96+
project.getProductDatabase().loadDatabaseBundle("db.sqlite3", revision, major, minor);
97+
98+
// recommended: download the latest product database for offline availability
99+
// it is highly recommended to call this in shorter time frames than config.maxProductDatabaseAge is set at
100+
// since the local database is only used if the time since the last update is smaller than
101+
// config.maxProductDatabaseAge, which defaults to 1 hour
102+
//
103+
// a good place for this is the onStart() method of your activity
104+
// database updates are usually very small since we are using delta updates for updating the database
105+
//
106+
// also a good place for database updates are background schedulers like
107+
// https://developer.android.com/topic/libraries/architecture/workmanager
108+
project.getProductDatabase().update();
109+
}
110+
111+
@Override
112+
public void onError(Snabble.Error error) {
113+
// connecton error if no metadata file is bundled or config error
114+
// if no appId or secret is provided
115+
}
116+
});
117+
```

docs/docs/index.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Introduction
2+
Offer Scan & Go to your customers in your own app – with the Snabble Mobile SDK. Our mobile SDK supports the entire range of Snabble base functionality including scanning, product lists, promotions, payment and shops.
3+
The SDK covers the whole communication with the Snabble Cloud-Platform and provides you with UI elements for your app that are easy to use and customize, so that you simplify the integration of Scan & Go into your app significantly.
4+
For details about integrating with the Snabble Cloud-Platform, please see the [Platform Documentation](https://github.com/snabble/docs) on GitHub.
5+
6+
## Distribution & Download
7+
### iOS
8+
* [Snabble Mobile SDK for iOS on GitHub](https://github.com/snabble/iOS-SDK)
9+
* Supported iOS versions: iOS 12+
10+
11+
### Android
12+
* [Snabble Mobile SDK for Android on GitHub](https://github.com/snabble/Android-SDK)
13+
* [Sample Apps](sample-apps.md)
14+
* Supported Android versions: Android 8+
15+
16+
## Feature Overview
17+
### Scanning Products
18+
The SDK comes with a standard scanner functionality and the ability to match the scanned data to products, coupons or even deposits. The product data is provided through the SDK with great performance and includes all necessary product details also covering special cases like age verification, multiple taxation options or product related discounts and promotions.
19+
With this enriched product data and the provided SDK UI elements it is very simple to integrate a fully functional product scanner into your app.
20+
### Offline Synchronisation
21+
When entering a store with an app using the Snabble Mobile SDK, product data is downloaded into the app. This not only allows for a much faster scan result, but more importantly, it allows for scanning in areas of the store where no connection to the internet is available. After the purchase, product data is kept up-to-date via intelligent delta updates.
22+
### Cart
23+
The SDK comes with ready to use UI for the shopping cart that is already integrated into the scanner view. The cart handles not just adding and removing products but also synchronization with the Snabble Cloud-Platform. In this way the cart is automatically processed and updated by Snabble Cloud-Platform components like a promotion engine.
24+
In this way the cart always shows correct pricing information considering applicable coupons, manual discounts, bundles or similar promotion logic.
25+
The SDK UI elements for the cart already include visual representation of special cart items like 18+ products or applied promotions.
26+
### Promotions
27+
The Snabble Cloud-Platform already provides a powerful promotion engine to manage promotions. If you choose to use your own system to manage promotions this system will be integrated into the Snabble Cloud-Platform in advance. In all cases the SDK provides you with ready to use functionality for promotions.
28+
There are two main promotion functions provided through the SDK:
29+
manual discounts
30+
manual discounts that can be selected by the customer during the scanning process. The SDK UI elements for the product scanner contain elements for the selection of manual discounts if these are configured in the promotion engine.
31+
shopping cart calculation
32+
automated calculation and updates of the shopping cart using the promotion logic attached to the Snabble Cloud-Platform. The visual representation of applied promotions is already included in the SDK UI elements for the shopping cart.
33+
### Loyalty Cards
34+
Loyalty Cards can be added to the app by scanning or entering the information using the keyboard. Added loyalty cards are then automatically applied to each checkout.
35+
<!--
36+
### Empties And Deposits
37+
### Vending Machine Output
38+
### Checkout Options
39+
Lorem ipsum
40+
-->
41+
### Payment
42+
Using the Snabble Mobile SDK, your app is able to handle payments with the Payment Service Providers Fiserv (First Data, Telecash), PayOne and Datatrans. You choose which payment methods you want to offer to your customers. These payment methods are currently supported by our Snabble Mobile SDK:
43+
44+
#### Fiserv (First Data, Telecash)
45+
* SEPA Direct Debit
46+
* Credit Cards (VISA, MasterCard, American Express)
47+
* Apple Pay
48+
* Google Pay
49+
#### PayOne
50+
* SEPA Direct Debit
51+
* Credit Cards (VISA, MasterCard, American Express)
52+
#### Datatrans
53+
* Postfinance
54+
* Twint
55+
56+
### Offline Payment
57+
The Snabble Mobile SDK is also able to generate a QR code containing the cart information. This QR code can be scanned by your PoS/Cashdesk. Payment is then handled by your PoS.
58+
### Shop List And Details
59+
A list of available shops is downloaded from the Snabble Cloud-Platform and shown in a table list inside the app. If the user has allowed to use geolocation, the shops are sorted by distance to the user. Also, a detail view of each shop is available, including a map view.
60+

docs/docs/logo.svg

Lines changed: 6 additions & 0 deletions
Loading

docs/docs/sample-apps.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sample apps
2+
3+
We have three sample apps one legacy app written in Java and a two newer written in Kotlin. You can find
4+
both apps in the git repository in the directories [java-sample], [kotlin-sample] and [kotlin-customization-sample].

0 commit comments

Comments
 (0)