├── settings.gradle ├── gradle.properties ├── demo ├── src │ └── main │ │ ├── res │ │ ├── raw │ │ │ └── image.png │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ ├── dimens.xml │ │ │ └── strings.xml │ │ ├── xml │ │ │ └── file_paths.xml │ │ └── layout │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── evernote │ │ └── android │ │ └── intent │ │ └── demo │ │ └── MainActivity.java └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── library ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── evernote │ │ └── android │ │ └── intent │ │ ├── NoArgsIntentBuilder.java │ │ ├── SearchNotesIntentBuilder.java │ │ ├── EvernoteIntentResult.java │ │ ├── ViewNoteIntentBuilder.java │ │ ├── ImportEnexIntentBuilder.java │ │ ├── IntentBuilder.java │ │ ├── EvernoteIntent.java │ │ └── CreateNewNoteIntentBuilder.java └── build.gradle ├── CHANGES.md ├── .gitignore ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE /settings.gradle: -------------------------------------------------------------------------------- 1 | include 'library', 'demo' 2 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | VERSION_NAME=1.0.3 2 | #VERSION_NAME=1.0.3-SNAPSHOT 3 | VERSION_CODE=1 -------------------------------------------------------------------------------- /demo/src/main/res/raw/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/android-intent/HEAD/demo/src/main/res/raw/image.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/android-intent/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/android-intent/HEAD/demo/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/android-intent/HEAD/demo/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/android-intent/HEAD/demo/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/android-intent/HEAD/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/android-intent/HEAD/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | -------------------------------------------------------------------------------- /demo/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /demo/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Intent Demo 4 | Evernote not installed. 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip 7 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | ## 1.0.3 (2015-11-11) 2 | 3 | * remove option to set the 'author' 4 | 5 | ## 1.0.2 (2015-09-07) 6 | 7 | * add concrete intent builder for enex import 8 | 9 | ## 1.0.1 (2015-05-26) 10 | 11 | * pick note 12 | * add attachment in new note in demo 13 | 14 | ## 1.0.0 (2015-05-13) 15 | 16 | * create new note 17 | * search with query parameter 18 | * view an existing note 19 | * take new snapshot 20 | * record voice note 21 | * open search UI -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #Android generated 2 | bin 3 | gen 4 | target 5 | out 6 | build 7 | 8 | #Eclipse 9 | .project 10 | .classpath 11 | .settings 12 | 13 | #IntelliJ IDEA 14 | .idea 15 | *.iml 16 | classes 17 | *.ipr 18 | *.iws 19 | gen-external-apklibs 20 | 21 | #Maven 22 | release.properties 23 | pom.xml.* 24 | 25 | #Ant 26 | build.xml 27 | ant.properties 28 | local.properties 29 | 30 | #Gradle 31 | .gradle 32 | 33 | #Command line 34 | proguard-project.txt 35 | .DS_Store 36 | .tmp -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply from: '../build-config/gradle-quality.gradle' 3 | 4 | dependencies { 5 | provided 'com.android.support:support-annotations:23.1.0' 6 | } 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | resourcePrefix 'eintent_' 13 | 14 | defaultConfig { 15 | minSdkVersion rootProject.ext.minSdkVersion 16 | targetSdkVersion rootProject.ext.targetSdkVersion 17 | versionName project.VERSION_NAME 18 | versionCode Integer.parseInt(project.VERSION_CODE) 19 | } 20 | 21 | compileOptions { 22 | sourceCompatibility JavaVersion.VERSION_1_7 23 | targetCompatibility JavaVersion.VERSION_1_7 24 | } 25 | 26 | lintOptions { 27 | abortOnError true 28 | 29 | htmlOutput file("$project.buildDir/reports/lint/lint.html") 30 | xmlOutput file("$project.buildDir/reports/lint/lint.xml") 31 | } 32 | } 33 | 34 | apply from: '../build-config/gradle-push.gradle' -------------------------------------------------------------------------------- /demo/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply from: '../build-config/gradle-quality.gradle' 3 | 4 | android { 5 | compileSdkVersion rootProject.ext.compileSdkVersion 6 | buildToolsVersion rootProject.ext.buildToolsVersion 7 | 8 | defaultConfig { 9 | applicationId "com.evernote.android.intent.demo" 10 | 11 | minSdkVersion rootProject.ext.minSdkVersion 12 | targetSdkVersion rootProject.ext.targetSdkVersion 13 | 14 | versionName project.VERSION_NAME 15 | versionCode Integer.parseInt(project.VERSION_CODE) 16 | } 17 | 18 | compileOptions { 19 | sourceCompatibility JavaVersion.VERSION_1_7 20 | targetCompatibility JavaVersion.VERSION_1_7 21 | } 22 | 23 | lintOptions { 24 | abortOnError true 25 | 26 | htmlOutput file("$project.buildDir/reports/lint/lint.html") 27 | xmlOutput file("$project.buildDir/reports/lint/lint.xml") 28 | } 29 | } 30 | 31 | dependencies { 32 | compile project(':library') 33 | compile 'com.android.support:support-v4:23.1.0' 34 | } 35 | -------------------------------------------------------------------------------- /demo/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 25 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /library/src/main/java/com/evernote/android/intent/NoArgsIntentBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present Evernote Corporation. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, this 9 | * list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 22 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | package com.evernote.android.intent; 27 | 28 | /** 29 | * A helper class which might be exchanged in the future for additional parameters. 30 | * 31 | * @author rwondratschek 32 | */ 33 | public class NoArgsIntentBuilder extends IntentBuilder { 34 | 35 | /*package*/ NoArgsIntentBuilder(String action) { 36 | super(action); 37 | } 38 | 39 | @Override 40 | protected NoArgsIntentBuilder self() { 41 | return this; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /library/src/main/java/com/evernote/android/intent/SearchNotesIntentBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present Evernote Corporation. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, this 9 | * list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 22 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | package com.evernote.android.intent; 27 | 28 | import android.app.SearchManager; 29 | import android.support.annotation.Nullable; 30 | 31 | /** 32 | * @author rwondratschek 33 | */ 34 | public final class SearchNotesIntentBuilder extends IntentBuilder { 35 | 36 | /*package*/ SearchNotesIntentBuilder() { 37 | super(EvernoteIntent.ACTION_SEARCH_NOTES); 38 | } 39 | 40 | /** 41 | * @param query The query for the notes. If {@code null} then the current value gets removed. 42 | * @return This Builder object to allow for chaining of calls to set methods. 43 | */ 44 | public SearchNotesIntentBuilder setQuery(@Nullable String query) { 45 | return putString(SearchManager.QUERY, query); 46 | } 47 | 48 | @Override 49 | protected SearchNotesIntentBuilder self() { 50 | return this; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /library/src/main/java/com/evernote/android/intent/EvernoteIntentResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present Evernote Corporation. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, this 9 | * list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 22 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | package com.evernote.android.intent; 27 | 28 | import android.app.Activity; 29 | import android.content.Intent; 30 | 31 | /** 32 | * This class helps to parse returned values from the Evernote app in {@link Activity#onActivityResult(int, int, Intent)}. 33 | * 34 | * @author rwondratschek 35 | */ 36 | @SuppressWarnings("unused") 37 | public final class EvernoteIntentResult { 38 | 39 | private EvernoteIntentResult() { 40 | // no op 41 | } 42 | 43 | /** 44 | * @param data The returned data from {@link Activity#onActivityResult(int, int, Intent)}. 45 | * @return The note GUID if it was set or {@code null}. 46 | */ 47 | public static String getNoteGuid(Intent data) { 48 | return data == null ? null : data.getStringExtra(EvernoteIntent.EXTRA_NOTE_GUID); 49 | } 50 | 51 | /** 52 | * @param data The returned data from {@link Activity#onActivityResult(int, int, Intent)}. 53 | * @return The notebook GUID if it was set or {@code null}. 54 | */ 55 | public static String getNotebookGuid(Intent data) { 56 | return data == null ? null : data.getStringExtra(EvernoteIntent.EXTRA_NOTEBOOK_GUID); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /library/src/main/java/com/evernote/android/intent/ViewNoteIntentBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present Evernote Corporation. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, this 9 | * list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 22 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | package com.evernote.android.intent; 27 | 28 | /** 29 | * @author rwondratschek 30 | */ 31 | public class ViewNoteIntentBuilder extends IntentBuilder { 32 | 33 | /*package*/ ViewNoteIntentBuilder() { 34 | super(EvernoteIntent.ACTION_VIEW_NOTE); 35 | } 36 | 37 | /** 38 | * @param noteGuid The desired GUID of the note which should be opened. An error message will open, 39 | * if the note can't be found or isn't associated with the signed in account. 40 | * @return This Builder object to allow for chaining of calls to set methods. 41 | */ 42 | public ViewNoteIntentBuilder setNoteGuid(String noteGuid) { 43 | return putString(EvernoteIntent.EXTRA_NOTE_GUID, noteGuid); 44 | } 45 | 46 | /** 47 | * @param fullScreen If {@code true} note is viewed in full screen mode. 48 | * @return This Builder object to allow for chaining of calls to set methods. 49 | */ 50 | public ViewNoteIntentBuilder setFullScreen(boolean fullScreen) { 51 | return putBoolean(EvernoteIntent.EXTRA_FULL_SCREEN, fullScreen); 52 | } 53 | 54 | @Override 55 | protected ViewNoteIntentBuilder self() { 56 | return this; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Evernote Android-Intent 2 | ======================= 3 | 4 | This tiny library lets you easily send Android Intents to the main Evernote app. 5 | 6 | Download 7 | -------- 8 | 9 | Add the library as a dependency in your build.gradle file. 10 | 11 | ```groovy 12 | dependencies { 13 | compile 'com.evernote:android-intent:1.0.3' 14 | } 15 | ``` 16 | 17 | Usage 18 | ----- 19 | 20 | `EvernoteIntent` serves as entry point and provides all possible Intent builders, e.g. you can create a new note, view an existing note or make a new snapshot. 21 | 22 | Some returned builders provide additional parameters. 23 | 24 | ```java 25 | private void sharePlainTextNote() { 26 | Intent intent = EvernoteIntent.createNewNote() 27 | .setTitle("Intent Demo Title") 28 | .addTags("Intent Demo Tag") 29 | .setTextPlain("This note is created by the Evernote intent demo application. https://github.com/evernote/android-intent") 30 | .setSourceApp(getPackageName()) 31 | .setAppVisibility(CreateNewNoteIntentBuilder.AppVisibility.QUICK_SEND) 32 | .create(); 33 | 34 | startActivity(intent); 35 | } 36 | ``` 37 | 38 | For some Intents the Evernote app returns a result, e.g. if you pick note. In this case you can use `EvernoteIntentResult` to parse the data. 39 | 40 | ```java 41 | @Override 42 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { 43 | switch (requestCode) { 44 | case REQ_PICK_NOTE: 45 | if (resultCode != RESULT_OK || data == null) { 46 | Toast.makeText(this, "Cancelled", Toast.LENGTH_SHORT).show(); 47 | } else { 48 | mNoteGuid = EvernoteIntentResult.getNoteGuid(data); 49 | } 50 | break; 51 | 52 | default: 53 | super.onActivityResult(requestCode, resultCode, data); 54 | break; 55 | } 56 | } 57 | 58 | ``` 59 | 60 | License 61 | ------- 62 | Copyright (c) 2007-2015 by Evernote Corporation, All rights reserved. 63 | 64 | Use of the source code and binary libraries included in this package 65 | is permitted under the following terms: 66 | 67 | Redistribution and use in source and binary forms, with or without 68 | modification, are permitted provided that the following conditions 69 | are met: 70 | 71 | 1. Redistributions of source code must retain the above copyright 72 | notice, this list of conditions and the following disclaimer. 73 | 2. Redistributions in binary form must reproduce the above copyright 74 | notice, this list of conditions and the following disclaimer in the 75 | documentation and/or other materials provided with the distribution. 76 | 77 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 78 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 79 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 80 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 81 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 82 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 83 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 84 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 85 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 86 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 87 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 |