From 0cc57833b2e4aef20799dd25baaac6162128287e Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Thu, 10 Nov 2022 00:35:19 +0100 Subject: Initial commit App is able to share single file. Server is outside of vcs for time being and is able to process multiple files. Authorization is done with HTTP Basi Authorization. Nginx is listing files. --- android/app/.gitignore | 1 + android/app/build.gradle | 39 +++++ android/app/proguard-rules.pro | 21 +++ .../ExampleInstrumentedTest.java | 26 ++++ android/app/src/main/AndroidManifest.xml | 38 +++++ .../com/jopek/submittodatiinator/MainActivity.java | 86 +++++++++++ .../com/jopek/submittodatiinator/Requests.java | 151 ++++++++++++++++++ .../res/drawable-v24/ic_launcher_foreground.xml | 30 ++++ .../main/res/drawable/ic_launcher_background.xml | 170 +++++++++++++++++++++ android/app/src/main/res/layout/activity_main.xml | 19 +++ .../src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../res/mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../app/src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 1404 bytes .../main/res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 2898 bytes .../app/src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 982 bytes .../main/res/mipmap-mdpi/ic_launcher_round.webp | Bin 0 -> 1772 bytes .../app/src/main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 1900 bytes .../main/res/mipmap-xhdpi/ic_launcher_round.webp | Bin 0 -> 3918 bytes .../src/main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 2884 bytes .../main/res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 0 -> 5914 bytes .../src/main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 3844 bytes .../main/res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 0 -> 7778 bytes android/app/src/main/res/values-night/themes.xml | 16 ++ android/app/src/main/res/values/colors.xml | 10 ++ android/app/src/main/res/values/strings.xml | 3 + android/app/src/main/res/values/themes.xml | 16 ++ android/app/src/main/res/xml/backup_rules.xml | 13 ++ .../app/src/main/res/xml/data_extraction_rules.xml | 19 +++ .../jopek/submittodatiinator/ExampleUnitTest.java | 17 +++ 29 files changed, 685 insertions(+) create mode 100644 android/app/.gitignore create mode 100644 android/app/build.gradle create mode 100644 android/app/proguard-rules.pro create mode 100644 android/app/src/androidTest/java/com/jopek/submittodatiinator/ExampleInstrumentedTest.java create mode 100644 android/app/src/main/AndroidManifest.xml create mode 100644 android/app/src/main/java/com/jopek/submittodatiinator/MainActivity.java create mode 100644 android/app/src/main/java/com/jopek/submittodatiinator/Requests.java create mode 100644 android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 android/app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 android/app/src/main/res/layout/activity_main.xml create mode 100644 android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 android/app/src/main/res/values-night/themes.xml create mode 100644 android/app/src/main/res/values/colors.xml create mode 100644 android/app/src/main/res/values/strings.xml create mode 100644 android/app/src/main/res/values/themes.xml create mode 100644 android/app/src/main/res/xml/backup_rules.xml create mode 100644 android/app/src/main/res/xml/data_extraction_rules.xml create mode 100644 android/app/src/test/java/com/jopek/submittodatiinator/ExampleUnitTest.java (limited to 'android/app') diff --git a/android/app/.gitignore b/android/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/android/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000..2531936 --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,39 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.jopek.submittodatiinator' + compileSdk 32 + + defaultConfig { + applicationId "com.jopek.submittodatiinator" + minSdk 28 + targetSdk 32 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'com.google.android.material:material:1.7.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' +} \ No newline at end of file diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/android/app/src/androidTest/java/com/jopek/submittodatiinator/ExampleInstrumentedTest.java b/android/app/src/androidTest/java/com/jopek/submittodatiinator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..d6ed510 --- /dev/null +++ b/android/app/src/androidTest/java/com/jopek/submittodatiinator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.jopek.submittodatiinator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.jopek.submittodatiinator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f8bf960 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/java/com/jopek/submittodatiinator/MainActivity.java b/android/app/src/main/java/com/jopek/submittodatiinator/MainActivity.java new file mode 100644 index 0000000..467c5be --- /dev/null +++ b/android/app/src/main/java/com/jopek/submittodatiinator/MainActivity.java @@ -0,0 +1,86 @@ +package com.jopek.submittodatiinator; + +import android.annotation.SuppressLint; +import android.app.ProgressDialog; +import android.content.Intent; +import android.database.Cursor; +import android.net.Uri; +import android.os.Bundle; +import android.provider.MediaStore; +import android.provider.OpenableColumns; +import android.util.Log; +import android.widget.TextView; + +import androidx.appcompat.app.AppCompatActivity; + +public class MainActivity extends AppCompatActivity { + /********** File Path *************/ + TextView messageText; + ProgressDialog dialog = null; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + messageText = findViewById(R.id.tv); + + //dialog = ProgressDialog.show(MainActivity.this, "", "Uploading file...", true); + + Intent intent = getIntent(); + String action = intent.getAction(); + String type = intent.getType(); + Uri fileUri = null; + + if (Intent.ACTION_SEND.equals(action) && type != null) { + Object object = intent.getParcelableExtra(Intent.EXTRA_STREAM); + if(object != null && object instanceof Uri) fileUri = (Uri) object; +// if (type.startsWith("image/")) { +// fileUri = intent.getParcelableExtra(Intent.EXTRA_STREAM); +// } +// if (type.startsWith("video/")) { +// fileUri = intent.getParcelableExtra(Intent.EXTRA_STREAM); +// } +// if (type.startsWith("application/")) { +// fileUri = intent.getParcelableExtra(Intent.EXTRA_STREAM); +// } + } + + Log.d("maks", "45: fileUri: " + fileUri); + if (fileUri != null) { +// String sourceFileUri = getRealPathFromURI(fileUri); + String sourceFileUri = fileUri.getPath(); + Uri finalFileUri = fileUri; + new Thread(() -> { + runOnUiThread(() -> messageText.setText("uploading started...")); + Log.d("maks", "onCreate: " + sourceFileUri); + Requests.ReturnValues retVal = Requests.uploadFile(this, finalFileUri); + switch (retVal) { + case MALFORMED_URL: + case NO_FILE: + case SERVER_ERROR: + runOnUiThread(() -> messageText.setText("error while uploading...")); + break; + case OK: + runOnUiThread(() -> messageText.setText("File uploaded!")); + break; + } + }).start(); + } + } + + public String getRealPathFromURI(Uri contentUri) { + Cursor cursor = null; + try { + cursor = this.getContentResolver().query(contentUri, new String[]{android.provider.MediaStore.Images.ImageColumns.DATA}, null, null, null); + cursor.moveToFirst(); + String filePath = cursor.getString(0); + cursor.close(); + return filePath; + } finally { + if (cursor != null) { + cursor.close(); + } + } + } +} \ No newline at end of file diff --git a/android/app/src/main/java/com/jopek/submittodatiinator/Requests.java b/android/app/src/main/java/com/jopek/submittodatiinator/Requests.java new file mode 100644 index 0000000..fafc87d --- /dev/null +++ b/android/app/src/main/java/com/jopek/submittodatiinator/Requests.java @@ -0,0 +1,151 @@ +package com.jopek.submittodatiinator; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.database.Cursor; +import android.net.Uri; +import android.provider.OpenableColumns; +import android.util.Log; + +import java.io.DataOutputStream; +import java.io.File; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Random; + +public class Requests { + public static final String TAG = "REQUESTS"; + + static final String uploadServerUri = "https://jopek.eu/maks/submitto-dati-inator/upload.php"; + private final static String lineEnd = "\r\n"; + private final static String twoHyphens = "--"; + + public static ReturnValues uploadFile(Context context, Uri sourceFileUri) { + final String boundary = "------------------------" + getRandomString(16); + int serverResponseCode = 0; + HttpURLConnection conn = null; + DataOutputStream dos = null; + int bytesRead, bytesAvailable, bufferSize; + byte[] buffer; + int maxBufferSize = 1 * 1024 * 1024; + String filename = getFileName(context, sourceFileUri); +// File sourceFile = new File(sourceFileUri); + +// if (!sourceFile.isFile()) { +// Log.e(TAG, "Source File not exist :" + sourceFileUri); +// return ReturnValues.NO_FILE; +// } else { + try { + // open a URL connection to the Servlet +// InputStream fileInputStream = new FileInputStream(sourceFile); + InputStream fileInputStream = context.getContentResolver().openInputStream(sourceFileUri); + + URL url = new URL(uploadServerUri); + + // Open a HTTP connection to the URL + conn = (HttpURLConnection) url.openConnection(); + conn.setDoInput(true); // Allow Inputs + conn.setDoOutput(true); // Allow Outputs + conn.setUseCaches(false); // Don't use a Cached Copy + conn.setChunkedStreamingMode(2048); + conn.setRequestMethod("POST"); + conn.setRequestProperty("Connection", "Keep-Alive"); + conn.setRequestProperty("ENCTYPE", "multipart/form-data"); + conn.setRequestProperty("Authorization", "Basic maks:"); + conn.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + boundary); + + dos = new DataOutputStream(conn.getOutputStream()); + + dos.writeBytes(twoHyphens + boundary + lineEnd); + dos.writeBytes("Content-Disposition: form-data; name=" + filename + ";filename=" + filename + "" + lineEnd); + dos.writeBytes(lineEnd); + + // create a buffer of maximum size + bytesAvailable = fileInputStream.available(); + + bufferSize = Math.min(bytesAvailable, maxBufferSize); + buffer = new byte[bufferSize]; + + // read file and write it into form... + bytesRead = fileInputStream.read(buffer, 0, bufferSize); + + while (bytesRead > 0) { + dos.write(buffer, 0, bufferSize); + bytesAvailable = fileInputStream.available(); + bufferSize = Math.min(bytesAvailable, maxBufferSize); + bytesRead = fileInputStream.read(buffer, 0, bufferSize); + } + + // send multipart form data necessary after file data... + dos.writeBytes(lineEnd); + dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd); + + // Responses from the server (code and message) + serverResponseCode = conn.getResponseCode(); + String serverResponseMessage = conn.getResponseMessage(); + + Log.i(TAG, "HTTP Response is : " + serverResponseMessage + ": " + serverResponseCode); + + //close the streams + fileInputStream.close(); + dos.flush(); + dos.close(); + if (serverResponseCode != 200) return ReturnValues.SERVER_ERROR; + } catch (MalformedURLException e) { + e.printStackTrace(); + Log.e(TAG, "error: " + e.getMessage(), e); + return ReturnValues.MALFORMED_URL; + } catch (Exception e) { + e.printStackTrace(); + Log.e(TAG, "Exception : " + e.getMessage(), e); + return ReturnValues.SERVER_ERROR; + } + return ReturnValues.OK; +// } + } + + public static String getRandomString(int length) { + int leftLimit = 48; // numeral '0' + int rightLimit = 122; // letter 'z' + Random random = new Random(); + + return random.ints(leftLimit, rightLimit + 1).filter(i -> (i <= 57 || i >= 65) && (i <= 90 || i >= 97)).limit(length).collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append).toString(); + } + + @SuppressLint("Range") + public static String getFileName(Context context, Uri uri) { + String result = null; + if (uri.getScheme().equals("content")) { + Cursor cursor = context.getContentResolver().query(uri, null, null, null, null); + try { + if (cursor != null && cursor.moveToFirst()) { + result = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)); + } + } finally { + cursor.close(); + } + } + if (result == null) { + result = uri.getPath(); + int cut = result.lastIndexOf('/'); + if (cut != -1) { + result = result.substring(cut + 1); + } + } + try { + return URLEncoder.encode(result, String.valueOf(StandardCharsets.UTF_8)); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return result; + } + + public enum ReturnValues { + OK, NO_FILE, MALFORMED_URL, SERVER_ERROR, + } +} diff --git a/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..6ad26c6 --- /dev/null +++ b/android/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/values-night/themes.xml b/android/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..f422564 --- /dev/null +++ b/android/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/android/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..174da19 --- /dev/null +++ b/android/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Submitto dati inator + \ No newline at end of file diff --git a/android/app/src/main/res/values/themes.xml b/android/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..a3ee826 --- /dev/null +++ b/android/app/src/main/res/values/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/android/app/src/main/res/xml/backup_rules.xml b/android/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/android/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/android/app/src/main/res/xml/data_extraction_rules.xml b/android/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/android/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/android/app/src/test/java/com/jopek/submittodatiinator/ExampleUnitTest.java b/android/app/src/test/java/com/jopek/submittodatiinator/ExampleUnitTest.java new file mode 100644 index 0000000..5be0321 --- /dev/null +++ b/android/app/src/test/java/com/jopek/submittodatiinator/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.jopek.submittodatiinator; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file -- cgit v1.3.1