├── .gitignore ├── ConvertCSV ├── .classpath ├── .project ├── .settings │ └── org.eclipse.core.resources.prefs ├── default.properties ├── proguard-project.txt ├── proguard.cfg ├── project.properties ├── readme.txt ├── release │ ├── ConvertCSV-1.2.0-rc2.apk │ └── ConvertCSV-source-1.2.0-rc2.zip ├── template of build-private.properties └── template of local.properties ├── ConvertCSVTest ├── .classpath ├── .project ├── AndroidManifest.xml ├── ant.properties ├── build.xml ├── libs │ ├── polidea_test_runner_1.2.jar │ ├── robotium-solo-3.2.1-javadoc.jar │ └── robotium-solo-3.2.1.jar ├── proguard-project.txt ├── project.properties └── readme.txt ├── app ├── build.gradle ├── proguard.cfg └── src │ ├── androidTest │ ├── assets │ │ └── handyshoppertest.txt │ ├── java │ │ └── org │ │ │ └── openintents │ │ │ └── convertcsv │ │ │ └── test │ │ │ └── TestConvertCSVActivity.java │ └── res │ │ ├── drawable-hdpi │ │ └── icon.png │ │ ├── drawable-ldpi │ │ └── icon.png │ │ ├── drawable-mdpi │ │ └── icon.png │ │ ├── layout │ │ └── main.xml │ │ └── values │ │ └── strings.xml │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── org │ │ └── openintents │ │ ├── convertcsv │ │ ├── InfoActivity.java │ │ ├── PreferenceActivity.java │ │ ├── blockstack │ │ │ ├── AccountActivity.kt │ │ │ ├── ConvertCSVProvider.kt │ │ │ └── DefaultConfig.kt │ │ ├── common │ │ │ ├── ConvertCsvBaseActivity.java │ │ │ ├── EncodingAdapter.java │ │ │ └── WrongFormatException.java │ │ ├── notepad │ │ │ ├── ConvertCsvActivity.java │ │ │ ├── ExportCsv.java │ │ │ ├── ImportCsv.java │ │ │ └── NotepadUtils.java │ │ ├── opencsv │ │ │ ├── CSVReader.java │ │ │ └── CSVWriter.java │ │ └── shoppinglist │ │ │ ├── ConvertCsvActivity.java │ │ │ ├── ExportCsv.java │ │ │ └── ImportCsv.java │ │ ├── intents │ │ └── FileManagerIntents.java │ │ └── provider │ │ └── NotePad.java │ └── res │ ├── drawable-hdpi-v9 │ └── ic_menu_convert_csv.png │ ├── drawable-ldpi-v9 │ └── ic_menu_convert_csv.png │ ├── drawable-mdpi-v9 │ └── ic_menu_convert_csv.png │ ├── drawable-xhdpi-v9 │ └── ic_menu_convert_csv.png │ ├── drawable │ ├── ic_launcher_folder_new_small.png │ ├── ic_launcher_folder_small.png │ └── ic_menu_convert_csv.png │ ├── layout │ ├── activity_account.xml │ ├── content_account.xml │ ├── convert.xml │ ├── convertprogress.xml │ └── file_exists.xml │ ├── raw │ └── recent_changes.txt │ ├── values-ar │ └── strings.xml │ ├── values-be │ └── strings.xml │ ├── values-bg │ └── strings.xml │ ├── values-ca │ └── strings.xml │ ├── values-cs │ └── strings.xml │ ├── values-de │ └── strings.xml │ ├── values-el │ └── strings.xml │ ├── values-en-rGB │ └── strings.xml │ ├── values-es │ └── strings.xml │ ├── values-fa │ └── strings.xml │ ├── values-fi │ └── strings.xml │ ├── values-fr │ └── strings.xml │ ├── values-hi │ └── strings.xml │ ├── values-hr │ └── strings.xml │ ├── values-iw │ └── strings.xml │ ├── values-ja │ └── strings.xml │ ├── values-ko │ └── strings.xml │ ├── values-nb │ └── strings.xml │ ├── values-nl │ └── strings.xml │ ├── values-oc │ └── strings.xml │ ├── values-pl │ └── strings.xml │ ├── values-pt │ └── strings.xml │ ├── values-ro │ └── strings.xml │ ├── values-ru │ └── strings.xml │ ├── values-sd │ └── strings.xml │ ├── values-sk │ └── strings.xml │ ├── values-sv │ └── strings.xml │ ├── values-tl │ └── strings.xml │ ├── values-tr │ └── strings.xml │ ├── values-ug │ └── strings.xml │ ├── values-uk │ └── strings.xml │ ├── values-zh-rCN │ └── strings.xml │ ├── values │ ├── arrays.xml │ ├── strings.xml │ └── strings_not_for_translation.xml │ └── xml │ ├── about.xml │ └── preferences.xml ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── promotion ├── icons │ ├── ic_launcher_convertcsv_512.png │ ├── ic_menu_convert_csv.png │ └── ic_menu_convert_csv.svg └── screenshots │ ├── android-2-3 │ ├── convertcsv-1-1-0-a.png │ ├── convertcsv-1-1-0-b.png │ ├── convertcsv-1-1-0-c.png │ └── convertcsv-1-1-0-d.png │ └── android-4-0 │ ├── OIConvertCSV01.png │ ├── OIConvertCSV02.png │ ├── OIConvertCSV03.png │ ├── OIConvertCSV04.png │ ├── OIConvertCSV05.png │ ├── OIConvertCSV06.png │ ├── OIConvertCSV07.png │ ├── OIConvertCSV08.png │ ├── OIConvertCSV09.png │ ├── OIConvertCSV10.png │ ├── OIConvertCSV11.png │ ├── OIConvertCSV12.png │ ├── OIConvertCSV13.png │ ├── OIConvertCSV14.png │ ├── OIConvertCSV15.png │ ├── OIConvertCSV16.png │ └── readme.txt ├── pwa ├── _headers ├── _redirects ├── android-chrome-512x512.png ├── favicon.ico ├── images │ ├── 01_notes.png │ ├── 02_convert.png │ ├── 03_saf.png │ ├── blockstack.svg │ ├── github.svg │ ├── linkedin.svg │ ├── play.png │ └── twitter.svg ├── index.html ├── manifest.json └── styles.css ├── settings.gradle └── test └── originalcsv ├── handyshopper ├── groc1.csv └── groc1.txt ├── jpilot └── jpilotexport.csv └── outlook └── SampleOutlook1.CSV /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | gen 3 | build-private.properties 4 | local.properties 5 | release 6 | build 7 | .gradle 8 | .idea 9 | *.iml 10 | *~ 11 | -------------------------------------------------------------------------------- /ConvertCSV/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ConvertCSV/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | OI Convert CSV 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /ConvertCSV/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | #Fri Jun 01 12:21:56 CEST 2012 2 | eclipse.preferences.version=1 3 | encoding/readme.txt=UTF-8 4 | -------------------------------------------------------------------------------- /ConvertCSV/default.properties: -------------------------------------------------------------------------------- 1 | android.library.reference.1=../../distribution/DistributionLibrary 2 | android.library.reference.2=../../shoppinglist/ShoppingListLibrary 3 | # Project target. 4 | target=android-14 5 | -------------------------------------------------------------------------------- /ConvertCSV/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /ConvertCSV/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /ConvertCSV/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | android.library.reference.1=../../distribution/DistributionLibrary 11 | android.library.reference.2=../../shoppinglist/ShoppingListLibrary 12 | # Project target. 13 | target=android-15 14 | -------------------------------------------------------------------------------- /ConvertCSV/readme.txt: -------------------------------------------------------------------------------- 1 | **************************************************************************** 2 | * Copyright (C) 2008-2011 OpenIntents.org * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); * 5 | * you may not use this file except in compliance with the License. * 6 | * You may obtain a copy of the License at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * Unless required by applicable law or agreed to in writing, software * 11 | * distributed under the License is distributed on an "AS IS" BASIS, * 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | * See the License for the specific language governing permissions and * 14 | * limitations under the License. * 15 | **************************************************************************** 16 | 17 | The OpenIntents ConvertCSV is an extension for OI shopping list 18 | that lets you import and export the lists to CSV files. 19 | 20 | To obtain the current release, visit 21 | http://www.openintents.org 22 | 23 | 24 | ---------------- 25 | release: 1.3 26 | date: ? 27 | 28 | - Fix title bug for encrypted notes (Issue 301, patch by chaitanya) 29 | 30 | ---------------- 31 | release: 1.2.0 32 | date: 2012-06-05 33 | 34 | - Add support for JPilot import and export (Issue 252 Google Code-In task by Michał Zieliński). 35 | - Improve HandyShopper store prices import (performance, rounding) 36 | - Better support for Hebrew 37 | - Support for file path with spaces 38 | 39 | ---------------- 40 | release: 1.1.0 41 | date: 2011-05-28 42 | 43 | NOTE: Use the new HandyShopper format to export tags, price, and quantity from OI Shopping List. Export each list separately in this format. 44 | 45 | - support moving app to SD card. 46 | - Add progress bar during conversion. 47 | - Shopping list export with tags. 48 | - Add support for HandyShopper import and export (including patch by Aaron Peromsik). 49 | - Choose custom encoding. 50 | - support Android 2.3. 51 | 52 | ---------------- 53 | release: 1.0.1 54 | date: 2009-01-19 55 | 56 | - Fix line feed problem with Palm CSV Windows files. 57 | - Add support for new fields in NotePad 1.1.0. 58 | - Prepare for OI Notepad and OI Shopping list permissions. 59 | 60 | ---------------- 61 | release: 1.0.0 62 | date: 2008-12-09 63 | 64 | - First public release on Android SDK 1.0. 65 | 66 | Features: 67 | - Import / export all shopping lists to CSV file 68 | compatible with MS Outlook. 69 | - Import / export all notepad notes to CSV file 70 | compatible with Palm CSV format. 71 | - Open OI File Manager to select file location. 72 | 73 | 74 | -------------------------------------------------------------------------------- /ConvertCSV/release/ConvertCSV-1.2.0-rc2.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/ConvertCSV/release/ConvertCSV-1.2.0-rc2.apk -------------------------------------------------------------------------------- /ConvertCSV/release/ConvertCSV-source-1.2.0-rc2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/ConvertCSV/release/ConvertCSV-source-1.2.0-rc2.zip -------------------------------------------------------------------------------- /ConvertCSV/template of build-private.properties: -------------------------------------------------------------------------------- 1 | key.store=C:\\certificates\\ConvertCSV.ks 2 | key.alias=ConvertCSV 3 | key.store.password=xxx 4 | key.alias.password=xxx 5 | 6 | # Tells adb which device to target for installation. 7 | # Target device: 8 | #adb.device.arg=-d 9 | # Target emulator: 10 | #adb.device.arg=-e -------------------------------------------------------------------------------- /ConvertCSV/template of local.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must *NOT* be checked in Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | 7 | # location of the SDK. This is only used by Ant 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | sdk.dir=C:\\android\\android-sdk-windows 11 | -------------------------------------------------------------------------------- /ConvertCSVTest/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ConvertCSVTest/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | OI Convert CSV Test 4 | 5 | 6 | OI File Manager 7 | 8 | 9 | 10 | com.android.ide.eclipse.adt.ResourceManagerBuilder 11 | 12 | 13 | 14 | 15 | com.android.ide.eclipse.adt.PreCompilerBuilder 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javabuilder 21 | 22 | 23 | 24 | 25 | com.android.ide.eclipse.adt.ApkBuilder 26 | 27 | 28 | 29 | 30 | 31 | com.android.ide.eclipse.adt.AndroidNature 32 | org.eclipse.jdt.core.javanature 33 | 34 | 35 | -------------------------------------------------------------------------------- /ConvertCSVTest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /ConvertCSVTest/ant.properties: -------------------------------------------------------------------------------- 1 | # This file is used to override default values used by the Ant build system. 2 | # 3 | # This file must be checked in Version Control Systems, as it is 4 | # integral to the build system of your project. 5 | 6 | # This file is only used by the Ant script. 7 | 8 | # You can use this to override default values such as 9 | # 'source.dir' for the location of your java source folder and 10 | # 'out.dir' for the location of your output folder. 11 | 12 | # You can also use it define how the release builds are signed by declaring 13 | # the following properties: 14 | # 'key.store' for the location of your keystore and 15 | # 'key.alias' for the name of the key to use. 16 | # The password will be asked during the build when you use the 'release' target. 17 | 18 | tested.project.dir=../ConvertCSV 19 | -------------------------------------------------------------------------------- /ConvertCSVTest/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ConvertCSVTest/libs/polidea_test_runner_1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/ConvertCSVTest/libs/polidea_test_runner_1.2.jar -------------------------------------------------------------------------------- /ConvertCSVTest/libs/robotium-solo-3.2.1-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/ConvertCSVTest/libs/robotium-solo-3.2.1-javadoc.jar -------------------------------------------------------------------------------- /ConvertCSVTest/libs/robotium-solo-3.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/ConvertCSVTest/libs/robotium-solo-3.2.1.jar -------------------------------------------------------------------------------- /ConvertCSVTest/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /ConvertCSVTest/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Indicates whether an apk should be generated for each density. 11 | split.density=false 12 | # Project target. 13 | target=android-15 14 | -------------------------------------------------------------------------------- /ConvertCSVTest/readme.txt: -------------------------------------------------------------------------------- 1 |  **************************************************************************** 2 | * Copyright (C) 2008-2012 OpenIntents.org * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); * 5 | * you may not use this file except in compliance with the License. * 6 | * You may obtain a copy of the License at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * Unless required by applicable law or agreed to in writing, software * 11 | * distributed under the License is distributed on an "AS IS" BASIS, * 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | * See the License for the specific language governing permissions and * 14 | * limitations under the License. * 15 | **************************************************************************** 16 | 17 | OI Convert CSV Test 18 | 19 | To obtain the current release, visit 20 | http://www.openintents.org 21 | 22 | --------------------------------------------------------- 23 | release: 1.0 24 | date: ? 25 | 26 | - Initial version: Google Code-In task by Michał Zieliński. 27 | 28 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | 5 | dependencies { 6 | implementation project(':ShoppingListLibrary') 7 | implementation fileTree(dir: 'libs', include: '*.jar') 8 | implementation 'org.openintents:distribution-lib:1.0.2' 9 | //noinspection GradleDependency 10 | implementation 'com.github.blockstack:blockstack-android:f86c5c844e' 11 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" 12 | implementation 'com.android.support:appcompat-v7:28.0.0' 13 | implementation 'com.android.support:customtabs:28.0.0' 14 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 15 | implementation 'com.android.support:design:28.0.0' 16 | } 17 | 18 | android { 19 | compileSdkVersion rootProject.ext.compileSdkVersion 20 | buildToolsVersion rootProject.ext.buildToolsVersion 21 | 22 | defaultConfig { 23 | applicationId 'org.openintents.convertcsv' 24 | versionCode 15 25 | versionName '2.0.0-beta3' 26 | minSdkVersion 19 27 | targetSdkVersion rootProject.ext.targetSdkVersion 28 | } 29 | 30 | buildTypes { 31 | release { 32 | minifyEnabled false 33 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 34 | } 35 | } 36 | 37 | applicationVariants.all { variant -> 38 | variant.outputs.each { output -> 39 | def outputFile = output.outputFile 40 | if (outputFile != null && outputFile.name.endsWith('.apk')) { 41 | def fileName = outputFile.name.replace('.apk', "-${versionName}.apk") 42 | output.outputFileName = new File(fileName) 43 | } 44 | } 45 | } 46 | 47 | def propertyFile = new File(projectDir, "build-private.properties") 48 | compileOptions { 49 | sourceCompatibility = '1.8' 50 | targetCompatibility = '1.8' 51 | } 52 | if (propertyFile.exists()) { 53 | signingConfigs { 54 | release { 55 | Properties props = new Properties() 56 | props.load(new FileInputStream(propertyFile)) 57 | 58 | storeFile file(props.getProperty("key.store")) 59 | storePassword props.getProperty("key.store.password") 60 | keyAlias props.getProperty("key.alias") 61 | keyPassword props.getProperty("key.alias.password") 62 | } 63 | } 64 | buildTypes.release.signingConfig signingConfigs.release 65 | println "Release apks will be signed!" 66 | } else { 67 | println "For signed release apks you need to create a build-private.properties file" 68 | } 69 | 70 | } -------------------------------------------------------------------------------- /app/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /app/src/androidTest/assets/handyshoppertest.txt: -------------------------------------------------------------------------------- 1 | Need,Priority,Description,CustomText,Quantity,Units,Price,Aisle,Date,Category,Stores,PerStoreInfo,EntryOrder,Coupon,Tax,Tax2,AutoDelete,Private,Note,Alarm,AlarmMidi,Icon,AutoOrder 2 | have,3,Buns hot dog,,,,,,2005/04/03,Groceries,Big Y;Price Chopper;Stop & Shop;Shaw's;Wal-Mart,Stop & Shop=/2.19;Shaw's=/2.09;Wal-Mart=/1.25,91,,,,,,,,0,0, 3 | have,1,Burritos,,,,,,2005/09/20,Unfiled,Stop & Shop;Shaw's,Stop & Shop=/1.79;Shaw's=/1.99,389,,,,,,,,0,0, 4 | have,2,Butterscotch chips,,1,,,,2006/01/24,Groceries,Price Chopper,Price Chopper=/1.69,250,,,,,,,,0,0, 5 | have,1,Can opener,,,,,,2006/03/19,Unfiled,Wal-Mart,Wal-Mart=/7.00,477,,,,,,,,0,0, 6 | have,1,Cereal Kashi,,,,,,2005/11/10,Groceries,Stop & Shop;Wal-Mart,Stop & Shop=/3.49;Wal-Mart=/2.77,324,,,,,,,,0,0, 7 | have,1,Cereal Life,,,,,,2006/01/01,Groceries,Big Y;Price Chopper;Stop & Shop;Shaw's;Wal-Mart,Big Y=/3.49;Stop & Shop=5/3.29;Wal-Mart=/2.77,43,,,,,,,,0,0, 8 | have,1,Corn frozen,,2,,,,2006/03/22,Groceries,Big Y;Price Chopper;Stop & Shop;Shaw's;Sam's Club,Big Y=/2.49;Stop & Shop=/2.49,44,,,,,,,,0,0, 9 | have,1,Corn meal,,,,,,2005/11/23,Unfiled,Shaw's;Wal-Mart,Shaw's=/1.69;Wal-Mart=/1.27,417,,,,,,,,0,0, 10 | have,1,Corn pops,,,,,,2003/09/11,Groceries,Price Chopper,,27,,,,,,,,0,0, 11 | x,3,Corn syrup,,1,,,,2004/04/29,Groceries,Big Y;Price Chopper;Stop & Shop;Shaw's,Stop & Shop=/2.49;Shaw's=/1.99,155,,,,,,,,0,0, 12 | have,1,Cornstarch,,,,,,2003/10/22,Groceries,Stop & Shop,Stop & Shop=/1.29,248,,,,,,,,0,0, 13 | x,1,Tissues,,6,,,,2005/12/12,Groceries,Big Y;BJ's;Price Chopper;Stop & Shop;Shaw's;Target;Wal-Mart,Big Y=/1.99;BJ's=/1.47;Stop & Shop=22/1.69;Target=/1.59;Wal-Mart=/1.48,42,,,,,,,,0,0, 14 | have,1,Tofu,,2,,,,2006/03/07,Groceries,Big Y;Price Chopper;Stop & Shop;Shaw's;Trader Joe's,Big Y=/2.29;Price Chopper=/2.49;Shaw's=/1.99,79,,,,,,,,0,0, 15 | have,1,Zip bags gal,,2,100,,,2006/02/06,Non-food,Big Y;BJ's;Price Chopper;Stop & Shop;Shaw's;Sam's Club,BJ's=/4.34;Price Chopper=/,64,,,,,,,,0,0, 16 | have,1,Zip bags qt,,,,,,2006/01/30,Non-food,Big Y;Price Chopper;Shaw's;Stop & Shop,,77,,,,,,,,0,0, 17 | have,1,Zip bags sandwich,,5,100,,,2006/02/06,Non-food,Big Y;BJ's;Price Chopper;Stop & Shop;Shaw's,BJ's=/1.37;Stop & Shop=/2.58,144,,,,,,,,0,0, -------------------------------------------------------------------------------- /app/src/androidTest/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/app/src/androidTest/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /app/src/androidTest/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/app/src/androidTest/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /app/src/androidTest/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/app/src/androidTest/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /app/src/androidTest/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/androidTest/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World! 4 | TestNoteList 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 19 | 20 | 23 | 24 | 25 | 30 | 31 | 34 | 35 | 38 | 39 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 67 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 123 | 124 | 125 | 126 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/convertcsv/InfoActivity.java: -------------------------------------------------------------------------------- 1 | package org.openintents.convertcsv; 2 | 3 | import android.content.Intent; 4 | 5 | 6 | public class InfoActivity extends org.openintents.distribution.InfoActivity { 7 | 8 | @Override 9 | public void init() { 10 | 11 | mApplications = new int[] { 12 | R.string.info_app_shopping, // OI Shopping List 13 | R.string.info_app_notepad, // OI Notepad 14 | }; 15 | 16 | mPackageNames = new String[] { 17 | "org.openintents.shopping", // OI Shopping List 18 | "org.openintents.notepad", // OI Notepad 19 | }; 20 | 21 | mMinVersionCodes = new int[] { 22 | 10004, // OI Shopping List 23 | 10052, // OI Notepad 24 | }; 25 | 26 | mMinVersionName = new String[] { 27 | "1.0.3", // OI Shopping List 28 | "1.1.0", // OI Notepad 29 | }; 30 | 31 | mInfoText = new int[] { 32 | R.string.info_instructions, // OI Shopping List 33 | R.string.info_instructions, // OI Notepad 34 | }; 35 | 36 | mDeveloperUris = new String[] { 37 | "http://www.openintents.org/en/shoppinglist", // OI Shopping List 38 | "http://www.openintents.org/en/notepad", // OI Notepad 39 | }; 40 | 41 | mIntentAction = new String[] { 42 | Intent.ACTION_VIEW, // OI Shopping List 43 | Intent.ACTION_VIEW, // OI Notepad 44 | }; 45 | 46 | mIntentData = new String[] { 47 | "content://org.openintents.shopping/items", // OI Shopping List 48 | "content://org.openintents.notepad/notes", // OI Notepad 49 | }; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/convertcsv/PreferenceActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 OpenIntents.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.openintents.convertcsv; 18 | 19 | import android.os.Bundle; 20 | 21 | public class PreferenceActivity extends android.preference.PreferenceActivity { 22 | public static final String PREFS_NOTEPAD_FILENAME = "notepad_filename"; 23 | public static final String PREFS_NOTEPAD_FORMAT = "notepad_format"; 24 | public static final String PREFS_NOTEPAD_ENCODING = "notepad_encoding"; 25 | public static final String PREFS_NOTEPAD_USE_CUSTOM_ENCODING = "notepad_encoding"; 26 | public static final String PREFS_SHOPPINGLIST_ENCODING = "shopping_encoding"; 27 | public static final String PREFS_SHOPPINGLIST_USE_CUSTOM_ENCODING = "shoppinglist_use_custom_encoding"; 28 | public static final String PREFS_SHOPPINGLIST_FILENAME = "shoppinglist_filename"; 29 | public static final String PREFS_SHOPPINGLIST_FORMAT = "shoppinglist_format"; 30 | public static final String PREFS_ASK_IF_FILE_EXISTS = "ask_if_file_exists"; 31 | 32 | @Override 33 | protected void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | // Load the preferences from an XML resource 36 | addPreferencesFromResource(R.xml.preferences); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/convertcsv/blockstack/AccountActivity.kt: -------------------------------------------------------------------------------- 1 | package org.openintents.convertcsv.blockstack 2 | 3 | 4 | import android.content.Context 5 | import android.content.Intent 6 | import android.os.Bundle 7 | import android.provider.DocumentsContract 8 | import android.support.v4.app.NavUtils 9 | import android.support.v7.app.AppCompatActivity 10 | import android.util.Log 11 | import android.view.MenuItem 12 | import android.view.View 13 | import android.widget.Toast 14 | import kotlinx.android.synthetic.main.activity_account.* 15 | import kotlinx.android.synthetic.main.content_account.* 16 | import kotlinx.coroutines.experimental.* 17 | import kotlinx.coroutines.experimental.android.UI 18 | import org.blockstack.android.sdk.BlockstackSession 19 | import org.blockstack.android.sdk.Executor 20 | import org.jetbrains.anko.coroutines.experimental.Ref 21 | import org.jetbrains.anko.coroutines.experimental.asReference 22 | import org.openintents.convertcsv.R 23 | 24 | 25 | class AccountActivity : AppCompatActivity() { 26 | private val TAG = AccountActivity::class.java.simpleName 27 | 28 | private var _blockstackSession: BlockstackSession? = null 29 | 30 | override fun onCreate(savedInstanceState: Bundle?) { 31 | super.onCreate(savedInstanceState) 32 | setContentView(R.layout.activity_account) 33 | setSupportActionBar(toolbar) 34 | supportActionBar!!.setDisplayHomeAsUpEnabled(true) 35 | 36 | setLoadingUI(true) 37 | 38 | val ref: Ref = this.asReference() 39 | 40 | launch(UI) { 41 | async(v8Context) { 42 | _blockstackSession = BlockstackSession(ref(), defaultConfig, executor = object : Executor { 43 | override fun onMainThread(function: (Context) -> Unit) { 44 | runOnUiThread { 45 | function(this@AccountActivity) 46 | } 47 | } 48 | 49 | override fun onNetworkThread(function: suspend () -> Unit) { 50 | try { 51 | async(CommonPool) { 52 | function() 53 | } 54 | } catch (e: Exception) { 55 | Log.d(TAG, "error in network thread", e) 56 | } 57 | } 58 | 59 | override fun onV8Thread(function: () -> Unit) { 60 | runOnV8Thread { 61 | function() 62 | } 63 | } 64 | 65 | }, sessionStore = getSessionStore(this@AccountActivity)) 66 | if (intent?.action == Intent.ACTION_VIEW) { 67 | handleAuthResponse(intent) 68 | } 69 | }.await() 70 | onLoaded() 71 | } 72 | 73 | signInButton.setOnClickListener { _ -> 74 | launch(UI) { 75 | runOnV8Thread { 76 | blockstackSession().signUserOut() 77 | blockstackSession().redirectUserToSignIn { _ -> 78 | Log.d(TAG, "signed in redirect") 79 | } 80 | } 81 | } 82 | } 83 | 84 | signOutButton.setOnClickListener { _ -> 85 | launch(UI) { 86 | runOnV8Thread { 87 | blockstackSession().signUserOut() 88 | }.await() 89 | notifyDocumentUI() 90 | Log.d(TAG, "signed out!") 91 | finish() 92 | } 93 | } 94 | } 95 | 96 | private fun onLoaded() { 97 | launch(UI) { 98 | val signedIn = runOnV8Thread { 99 | blockstackSession().isUserSignedIn() 100 | }.await() 101 | setLoadingUI(false) 102 | 103 | if (signedIn) { 104 | signInButton.visibility = View.GONE 105 | signOutButton.visibility = View.VISIBLE 106 | } else { 107 | signInButton.visibility = View.VISIBLE 108 | signOutButton.visibility = View.GONE 109 | } 110 | notifyDocumentUI() 111 | } 112 | } 113 | 114 | private fun onSignIn() { 115 | launch(UI) { 116 | runOnV8Thread { 117 | blockstackSession().loadUserData() 118 | }.await() 119 | notifyDocumentUI() 120 | finish() 121 | } 122 | } 123 | 124 | private fun notifyDocumentUI() { 125 | val rootsUri = DocumentsContract.buildRootsUri("org.openintents.convertcsv.documents") 126 | this@AccountActivity.getContentResolver().notifyChange(rootsUri, null) 127 | } 128 | 129 | override fun onNewIntent(intent: Intent?) { 130 | super.onNewIntent(intent) 131 | Log.d(TAG, "onNewIntent") 132 | 133 | if (intent?.action == Intent.ACTION_VIEW) { 134 | handleAuthResponse(intent) 135 | } 136 | 137 | } 138 | 139 | private fun handleAuthResponse(intent: Intent?) { 140 | val authResponse = intent?.data?.getQueryParameter("authResponse") 141 | if (authResponse != null) { 142 | Log.d(TAG, "authResponse: ${authResponse}") 143 | setLoadingUI(true) 144 | runOnV8Thread { 145 | try { 146 | Log.d(TAG, "before signed in!") 147 | blockstackSession().handlePendingSignIn(authResponse, { 148 | Log.d(TAG, "signed in result " + it.error + " " + it.value) 149 | if (it.hasErrors) { 150 | Toast.makeText(this@AccountActivity, it.error, Toast.LENGTH_SHORT).show() 151 | } else { 152 | Log.d(TAG, "signed in!") 153 | runOnUiThread { 154 | onSignIn() 155 | } 156 | } 157 | }) 158 | } catch (e: Exception) { 159 | Log.d(TAG, "signed in error", e) 160 | } 161 | } 162 | } 163 | } 164 | 165 | private fun setLoadingUI(loading: Boolean) { 166 | if (loading) { 167 | signInButton.isEnabled = false 168 | signOutButton.isEnabled = false 169 | accountDescription.visibility = View.VISIBLE 170 | } else { 171 | signInButton.isEnabled = true 172 | signOutButton.isEnabled = true 173 | accountDescription.visibility = View.INVISIBLE 174 | } 175 | } 176 | 177 | override fun onOptionsItemSelected(item: MenuItem?): Boolean { 178 | if (item!!.itemId == android.R.id.home) { 179 | NavUtils.navigateUpFromSameTask(this) 180 | return true 181 | } 182 | return super.onOptionsItemSelected(item) 183 | } 184 | 185 | fun runOnV8Thread(runnable: () -> T): Deferred { 186 | return async(v8Context) { 187 | runnable() 188 | } 189 | 190 | } 191 | 192 | fun blockstackSession(): BlockstackSession { 193 | val session = _blockstackSession 194 | if (session != null) { 195 | return session 196 | } else { 197 | Log.d(TAG, "too early") 198 | throw IllegalStateException("No session.") 199 | } 200 | } 201 | } 202 | 203 | val v8Context = newFixedThreadPoolContext(1, "v8Thread") 204 | 205 | 206 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/convertcsv/blockstack/DefaultConfig.kt: -------------------------------------------------------------------------------- 1 | package org.openintents.convertcsv.blockstack 2 | 3 | import android.content.Context 4 | import android.content.SharedPreferences 5 | import android.preference.PreferenceManager 6 | import org.blockstack.android.sdk.Scope 7 | import org.blockstack.android.sdk.SessionStore 8 | import org.blockstack.android.sdk.toBlockstackConfig 9 | 10 | val defaultConfig = "https://convertcsv.openintents.org".toBlockstackConfig( 11 | kotlin.arrayOf(Scope.StoreWrite)) 12 | 13 | private var sessionStore: SessionStore? = null 14 | fun getSessionStore(context:Context):SessionStore { 15 | if (sessionStore == null) { 16 | sessionStore = SessionStore(PreferenceManager.getDefaultSharedPreferences(context)) 17 | } 18 | return sessionStore!! 19 | } 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/convertcsv/common/EncodingAdapter.java: -------------------------------------------------------------------------------- 1 | package org.openintents.convertcsv.common; 2 | 3 | import android.content.Context; 4 | import android.util.Xml.Encoding; 5 | import android.widget.ArrayAdapter; 6 | 7 | public class EncodingAdapter extends ArrayAdapter{ 8 | 9 | public EncodingAdapter(Context context, int textViewResourceId) { 10 | super(context, textViewResourceId, Encoding.values()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/convertcsv/common/WrongFormatException.java: -------------------------------------------------------------------------------- 1 | package org.openintents.convertcsv.common; 2 | 3 | public class WrongFormatException extends Exception { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/convertcsv/notepad/ConvertCsvActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 OpenIntents.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.openintents.convertcsv.notepad; 18 | 19 | import android.os.Bundle; 20 | 21 | import org.openintents.convertcsv.PreferenceActivity; 22 | import org.openintents.convertcsv.R; 23 | import org.openintents.convertcsv.common.ConvertCsvBaseActivity; 24 | import org.openintents.convertcsv.common.WrongFormatException; 25 | 26 | import java.io.IOException; 27 | import java.io.Reader; 28 | import java.io.Writer; 29 | 30 | public class ConvertCsvActivity extends ConvertCsvBaseActivity { 31 | 32 | public static final String TAG = "ConvertCsvActivity"; 33 | 34 | public void setPreferencesUsed() { 35 | PREFERENCE_FILENAME = PreferenceActivity.PREFS_NOTEPAD_FILENAME; 36 | DEFAULT_FILENAME = getString(R.string.default_notepad_filename); 37 | PREFERENCE_FORMAT = PreferenceActivity.PREFS_NOTEPAD_FORMAT; 38 | DEFAULT_FORMAT = ImportCsv.FORMAT_PALM_CSV; 39 | PREFERENCE_ENCODING = PreferenceActivity.PREFS_NOTEPAD_ENCODING; 40 | PREFERENCE_USE_CUSTOM_ENCODING = PreferenceActivity.PREFS_NOTEPAD_USE_CUSTOM_ENCODING; 41 | RES_STRING_FILEMANAGER_TITLE = R.string.filemanager_title_notepad; 42 | RES_ARRAY_CSV_FILE_FORMAT = R.array.notepad_format; 43 | RES_ARRAY_CSV_FILE_FORMAT_VALUE = R.array.notepad_format_value; 44 | } 45 | 46 | /** 47 | * Called when the activity is first created. 48 | */ 49 | @Override 50 | public void onCreate(Bundle savedInstanceState) { 51 | super.onCreate(savedInstanceState); 52 | 53 | if (mConvertInfo != null) { 54 | mConvertInfo.setText(R.string.convert_all_notes); 55 | } 56 | } 57 | 58 | @Override 59 | public String getImportPolicyPrefString() { 60 | return "notepad_import_policy"; 61 | } 62 | 63 | /** 64 | * @param reader 65 | * @throws IOException 66 | */ 67 | public void doImport(Reader reader) throws IOException, 68 | WrongFormatException { 69 | ImportCsv ic = new ImportCsv(this); 70 | ic.importCsv(reader, getFormat(), getValidatedImportPolicy()); 71 | } 72 | 73 | /** 74 | * @param writer 75 | * @throws IOException 76 | */ 77 | public void doExport(Writer writer) throws IOException { 78 | ExportCsv ec = new ExportCsv(this); 79 | ec.exportCsv(writer, getFormat()); 80 | } 81 | 82 | 83 | @Override 84 | protected String getWritePermission() { 85 | return "org.openintents.notepad.WRITE_PERMISSION"; 86 | } 87 | 88 | 89 | } -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/convertcsv/notepad/ExportCsv.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 OpenIntents.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.openintents.convertcsv.notepad; 18 | 19 | import java.io.IOException; 20 | import java.io.Writer; 21 | 22 | import org.openintents.convertcsv.common.ConvertCsvBaseActivity; 23 | import org.openintents.convertcsv.opencsv.CSVWriter; 24 | import org.openintents.provider.NotePad; 25 | 26 | import android.content.Context; 27 | import android.database.Cursor; 28 | 29 | public class ExportCsv { 30 | 31 | Context mContext; 32 | 33 | public ExportCsv(Context context) { 34 | mContext = context; 35 | } 36 | 37 | /** 38 | * @param dos 39 | * @throws IOException 40 | */ 41 | public void exportCsv(Writer writer, String format) throws IOException { 42 | 43 | //boolean isPalm = format.equals(FORMAT_PALM_CSV); // Palm is default. 44 | boolean isOutlookNotes = format.equals(ImportCsv.FORMAT_OUTLOOK_NOTES); 45 | boolean isJPilotMemo = format.equals(ImportCsv.FORMAT_JPILOT_MEMO); 46 | 47 | CSVWriter csvwriter = new CSVWriter(writer); 48 | 49 | //csvwriter.setLineEnd("\r\n"); 50 | 51 | //String lineEnd = "\r\r\n"; 52 | //csvwriter.setLineEnd(lineEnd); 53 | 54 | if (isOutlookNotes) { 55 | csvwriter.writeValue("Note Body"); 56 | csvwriter.writeValue("Categories"); 57 | csvwriter.writeValue("Note Color"); 58 | csvwriter.writeValue("Priority"); 59 | csvwriter.writeValue("Sensitivity"); 60 | csvwriter.writeNewline(); 61 | } else if(isJPilotMemo) { 62 | csvwriter.writeValue("CSV memo version 1.6.2.4: Category"); 63 | csvwriter.writeValue(" Private"); 64 | csvwriter.writeValue(" Memo Text"); 65 | csvwriter.writeNewline(); 66 | } else { 67 | // No header line for Palm 68 | /* 69 | csvwriter.write("Note"); 70 | csvwriter.write("Encrypted"); 71 | csvwriter.write("Category"); 72 | csvwriter.writeNewline(); 73 | */ 74 | } 75 | 76 | Cursor c = mContext.getContentResolver().query(NotePad.Notes.CONTENT_URI, null, null, null, 77 | NotePad.Notes.DEFAULT_SORT_ORDER); 78 | 79 | if (c != null) { 80 | int COLUMN_INDEX_NOTE = c.getColumnIndexOrThrow(NotePad.Notes.NOTE); 81 | int COLUMN_INDEX_ID = c.getColumnIndexOrThrow(NotePad.Notes._ID); 82 | int COLUMN_INDEX_ENCRYPTED = c.getColumnIndex(NotePad.Notes.ENCRYPTED); // Introduced in 1.1.0 83 | int COLUMN_INDEX_TAGS = c.getColumnIndex(NotePad.Notes.TAGS); // Introduced in 1.1.0 84 | 85 | ConvertCsvBaseActivity.dispatchSetMaxProgress(c.getCount()); 86 | int progress = 0; 87 | 88 | while (c.moveToNext()) { 89 | ConvertCsvBaseActivity.dispatchConversionProgress(progress++); 90 | 91 | String note = c.getString(COLUMN_INDEX_NOTE); 92 | long id = c.getLong(COLUMN_INDEX_ID); 93 | 94 | String encrypted = "0"; // Not encrypted 95 | 96 | String category = ""; 97 | 98 | if (COLUMN_INDEX_ENCRYPTED > -1) { 99 | encrypted = "" + c.getLong(COLUMN_INDEX_ENCRYPTED); 100 | } 101 | 102 | if (COLUMN_INDEX_TAGS > -1) { 103 | category = c.getString(COLUMN_INDEX_TAGS); 104 | if (category == null) { 105 | category = ""; 106 | } 107 | } 108 | 109 | if (isOutlookNotes) { 110 | String notecolor = "3"; 111 | String priority = "Normal"; 112 | String sensitivity = "Normal"; 113 | if (!encrypted.equals("0")) { 114 | sensitivity = "Encrypted " + encrypted; 115 | } 116 | csvwriter.write(note); 117 | csvwriter.writeValue(category); 118 | csvwriter.writeValue(notecolor); 119 | csvwriter.writeValue(priority); 120 | csvwriter.writeValue(sensitivity); 121 | } else if(isJPilotMemo) { 122 | String notePrivate = "0"; 123 | csvwriter.write(category); 124 | csvwriter.write(notePrivate); 125 | csvwriter.write(note); 126 | } else { 127 | // Palm CSV format 128 | 129 | // Palm Windows specific line ending 130 | // that is only used within notes. 131 | note = note.replaceAll("\n", "\r\r\n"); 132 | 133 | csvwriter.write(note); 134 | csvwriter.write(encrypted); 135 | csvwriter.write(category); 136 | } 137 | csvwriter.writeNewline(); 138 | } 139 | } 140 | 141 | csvwriter.close(); 142 | } 143 | 144 | } 145 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/convertcsv/notepad/ImportCsv.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 OpenIntents.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.openintents.convertcsv.notepad; 18 | 19 | import java.io.IOException; 20 | import java.io.Reader; 21 | 22 | import org.openintents.convertcsv.common.ConvertCsvBaseActivity; 23 | import org.openintents.convertcsv.common.WrongFormatException; 24 | import org.openintents.convertcsv.opencsv.CSVReader; 25 | 26 | import android.content.Context; 27 | import android.util.Log; 28 | 29 | public class ImportCsv { 30 | private final static String TAG = "ImportCsv"; 31 | 32 | Context mContext; 33 | 34 | public static final String FORMAT_OUTLOOK_NOTES = "outlook notes"; 35 | public static final String FORMAT_PALM_CSV = "palm"; 36 | public static final String FORMAT_JPILOT_MEMO = "jpilot memo"; 37 | 38 | public ImportCsv(Context context) { 39 | mContext = context; 40 | } 41 | 42 | /** 43 | * @param dis 44 | * @throws IOException 45 | */ 46 | public void importCsv(Reader reader, String format, int importPolicy) throws IOException, 47 | WrongFormatException { 48 | 49 | // If we're in restore mode, delete everything. EVERYTHING. 50 | if (importPolicy == ConvertCsvBaseActivity.IMPORT_POLICY_RESTORE) { 51 | NotepadUtils.deleteAllNotes(mContext); 52 | } 53 | 54 | //boolean isPalm = format.equals(FORMAT_PALM_CSV); // Palm is default. 55 | boolean isOutlookNotes = format.equals(FORMAT_OUTLOOK_NOTES); 56 | boolean isJPilotMemo = format.equals(FORMAT_JPILOT_MEMO); 57 | 58 | boolean needToValidate = ((importPolicy == ConvertCsvBaseActivity.IMPORT_POLICY_KEEP) || (importPolicy == ConvertCsvBaseActivity.IMPORT_POLICY_OVERWRITE)); 59 | 60 | String note; 61 | long encrypted; 62 | String tags; 63 | 64 | CSVReader csvreader = new CSVReader(reader); 65 | String [] nextLine; 66 | if (isOutlookNotes) { 67 | // OutlookNotes has a header line that we ignore 68 | nextLine = csvreader.readNext(); 69 | if (nextLine.length != 5) { 70 | throw new WrongFormatException(); 71 | } 72 | } else if (isJPilotMemo) { 73 | // JPilot has a header line that we ignore 74 | nextLine = csvreader.readNext(); 75 | if (nextLine.length != 3) { 76 | throw new WrongFormatException(); 77 | } 78 | } 79 | while ((nextLine = csvreader.readNext()) != null) { 80 | // nextLine[] is an array of values from the line 81 | if (isOutlookNotes) { 82 | if (nextLine.length != 5) { 83 | throw new WrongFormatException(); 84 | } 85 | note = nextLine[0]; 86 | 87 | // We read encrypted ID from the Sensitivity column 88 | String sensitivity = nextLine[4]; 89 | encrypted = 0; 90 | if (sensitivity.startsWith("Encrypted ")) { 91 | try { 92 | encrypted = Long.parseLong(sensitivity.substring(10)); 93 | } catch (NumberFormatException e) { 94 | Log.e(TAG, "Error parsing 'encrypted' input: " + nextLine[1]); 95 | } 96 | } 97 | 98 | tags = nextLine[1]; 99 | } else if(isJPilotMemo) { 100 | if (nextLine.length != 3) { 101 | throw new WrongFormatException(); 102 | } 103 | tags = nextLine[0]; 104 | note = nextLine[2]; 105 | encrypted = 0; 106 | } else { 107 | // Default: Palm format 108 | if (nextLine.length != 3) { 109 | throw new WrongFormatException(); 110 | } 111 | note = nextLine[0]; 112 | 113 | // Palm windows inserts double carriage returns, 114 | // so we try to get rid of them: 115 | note = note.replaceAll("\n\n", "\n"); 116 | 117 | // Second column is encrypted 118 | encrypted = 0; 119 | try { 120 | encrypted = Long.parseLong(nextLine[1]); 121 | } catch (NumberFormatException e) { 122 | Log.e(TAG, "Error parsing 'encrypted' input: " + nextLine[1]); 123 | } 124 | 125 | // Third column would be category. 126 | tags = nextLine[2]; 127 | } 128 | 129 | // Do we need to overwrite or ignore this? 130 | if (needToValidate) { 131 | // We need to identify it by title. 132 | String title = NotepadUtils.extractTitle(note, encrypted); 133 | int existingNoteId = NotepadUtils.findNoteByTitle(mContext, title); 134 | 135 | if (existingNoteId != -1) { 136 | if (importPolicy == ConvertCsvBaseActivity.IMPORT_POLICY_KEEP) { 137 | // Already exists - don't touch it. 138 | Log.v(TAG, "Skipping note " + existingNoteId); 139 | continue; 140 | } 141 | 142 | // Need to delete the existing one first. 143 | NotepadUtils.deleteNoteById(mContext, existingNoteId); 144 | } 145 | } 146 | 147 | 148 | NotepadUtils.addNote(mContext, note, encrypted, tags); 149 | } 150 | } 151 | 152 | } 153 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/convertcsv/notepad/NotepadUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 OpenIntents.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.openintents.convertcsv.notepad; 18 | 19 | import org.openintents.provider.NotePad; 20 | import org.openintents.provider.NotePad.Notes; 21 | 22 | import android.content.ContentUris; 23 | import android.content.ContentValues; 24 | import android.content.Context; 25 | import android.database.Cursor; 26 | import android.net.Uri; 27 | import android.util.Log; 28 | 29 | public class NotepadUtils { 30 | 31 | private static final String TAG = "NotepadUtils"; 32 | 33 | public static final String[] PROJECTION_NOTES = new String[] { Notes._ID, 34 | Notes.TITLE, Notes.NOTE, Notes.CREATED_DATE, Notes.MODIFIED_DATE}; 35 | 36 | public static long addNote(Context context, String note, long encrypted, String tags) { 37 | 38 | // First check which columns are available: 39 | Uri testuri = ContentUris.withAppendedId(NotePad.Notes.CONTENT_URI, 0); 40 | Cursor c = context.getContentResolver().query(testuri, null, null, null, 41 | NotePad.Notes.DEFAULT_SORT_ORDER); 42 | 43 | int COLUMN_INDEX_ENCRYPTED = c.getColumnIndex(NotePad.Notes.ENCRYPTED); // Introduced in 1.1.0 44 | int COLUMN_INDEX_TAGS = c.getColumnIndex(NotePad.Notes.TAGS); // Introduced in 1.1.0 45 | 46 | c.close(); 47 | 48 | // Add item to list: 49 | ContentValues values = new ContentValues(1); 50 | values.put(NotePad.Notes.NOTE, note); 51 | String title = extractTitle(note, encrypted); 52 | values.put(NotePad.Notes.TITLE, title); 53 | 54 | if (COLUMN_INDEX_ENCRYPTED > -1) { 55 | values.put(NotePad.Notes.ENCRYPTED, encrypted); 56 | } 57 | if (COLUMN_INDEX_TAGS > -1) { 58 | values.put(NotePad.Notes.TAGS, tags); 59 | } 60 | 61 | try { 62 | Uri uri = context.getContentResolver().insert(NotePad.Notes.CONTENT_URI, 63 | values); 64 | Log.i(TAG, "Insert new note: " + uri); 65 | return Long.parseLong(uri.getPathSegments().get(1)); 66 | } catch (Exception e) { 67 | Log.i(TAG, "Insert item failed", e); 68 | return -1; 69 | } 70 | } 71 | 72 | public static String extractTitle(String note, long encrypted) { 73 | int length = note.length(); 74 | String title = (encrypted > 0)? note : note.substring(0, Math.min(30, length)); 75 | // Break at newline: 76 | int firstNewline = title.indexOf('\n'); 77 | if (firstNewline > 0) { 78 | title = title.substring(0, firstNewline); 79 | } else if (length > 30) { 80 | // Break at space 81 | int lastSpace = title.lastIndexOf(' '); 82 | if (lastSpace > 0) { 83 | title = title.substring(0, lastSpace); 84 | } 85 | } 86 | return title; 87 | } 88 | 89 | public static void deleteAllNotes(Context context) { 90 | try { 91 | Log.i(TAG, "Deleting ALL notes"); 92 | context.getContentResolver().delete(NotePad.Notes.CONTENT_URI, "", null); 93 | Log.i(TAG, "ALL notes deleted"); 94 | } catch (Exception e) { 95 | Log.i(TAG, "Failed to delete all notes", e); 96 | } 97 | } 98 | 99 | public static void deleteNoteById(Context context, int noteId) { 100 | Log.i(TAG, "Deleting note " + noteId); 101 | String[] args = { Integer.toString(noteId) }; 102 | 103 | context.getContentResolver().delete(NotePad.Notes.CONTENT_URI, Notes._ID + " =?", args); 104 | } 105 | 106 | public static int findNoteByTitle(Context context, String title) { 107 | String[] projection = { Notes._ID, Notes._ID }; 108 | String[] args = { title }; 109 | int result = -1; 110 | 111 | Cursor cursor = context.getContentResolver().query(NotePad.Notes.CONTENT_URI, projection, Notes.TITLE + " =?", args, null); 112 | 113 | // Did we get any results? 114 | if (cursor.moveToFirst()) { 115 | result = cursor.getInt(0); 116 | } 117 | 118 | cursor.close(); 119 | return result; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/convertcsv/shoppinglist/ConvertCsvActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 OpenIntents.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.openintents.convertcsv.shoppinglist; 18 | 19 | import android.content.Intent; 20 | import android.content.SharedPreferences; 21 | import android.database.Cursor; 22 | import android.net.Uri; 23 | import android.os.Bundle; 24 | import android.preference.PreferenceManager; 25 | import android.util.Xml.Encoding; 26 | import android.view.View; 27 | import android.widget.AdapterView; 28 | import android.widget.AdapterView.OnItemSelectedListener; 29 | 30 | import org.openintents.convertcsv.PreferenceActivity; 31 | import org.openintents.convertcsv.R; 32 | import org.openintents.convertcsv.common.ConvertCsvBaseActivity; 33 | import org.openintents.convertcsv.common.WrongFormatException; 34 | import org.openintents.shopping.library.provider.ShoppingContract; 35 | import org.openintents.shopping.library.util.ShoppingUtils; 36 | 37 | import java.io.IOException; 38 | import java.io.Reader; 39 | import java.io.Writer; 40 | 41 | public class ConvertCsvActivity extends ConvertCsvBaseActivity { 42 | 43 | public static final String TAG = "ConvertCsvActivity"; 44 | 45 | final String HANDYSHOPPER_FORMAT = "handyshopper"; 46 | 47 | public void setPreferencesUsed() { 48 | PREFERENCE_FILENAME = PreferenceActivity.PREFS_SHOPPINGLIST_FILENAME; 49 | DEFAULT_FILENAME = getString(R.string.default_shoppinglist_filename); 50 | PREFERENCE_FORMAT = PreferenceActivity.PREFS_SHOPPINGLIST_FORMAT; 51 | DEFAULT_FORMAT = "outlook tasks"; 52 | PREFERENCE_ENCODING = PreferenceActivity.PREFS_SHOPPINGLIST_ENCODING; 53 | PREFERENCE_USE_CUSTOM_ENCODING = PreferenceActivity.PREFS_SHOPPINGLIST_USE_CUSTOM_ENCODING; 54 | RES_STRING_FILEMANAGER_TITLE = R.string.filemanager_title_shoppinglist; 55 | RES_ARRAY_CSV_FILE_FORMAT = R.array.shoppinglist_format; 56 | RES_ARRAY_CSV_FILE_FORMAT_VALUE = R.array.shoppinglist_format_value; 57 | } 58 | 59 | /** 60 | * Called when the activity is first created. 61 | */ 62 | @Override 63 | public void onCreate(Bundle savedInstanceState) { 64 | super.onCreate(savedInstanceState); 65 | 66 | if (mConvertInfo != null) { 67 | mConvertInfo.setText(R.string.convert_all_shoppinglists); 68 | } 69 | 70 | if (mSpinner != null) { 71 | mSpinner.setOnItemSelectedListener(new OnItemSelectedListener() { 72 | @Override 73 | public void onItemSelected(AdapterView parentView, View selectedItemView, int position, long id) { 74 | updateInfo(); 75 | } 76 | 77 | @Override 78 | public void onNothingSelected(AdapterView parentView) { 79 | updateInfo(); 80 | } 81 | }); 82 | } 83 | } 84 | 85 | public void updateInfo() { 86 | if (mConvertInfo == null) return; 87 | 88 | String format = getFormat(); 89 | if (DEFAULT_FORMAT.equals(format)) { 90 | mConvertInfo.setText(R.string.convert_all_shoppinglists); 91 | } else if (HANDYSHOPPER_FORMAT.equals(format)) { 92 | long listId = getCurrentListId(); 93 | String listname = getListName(listId); 94 | if (listname != null) { 95 | String text = getString(R.string.convert_list, listname); 96 | mConvertInfo.setText(text); 97 | } 98 | 99 | } 100 | } 101 | 102 | /** 103 | * @param reader 104 | * @throws IOException 105 | */ 106 | @Override 107 | public void doImport(Reader reader) throws IOException, 108 | WrongFormatException { 109 | ImportCsv ic = new ImportCsv(this, getValidatedImportPolicy()); 110 | String format = getFormat(); 111 | if (DEFAULT_FORMAT.equals(format)) { 112 | ic.importCsv(reader); 113 | } else if (HANDYSHOPPER_FORMAT.equals(format)) { 114 | SharedPreferences pm = PreferenceManager.getDefaultSharedPreferences(this); 115 | Boolean importStores = pm.getBoolean("shoppinglist_import_stores", true); 116 | long listId = getCurrentListId(); 117 | ic.importHandyShopperCsv(reader, listId, importStores); 118 | } 119 | } 120 | 121 | @Override 122 | public void onImportFinished() { 123 | Intent i = new Intent(Intent.ACTION_VIEW); 124 | Uri uri = ShoppingContract.Lists.CONTENT_URI.buildUpon().appendPath(String.valueOf(getCurrentListId())).build(); 125 | i.setData(uri); 126 | startActivity(i); 127 | } 128 | 129 | @Override 130 | protected Encoding getDefaultEncoding() { 131 | long id = mSpinner.getSelectedItemId(); 132 | if (0 == id) { 133 | return Encoding.ISO_8859_1; // Default encoding for "MS Outlook Tasks". 134 | } else if (1 == id) { 135 | return Encoding.UTF_8; // Default encoding for "HandyShopper". 136 | } else { 137 | return super.getDefaultEncoding(); 138 | } 139 | } 140 | 141 | /** 142 | * @param writer 143 | * @throws IOException 144 | */ 145 | @Override 146 | public void doExport(Writer writer) throws IOException { 147 | ExportCsv ec = new ExportCsv(this); 148 | String format = getFormat(); 149 | if (DEFAULT_FORMAT.equals(format)) { 150 | ec.exportCsv(writer); 151 | } else if (HANDYSHOPPER_FORMAT.equals(format)) { 152 | long listId = getCurrentListId(); 153 | ec.exportHandyShopperCsv(writer, listId); 154 | /*runOnUiThread(new Runnable() { 155 | @Override 156 | public void run() { 157 | Toast.makeText(ConvertCsvActivity.this, R.string.error_not_yet_implemented, 158 | Toast.LENGTH_LONG).show(); 159 | } 160 | });*/ 161 | } 162 | } 163 | 164 | /** 165 | * @return The string that identifies the import policy for this importer. 166 | * null if this derived activity does not support import policies. 167 | */ 168 | public String getImportPolicyPrefString() { 169 | return "shoppinglist_import_policy"; 170 | } 171 | 172 | /** 173 | * @return The default import policy 174 | */ 175 | public String getDefaultImportPolicy() { 176 | return "" + IMPORT_POLICY_KEEP; 177 | } 178 | 179 | public long getCurrentListId() { 180 | long listId = -1; 181 | 182 | // Try the URI with which Convert CSV has been called: 183 | Uri uri = getIntent().getData(); 184 | Cursor c = getContentResolver().query(uri, 185 | new String[]{ShoppingContract.Lists._ID}, null, null, null); 186 | if (c != null) { 187 | if (c.moveToFirst()) { 188 | listId = c.getLong(0); 189 | } 190 | c.close(); 191 | } 192 | 193 | // Use default list if URI is not valid. 194 | if (listId < 0) { 195 | listId = ShoppingUtils.getDefaultList(this); 196 | } 197 | return listId; 198 | } 199 | 200 | public String getListName(long listId) { 201 | String listname = null; 202 | Uri uri = getIntent().getData(); 203 | Cursor c = getContentResolver().query(uri, 204 | new String[]{ShoppingContract.Lists.NAME}, null, null, null); 205 | if (c != null) { 206 | if (c.moveToFirst()) { 207 | listname = c.getString(0); 208 | } 209 | c.close(); 210 | } 211 | return listname; 212 | } 213 | 214 | @Override 215 | protected String getWritePermission() { 216 | return "org.openintents.shoppinglist.WRITE_PERMISSION"; 217 | } 218 | } 219 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/intents/FileManagerIntents.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 OpenIntents.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.openintents.intents; 18 | 19 | // Version Dec 9, 2008 20 | 21 | 22 | /** 23 | * Provides OpenIntents actions, extras, and categories used by providers. 24 | *

These specifiers extend the standard Android specifiers.

25 | */ 26 | public final class FileManagerIntents { 27 | 28 | /** 29 | * Activity Action: Pick a file through the file manager, or let user 30 | * specify a custom file name. 31 | * Data is the current file name or file name suggestion. 32 | * Returns a new file name as file URI in data. 33 | * 34 | *

Constant Value: "org.openintents.action.PICK_FILE"

35 | */ 36 | public static final String ACTION_PICK_FILE = "org.openintents.action.PICK_FILE"; 37 | 38 | /** 39 | * Activity Action: Pick a directory through the file manager, or let user 40 | * specify a custom file name. 41 | * Data is the current directory name or directory name suggestion. 42 | * Returns a new directory name as file URI in data. 43 | * 44 | *

Constant Value: "org.openintents.action.PICK_DIRECTORY"

45 | */ 46 | public static final String ACTION_PICK_DIRECTORY = "org.openintents.action.PICK_DIRECTORY"; 47 | 48 | /** 49 | * The title to display. 50 | * 51 | *

This is shown in the title bar of the file manager.

52 | * 53 | *

Constant Value: "org.openintents.extra.TITLE"

54 | */ 55 | public static final String EXTRA_TITLE = "org.openintents.extra.TITLE"; 56 | 57 | /** 58 | * The text on the button to display. 59 | * 60 | *

Depending on the use, it makes sense to set this to "Open" or "Save".

61 | * 62 | *

Constant Value: "org.openintents.extra.BUTTON_TEXT"

63 | */ 64 | public static final String EXTRA_BUTTON_TEXT = "org.openintents.extra.BUTTON_TEXT"; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/org/openintents/provider/NotePad.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 OpenIntents.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Original copyright: 19 | * Based on the Android SDK sample application NotePad. 20 | * Copyright (C) 2007 Google Inc. 21 | * Licensed under the Apache License, Version 2.0. 22 | */ 23 | 24 | package org.openintents.provider; 25 | 26 | import android.net.Uri; 27 | import android.provider.BaseColumns; 28 | 29 | /** 30 | * Convenience definitions for NotePadProvider 31 | * 32 | * @version 2009-01-12, 23:09 UTC 33 | */ 34 | public final class NotePad { 35 | public static final String AUTHORITY = "org.openintents.notepad"; 36 | 37 | // This class cannot be instantiated 38 | private NotePad() {} 39 | 40 | /** 41 | * Notes table 42 | */ 43 | public static final class Notes implements BaseColumns { 44 | // This class cannot be instantiated 45 | private Notes() {} 46 | 47 | /** 48 | * The content:// style URL for this table 49 | */ 50 | public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/notes"); 51 | 52 | /** 53 | * The MIME type of {@link #CONTENT_URI} providing a directory of notes. 54 | */ 55 | public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.openintents.notepad.note"; 56 | 57 | /** 58 | * The MIME type of a {@link #CONTENT_URI} sub-directory of a single note. 59 | */ 60 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.openintents.notepad.note"; 61 | 62 | /** 63 | * The default sort order for this table 64 | */ 65 | public static final String DEFAULT_SORT_ORDER = "modified DESC"; 66 | 67 | /** 68 | * The title of the note 69 | *

Type: TEXT

70 | */ 71 | public static final String TITLE = "title"; 72 | 73 | /** 74 | * The note itself 75 | *

Type: TEXT

76 | */ 77 | public static final String NOTE = "note"; 78 | 79 | /** 80 | * The timestamp for when the note was created 81 | *

Type: INTEGER (long from System.curentTimeMillis())

82 | */ 83 | public static final String CREATED_DATE = "created"; 84 | 85 | /** 86 | * The timestamp for when the note was last modified 87 | *

Type: INTEGER (long from System.curentTimeMillis())

88 | */ 89 | public static final String MODIFIED_DATE = "modified"; 90 | 91 | /** 92 | * Tags associated with a note. 93 | * Multiple tags are separated by commas. 94 | *

Type: TEXT

95 | * @since 1.1.0 96 | */ 97 | public static final String TAGS = "tags"; 98 | 99 | /** 100 | * Whether the note is encrypted. 101 | * 0 = not encrypted. 1 = encrypted. 102 | *

Type: INTEGER

103 | * @since 1.1.0 104 | */ 105 | public static final String ENCRYPTED = "encrypted"; 106 | 107 | /** 108 | * A theme URI. 109 | *

Type: TEXT

110 | * @since 1.1.0 111 | */ 112 | public static final String THEME = "theme"; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v9/ic_menu_convert_csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/app/src/main/res/drawable-hdpi-v9/ic_menu_convert_csv.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi-v9/ic_menu_convert_csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/app/src/main/res/drawable-ldpi-v9/ic_menu_convert_csv.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi-v9/ic_menu_convert_csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/app/src/main/res/drawable-mdpi-v9/ic_menu_convert_csv.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi-v9/ic_menu_convert_csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/app/src/main/res/drawable-xhdpi-v9/ic_menu_convert_csv.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_folder_new_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/app/src/main/res/drawable/ic_launcher_folder_new_small.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_folder_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/app/src/main/res/drawable/ic_launcher_folder_small.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_convert_csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openintents/convertcsv/3b7cee426ab443112f0890f53c78be66b8b6de18/app/src/main/res/drawable/ic_menu_convert_csv.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_account.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_account.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 23 | 24 |