Skip to content

Commit 573b90b

Browse files
committed
Initial app skeleton
0 parents  commit 573b90b

Some content is hidden

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

54 files changed

+1688
-0
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Docspell Android Client
2+
3+
This is a very basic android app that can be used to upload files from
4+
your android device to [docspell](https://docspell.org).
5+
6+
It works as follows:
7+
8+
- create a list of docspell urls and store them inside the app
9+
- the app hooks into the "share with" android menu
10+
- Use whatever app, for example a document scanner app and share the
11+
result with the docspell android app. It will upload it to the
12+
configured url.
13+
14+
## Helpers
15+
16+
- https://nixos.wiki/wiki/Android
17+
- https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout
18+
- https://www.android-examples.com/android-swipe-down-to-refresh-recyclerview/
19+
- https://developer.android.com/studio/write/java8-support.html
20+
- https://stackoverflow.com/questions/31367599/how-to-update-recyclerview-adapter-data

app/.gitignore

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

app/build.gradle

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 30
5+
buildToolsVersion "30.0.1"
6+
7+
defaultConfig {
8+
applicationId "org.docspell.docspellshare"
9+
minSdkVersion 21
10+
targetSdkVersion 30
11+
versionCode 1
12+
versionName "1.0"
13+
14+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15+
}
16+
17+
buildTypes {
18+
release {
19+
minifyEnabled false
20+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21+
}
22+
}
23+
compileOptions {
24+
sourceCompatibility JavaVersion.VERSION_1_8
25+
targetCompatibility JavaVersion.VERSION_1_8
26+
}
27+
}
28+
29+
dependencies {
30+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'
31+
32+
implementation fileTree(dir: "libs", include: ["*.jar"])
33+
implementation 'androidx.appcompat:appcompat:1.1.0'
34+
implementation 'com.google.android.material:material:1.1.0'
35+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
36+
implementation 'androidx.navigation:navigation-fragment:2.3.0'
37+
implementation 'androidx.navigation:navigation-ui:2.3.0'
38+
implementation 'me.dm7.barcodescanner:zxing:1.9.13'
39+
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
40+
testImplementation 'junit:junit:4.13'
41+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
42+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
43+
44+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package org.docspell.docspellshare;
2+
3+
import static org.junit.Assert.*;
4+
5+
import android.content.Context;
6+
import androidx.test.ext.junit.runners.AndroidJUnit4;
7+
import androidx.test.platform.app.InstrumentationRegistry;
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
15+
*/
16+
@RunWith(AndroidJUnit4.class)
17+
public class ExampleInstrumentedTest {
18+
@Test
19+
public void useAppContext() {
20+
// Context of the app under test.
21+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
22+
assertEquals("org.docspell.docspellshare", appContext.getPackageName());
23+
}
24+
}

app/src/main/AndroidManifest.xml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="org.docspell.docspellshare"
4+
android:installLocation="auto">
5+
6+
<uses-permission android:name="android.permission.CAMERA" />
7+
<uses-permission android:name="android.permission.INTERNET" />
8+
9+
<application
10+
android:allowBackup="true"
11+
android:fullBackupContent="@xml/backup_rules"
12+
android:icon="@drawable/logo_96"
13+
android:label="@string/app_name"
14+
android:supportsRtl="true"
15+
android:theme="@style/AppTheme">
16+
17+
<activity
18+
android:name=".activity.QrCodeActivity"
19+
android:label="@string/title_activity_qrcode" />
20+
<activity
21+
android:name=".activity.ShareActivity"
22+
android:label="@string/title_activity_share">
23+
<intent-filter>
24+
<action android:name="android.intent.action.SEND" />
25+
<action android:name="android.intent.action.SEND_MULTIPLE" />
26+
27+
<category android:name="android.intent.category.DEFAULT" />
28+
29+
<data android:mimeType="image/*" />
30+
<data android:mimeType="application/*" />
31+
<data android:mimeType="text/*" />
32+
</intent-filter>
33+
</activity>
34+
<activity
35+
android:name=".activity.AddUrlActivity"
36+
android:label="@string/create_new_url" />
37+
<activity
38+
android:name=".activity.MainActivity"
39+
android:label="@string/title_activity_main"
40+
android:theme="@style/AppTheme.NoActionBar">
41+
<intent-filter>
42+
<action android:name="android.intent.action.MAIN" />
43+
44+
<category android:name="android.intent.category.LAUNCHER" />
45+
</intent-filter>
46+
</activity>
47+
</application>
48+
49+
</manifest>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.docspell.docspellshare;
2+
3+
public interface Fun<A, B> {
4+
5+
B apply(A a);
6+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package org.docspell.docspellshare;
2+
3+
import android.content.ContentResolver;
4+
import android.net.Uri;
5+
6+
public final class HttpRequest {
7+
private HttpRequest() {}
8+
9+
public void execute() {}
10+
11+
public static Builder newBuilder() {
12+
return new Builder();
13+
}
14+
15+
public static class Builder {
16+
17+
public Builder addFile(ContentResolver resolver, Uri data) {
18+
return this;
19+
}
20+
21+
public HttpRequest build() {
22+
return new HttpRequest();
23+
}
24+
}
25+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.docspell.docspellshare;
2+
3+
public interface Lazy<A> {
4+
5+
A get();
6+
}

0 commit comments

Comments
 (0)