├── .gitignore ├── .idea ├── gradle.xml ├── libraries │ ├── animated_vector_drawable_23_4_0.xml │ ├── appcompat_v7_23_4_0.xml │ ├── espresso_core_2_2_2.xml │ ├── espresso_idling_resource_2_2_2.xml │ ├── exposed_instrumentation_api_publish_0_5.xml │ ├── hamcrest_core_1_3.xml │ ├── hamcrest_integration_1_3.xml │ ├── hamcrest_library_1_3.xml │ ├── javawriter_2_1_1.xml │ ├── javax_annotation_api_1_2.xml │ ├── javax_inject_1.xml │ ├── jsr305_2_0_1.xml │ ├── junit_4_12.xml │ ├── rules_0_5.xml │ ├── runner_0_5.xml │ ├── support_annotations_23_4_0.xml │ ├── support_v4_23_4_0.xml │ └── support_vector_drawable_23_4_0.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── AutoCrashReporter.iml ├── LICENSE ├── README.md ├── SampleACR.iml ├── acr ├── .gitignore ├── acr.iml ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── devs │ │ └── acr │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── devs │ │ │ └── acr │ │ │ ├── AutoErrorReporter.java │ │ │ └── ErrorReporterActivity.java │ └── res │ │ ├── drawable-hdpi │ │ └── ic_warning_black_36dp.png │ │ ├── drawable-xhdpi │ │ └── ic_warning_black_48dp.png │ │ ├── layout │ │ └── activity_erroe_reporter.xml │ │ └── values │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── devs │ └── acr │ └── ExampleUnitTest.java ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── crashreporter │ │ └── devs │ │ └── com │ │ └── myapplication │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── crashreporter │ │ │ └── devs │ │ │ └── com │ │ │ └── myapplication │ │ │ ├── MainActivity.java │ │ │ └── MyApplication.java │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── 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-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── crashreporter │ └── devs │ └── com │ └── myapplication │ └── ExampleUnitTest.java ├── assets └── acr_demo.gif ├── build.gradle ├── build └── generated │ └── mockable-android-23.jar ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | /.idea 10 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/libraries/animated_vector_drawable_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/appcompat_v7_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/espresso_core_2_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/espresso_idling_resource_2_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/exposed_instrumentation_api_publish_0_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/hamcrest_integration_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/hamcrest_library_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/javawriter_2_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/javax_annotation_api_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/javax_inject_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/jsr305_2_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/rules_0_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/runner_0_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/support_annotations_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/support_v4_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/support_vector_drawable_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AutoCrashReporter.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AutoCrashReporter 2 | [![ACR](https://api.bintray.com/packages/ideal/maven/acr/images/download.svg) ](https://bintray.com/ideal/maven/acr/_latestVersion) 3 | [![API](https://img.shields.io/badge/API-9%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=9) 4 | [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-AutoCrashReporter-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/4517) 5 | [![GitHub license](https://img.shields.io/github/license/dcendents/android-maven-gradle-plugin.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) 6 | 7 | ACR is an android library to simplify crash detection while your app is under development, crash will be automatically detect by the library then app tester/user can easily send the crash report on one click to developer that will help him to fix the issue. 8 | 9 | ##Demonstration 10 | ![ACR Demo](/assets/acr_demo.gif) 11 | 12 | ##Dependency 13 | - Add the dependencies to your app level build.gradle file: 14 | 15 | ####Gradle 16 | ```gradle 17 | compile 'com.devs:acr:1.0.1' 18 | ``` 19 | ####Maven 20 | ```xml 21 | 22 | com.devs 23 | acr 24 | 1.0.1 25 | pom 26 | 27 | ``` 28 | 29 | ##Usage 30 | - Inside your Application: 31 | ```java 32 | @Override 33 | public void onCreate() { 34 | super.onCreate(); 35 | AutoErrorReporter.get(this) 36 | .setEmailAddresses("yourdeveloper@gmail.com") 37 | .setEmailSubject("Auto Crash Report") 38 | .start(); 39 | } 40 | 41 | ``` 42 | 43 | ## License 44 | ``` 45 | Copyright 2016 Deven Singh 46 | 47 | Licensed under the Apache License, Version 2.0 (the "License"); 48 | you may not use this file except in compliance with the License. 49 | You may obtain a copy of the License at 50 | 51 | http://www.apache.org/licenses/LICENSE-2.0 52 | 53 | Unless required by applicable law or agreed to in writing, software 54 | distributed under the License is distributed on an "AS IS" BASIS, 55 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 56 | See the License for the specific language governing permissions and 57 | limitations under the License. 58 | ``` -------------------------------------------------------------------------------- /SampleACR.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /acr/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /acr/acr.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /acr/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | ext { 4 | bintrayRepo = 'maven' 5 | bintrayName = 'acr' 6 | orgName = 'ideal' 7 | 8 | publishedGroupId = 'com.devs' 9 | libraryName = 'AutoCrashReporter' 10 | artifact = 'acr' 11 | 12 | libraryDescription = 'Auto Crash Reporter' 13 | 14 | siteUrl = 'https://github.com/devsideal/AutoCrashReporter' 15 | gitUrl = 'https://github.com/devsideal/AutoCrashReporter.git' 16 | 17 | libraryVersion = '1.0.1' 18 | 19 | developerId = 'ideal' 20 | developerName = 'deven' 21 | developerEmail = 'devs.ideal@gmail.com' 22 | 23 | licenseName = 'The Apache Software License, Version 2.0' 24 | licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' 25 | allLicenses = ["Apache-2.0"] 26 | } 27 | 28 | 29 | android { 30 | compileSdkVersion 23 31 | buildToolsVersion "23.0.3" 32 | 33 | defaultConfig { 34 | minSdkVersion 9 35 | targetSdkVersion 21 36 | versionCode 2 37 | versionName "1.0.1" 38 | 39 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 40 | 41 | } 42 | buildTypes { 43 | release { 44 | minifyEnabled false 45 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 46 | } 47 | } 48 | 49 | } 50 | 51 | dependencies { 52 | compile fileTree(dir: 'libs', include: ['*.jar']) 53 | } 54 | 55 | //=============================================== 56 | apply plugin: 'com.jfrog.bintray' 57 | 58 | version = libraryVersion 59 | 60 | if (project.hasProperty("android")) { // Android libraries 61 | task sourcesJar(type: Jar) { 62 | classifier = 'sources' 63 | from android.sourceSets.main.java.srcDirs 64 | } 65 | 66 | task javadoc(type: Javadoc) { 67 | source = android.sourceSets.main.java.srcDirs 68 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) 69 | } 70 | } else { // Java libraries 71 | task sourcesJar(type: Jar, dependsOn: classes) { 72 | classifier = 'sources' 73 | from sourceSets.main.allSource 74 | } 75 | } 76 | 77 | task javadocJar(type: Jar, dependsOn: javadoc) { 78 | classifier = 'javadoc' 79 | from javadoc.destinationDir 80 | } 81 | 82 | artifacts { 83 | archives javadocJar 84 | archives sourcesJar 85 | } 86 | 87 | // Bintray 88 | Properties properties = new Properties() 89 | properties.load(project.rootProject.file('local.properties').newDataInputStream()) 90 | 91 | bintray { 92 | user = properties.getProperty("bintray.user") 93 | key = properties.getProperty("bintray.apikey") 94 | 95 | configurations = ['archives'] 96 | pkg { 97 | repo = bintrayRepo 98 | name = bintrayName 99 | userOrg = orgName 100 | desc = libraryDescription 101 | websiteUrl = siteUrl 102 | vcsUrl = gitUrl 103 | licenses = allLicenses 104 | publish = true 105 | publicDownloadNumbers = true 106 | version { 107 | desc = libraryDescription 108 | gpg { 109 | sign = true //Determines whether to GPG sign the files. The default is false 110 | passphrase = properties.getProperty("bintray.gpg.password") 111 | //Optional. The passphrase for GPG signing' 112 | } 113 | } 114 | } 115 | } 116 | 117 | //============================================ 118 | apply plugin: 'com.github.dcendents.android-maven' 119 | 120 | group = publishedGroupId // Maven Group ID for the artifact 121 | 122 | install { 123 | repositories.mavenInstaller { 124 | // This generates POM.xml with proper parameters 125 | pom { 126 | project { 127 | packaging 'aar' 128 | groupId publishedGroupId 129 | artifactId artifact 130 | 131 | // Add your description here 132 | name libraryName 133 | description libraryDescription 134 | url siteUrl 135 | 136 | // Set your license 137 | licenses { 138 | license { 139 | name licenseName 140 | url licenseUrl 141 | } 142 | } 143 | developers { 144 | developer { 145 | id developerId 146 | name developerName 147 | email developerEmail 148 | } 149 | } 150 | scm { 151 | connection gitUrl 152 | developerConnection gitUrl 153 | url siteUrl 154 | 155 | } 156 | } 157 | } 158 | } 159 | } 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /acr/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/idealtechno/android-sdk-as/SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /acr/src/androidTest/java/com/devs/acr/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.devs.acr; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.devs.acr.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /acr/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /acr/src/main/java/com/devs/acr/AutoErrorReporter.java: -------------------------------------------------------------------------------- 1 | package com.devs.acr; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.pm.PackageInfo; 7 | import android.content.pm.PackageManager; 8 | import android.os.Build; 9 | import android.os.Environment; 10 | import android.os.StatFs; 11 | import android.text.Html; 12 | import android.util.Log; 13 | 14 | import java.io.BufferedReader; 15 | import java.io.File; 16 | import java.io.FileOutputStream; 17 | import java.io.FileReader; 18 | import java.io.FilenameFilter; 19 | import java.io.PrintWriter; 20 | import java.io.StringWriter; 21 | import java.io.Writer; 22 | import java.util.Date; 23 | import java.util.HashMap; 24 | import java.util.Iterator; 25 | import java.util.Random; 26 | 27 | /** 28 | * @author Deven 29 | * 30 | * Licensed under the Apache License 2.0 license see: 31 | * http://www.apache.org/licenses/LICENSE-2.0 32 | */ 33 | public class AutoErrorReporter implements Thread.UncaughtExceptionHandler { 34 | 35 | private static final String TAG = AutoErrorReporter.class.getSimpleName(); 36 | private static final boolean DEBUGABLE = false; 37 | private static String DEFAULT_EMAIL_SUBJECT = "ACR: New Crash Report Generated"; 38 | 39 | private String[] recipients ; 40 | private boolean startAttempted = false; 41 | 42 | private String versionName; 43 | //private String buildNumber; 44 | private String packageName; 45 | private String filePath; 46 | private String phoneModel; 47 | private String androidVersion; 48 | private String board; 49 | private String brand; 50 | private String device; 51 | private String display; 52 | private String fingerPrint; 53 | private String host; 54 | private String id; 55 | private String manufacturer; 56 | private String model; 57 | private String product; 58 | private String tags; 59 | private long time; 60 | private String type; 61 | private String user; 62 | private HashMap customParameters = new HashMap(); 63 | 64 | private Thread.UncaughtExceptionHandler previousHandler; 65 | private static AutoErrorReporter sInstance; 66 | private Application application; 67 | 68 | private AutoErrorReporter(Application application){ 69 | this.application = application; 70 | } 71 | 72 | public static AutoErrorReporter get(Application application) { 73 | if (sInstance == null) 74 | sInstance = new AutoErrorReporter(application); 75 | return sInstance; 76 | } 77 | 78 | public void start() { 79 | if(startAttempted) { 80 | showLog("Already started"); 81 | return; 82 | } 83 | previousHandler = Thread.getDefaultUncaughtExceptionHandler(); 84 | Thread.setDefaultUncaughtExceptionHandler(this); 85 | 86 | startAttempted = true; 87 | } 88 | 89 | /** 90 | * (Required) Defines one or more email addresses to send bug reports to. This method MUST be 91 | * called before calling start This method CANNOT be called after calling 92 | * start. 93 | * 94 | * @param emailAddresses one or more email addresses 95 | * @return the current AutoErrorReporterinstance (to allow for method chaining) 96 | */ 97 | 98 | public AutoErrorReporter setEmailAddresses(final String... emailAddresses) { 99 | if (startAttempted) { 100 | throw new IllegalStateException( 101 | "EmailAddresses must be set before start"); 102 | } 103 | this.recipients = emailAddresses; 104 | return this; 105 | } 106 | 107 | /** 108 | * (Optional) Defines a custom subject line to use for all bug reports. By default, reports will 109 | * use the string defined in DEFAULT_EMAIL_SUBJECT This method CANNOT be called 110 | * after calling start. 111 | * @param emailSubject custom email subject line 112 | * @return the current AutoErrorReporter instance (to allow for method chaining) 113 | */ 114 | public AutoErrorReporter setEmailSubject(final String emailSubject) { 115 | if (startAttempted) { 116 | throw new IllegalStateException("EmailSubject must be set before start"); 117 | } 118 | 119 | DEFAULT_EMAIL_SUBJECT = emailSubject; 120 | return this; 121 | } 122 | 123 | public void addCustomData(String Key, String Value) { 124 | customParameters.put(Key, Value); 125 | } 126 | 127 | private String createCustomInfoString() { 128 | String customInfo = ""; 129 | for (Object currentKey : customParameters.keySet()) { 130 | String currentVal = customParameters.get(currentKey); 131 | customInfo += currentKey + " = " + currentVal + "\n"; 132 | } 133 | return customInfo; 134 | } 135 | 136 | private long getAvailableInternalMemorySize() { 137 | File path = Environment.getDataDirectory(); 138 | StatFs stat = new StatFs(path.getPath()); 139 | long blockSize = stat.getBlockSize(); 140 | long availableBlocks = stat.getAvailableBlocks(); 141 | return (availableBlocks * blockSize)/(1024*1024); 142 | } 143 | 144 | private long getTotalInternalMemorySize() { 145 | File path = Environment.getDataDirectory(); 146 | StatFs stat = new StatFs(path.getPath()); 147 | long blockSize = stat.getBlockSize(); 148 | long totalBlocks = stat.getBlockCount(); 149 | return (totalBlocks * blockSize)/(1024*1024); 150 | } 151 | 152 | private void recordInformations(Context context) { 153 | try { 154 | PackageManager pm = context.getPackageManager(); 155 | PackageInfo pi; 156 | // Version 157 | pi = pm.getPackageInfo(context.getPackageName(), 0); 158 | versionName = pi.versionName; 159 | //buildNumber = currentVersionNumber(context); 160 | // Package name 161 | packageName = pi.packageName; 162 | 163 | // Device model 164 | phoneModel = Build.MODEL; 165 | // Android version 166 | androidVersion = Build.VERSION.RELEASE; 167 | 168 | board = Build.BOARD; 169 | brand = Build.BRAND; 170 | device = Build.DEVICE; 171 | display = Build.DISPLAY; 172 | fingerPrint = Build.FINGERPRINT; 173 | host = Build.HOST; 174 | id = Build.ID; 175 | model = Build.MODEL; 176 | product = Build.PRODUCT; 177 | manufacturer = Build.MANUFACTURER; 178 | tags = Build.TAGS; 179 | time = Build.TIME; 180 | type = Build.TYPE; 181 | user = Build.USER; 182 | 183 | } catch (Exception e) { 184 | e.printStackTrace(); 185 | } 186 | } 187 | 188 | private String createInformationString() { 189 | recordInformations(application); 190 | StringBuilder infoStringBuffer = new StringBuilder(); 191 | infoStringBuffer.append("\nVERSION : ").append(versionName); 192 | infoStringBuffer.append("\nPACKAGE : ").append(packageName); 193 | infoStringBuffer.append("\nFILE-PATH : ").append(filePath); 194 | infoStringBuffer.append("\nPHONE-MODEL : ").append(phoneModel); 195 | infoStringBuffer.append("\nANDROID_VERS : ").append(androidVersion); 196 | infoStringBuffer.append("\nBOARD : ").append(board); 197 | infoStringBuffer.append("\nBRAND : ").append(brand); 198 | infoStringBuffer.append("\nDEVICE : ").append(device); 199 | infoStringBuffer.append("\nDISPLAY : ").append(display); 200 | infoStringBuffer.append("\nFINGER-PRINT : ").append(fingerPrint); 201 | infoStringBuffer.append("\nHOST : ").append(host); 202 | infoStringBuffer.append("\nID : ").append(id); 203 | infoStringBuffer.append("\nMODEL : ").append(model); 204 | infoStringBuffer.append("\nPRODUCT : ").append(product); 205 | infoStringBuffer.append("\nMANUFACTURER : ").append(manufacturer); 206 | infoStringBuffer.append("\nTAGS : ").append(tags); 207 | infoStringBuffer.append("\nTIME : ").append(time); 208 | infoStringBuffer.append("\nTYPE : ").append(type); 209 | infoStringBuffer.append("\nUSER : ").append(user); 210 | infoStringBuffer.append("\nTOTAL-INTERNAL-MEMORY : ").append(getTotalInternalMemorySize()+" mb"); 211 | infoStringBuffer.append("\nAVAILABLE-INTERNAL-MEMORY : ").append(getAvailableInternalMemorySize()+" mb"); 212 | 213 | return infoStringBuffer.toString(); 214 | } 215 | 216 | public void uncaughtException(Thread t, Throwable e) { 217 | showLog("====uncaughtException"); 218 | 219 | StringBuilder reportStringBuffer = new StringBuilder(); 220 | reportStringBuffer.append("Error Report collected on : ").append(new Date().toString()); 221 | reportStringBuffer.append("\n\nInformations :\n=============="); 222 | reportStringBuffer.append(createInformationString()); 223 | String customInfo = createCustomInfoString(); 224 | if(!customInfo.equals("")) { 225 | reportStringBuffer.append("\n\nCustom Informations :\n==============\n"); 226 | reportStringBuffer.append(customInfo); 227 | } 228 | 229 | reportStringBuffer.append("\n\nStack :\n==============\n"); 230 | final Writer result = new StringWriter(); 231 | final PrintWriter printWriter = new PrintWriter(result); 232 | e.printStackTrace(printWriter); 233 | reportStringBuffer.append(result.toString()); 234 | 235 | reportStringBuffer.append("\nCause :\n=============="); 236 | // If the exception was thrown in a background thread inside 237 | // AsyncTask, then the actual exception can be found with getCause 238 | Throwable cause = e.getCause(); 239 | while (cause != null) { 240 | cause.printStackTrace(printWriter); 241 | reportStringBuffer.append(result.toString()); 242 | cause = cause.getCause(); 243 | } 244 | printWriter.close(); 245 | reportStringBuffer.append("\n\n**** End of current Report ***"); 246 | showLog("====uncaughtException \n Report: "+reportStringBuffer.toString()); 247 | saveAsFile(reportStringBuffer.toString()); 248 | 249 | Intent intent = new Intent(application, ErrorReporterActivity.class); 250 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 251 | application.startActivity(intent); 252 | 253 | //previousHandler.uncaughtException(t, e); 254 | 255 | android.os.Process.killProcess(android.os.Process.myPid()); 256 | System.exit(10); 257 | } 258 | 259 | 260 | 261 | private void sendErrorMail(Context _context, String errorContent) { 262 | showLog("====sendErrorMail"); 263 | Intent sendIntent = new Intent(Intent.ACTION_SEND); 264 | String subject = DEFAULT_EMAIL_SUBJECT; 265 | String body = "\n\n" + errorContent + "\n\n"; 266 | sendIntent.putExtra(Intent.EXTRA_EMAIL, recipients); 267 | sendIntent.putExtra(Intent.EXTRA_TEXT, body); 268 | sendIntent.putExtra(Intent.EXTRA_SUBJECT, subject); 269 | sendIntent.setType("message/rfc822"); 270 | //sendIntent.setType("text/html"); 271 | sendIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 272 | _context.startActivity(Intent.createChooser(sendIntent, "Title:")); 273 | } 274 | 275 | private void saveAsFile(String errorContent) { 276 | showLog("====SaveAsFile"); 277 | try { 278 | Random generator = new Random(); 279 | int random = generator.nextInt(99999); 280 | String FileName = "stack-" + random + ".stacktrace"; 281 | FileOutputStream trace = application.openFileOutput(FileName, 282 | Context.MODE_PRIVATE); 283 | trace.write(errorContent.getBytes()); 284 | trace.close(); 285 | } catch (Exception e) { 286 | // ... 287 | } 288 | } 289 | 290 | private String[] getErrorFileList() { 291 | File dir = new File(filePath + "/"); 292 | // Try to create the files folder if it doesn't exist 293 | dir.mkdir(); 294 | // Filter for ".stacktrace" files 295 | FilenameFilter filter = new FilenameFilter() { 296 | public boolean accept(File dir, String name) { 297 | return name.endsWith(".stacktrace"); 298 | } 299 | }; 300 | return dir.list(filter); 301 | } 302 | 303 | private boolean bIsThereAnyErrorFile() { 304 | return getErrorFileList().length > 0; 305 | } 306 | 307 | void checkErrorAndSendMail(Context _context) { 308 | try { 309 | filePath = _context.getFilesDir().getAbsolutePath(); 310 | if (bIsThereAnyErrorFile()) { 311 | StringBuilder wholeErrorTextSB = new StringBuilder(); 312 | 313 | String[] errorFileList = getErrorFileList(); 314 | int curIndex = 0; 315 | final int maxSendMail = 5; 316 | for (String curString : errorFileList) { 317 | if (curIndex++ <= maxSendMail) { 318 | wholeErrorTextSB.append("New Trace collected :\n=====================\n"); 319 | String filePathStr = filePath + "/" + curString; 320 | BufferedReader input = new BufferedReader( 321 | new FileReader(filePathStr)); 322 | String line; 323 | while ((line = input.readLine()) != null) { 324 | wholeErrorTextSB.append(line + "\n"); 325 | } 326 | input.close(); 327 | } 328 | 329 | // DELETE FILES !!!! 330 | File curFile = new File(filePath + "/" + curString); 331 | curFile.delete(); 332 | } 333 | sendErrorMail(_context, wholeErrorTextSB.toString()); 334 | } 335 | } catch (Exception e) { 336 | e.printStackTrace(); 337 | } 338 | } 339 | 340 | private void showLog(String msg){ 341 | if(DEBUGABLE) Log.i(TAG, msg); 342 | } 343 | 344 | } 345 | -------------------------------------------------------------------------------- /acr/src/main/java/com/devs/acr/ErrorReporterActivity.java: -------------------------------------------------------------------------------- 1 | package com.devs.acr; 2 | 3 | import android.app.Activity; 4 | import android.graphics.drawable.ColorDrawable; 5 | import android.os.Build; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.view.Window; 10 | import android.widget.TextView; 11 | 12 | /** 13 | * @author Deven 14 | * 15 | * Licensed under the Apache License 2.0 license see: 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | */ 18 | public class ErrorReporterActivity extends Activity implements View.OnClickListener{ 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_erroe_reporter); 24 | 25 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { 26 | this.setFinishOnTouchOutside(false); 27 | } 28 | Window window = getWindow(); 29 | window.setBackgroundDrawable(new ColorDrawable(0)); 30 | window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, 31 | ViewGroup.LayoutParams.WRAP_CONTENT); 32 | init(); 33 | } 34 | 35 | private void init() { 36 | TextView tvCancel = (TextView) findViewById(R.id.tv_cancel); 37 | tvCancel.setOnClickListener(this); 38 | TextView tvReport = (TextView) findViewById(R.id.tv_report); 39 | tvReport.setOnClickListener(this); 40 | } 41 | 42 | @Override 43 | public void onClick(View v) { 44 | int i = v.getId(); 45 | if (i == R.id.tv_cancel) { 46 | finish(); 47 | 48 | } 49 | else if (i == R.id.tv_report) { 50 | AutoErrorReporter.get(getApplication()).checkErrorAndSendMail(this); 51 | finish(); 52 | } 53 | } 54 | } 55 | 56 | 57 | -------------------------------------------------------------------------------- /acr/src/main/res/drawable-hdpi/ic_warning_black_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devendroid/AutoCrashReporter/c2bd613cbc090e7218a1876170eab9e6849faa43/acr/src/main/res/drawable-hdpi/ic_warning_black_36dp.png -------------------------------------------------------------------------------- /acr/src/main/res/drawable-xhdpi/ic_warning_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devendroid/AutoCrashReporter/c2bd613cbc090e7218a1876170eab9e6849faa43/acr/src/main/res/drawable-xhdpi/ic_warning_black_48dp.png -------------------------------------------------------------------------------- /acr/src/main/res/layout/activity_erroe_reporter.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 14 | 15 | 20 | 21 | 35 | 36 | 45 | 46 | 47 | 48 | 49 | 55 | 56 | 67 | 68 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /acr/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ACR 3 | 4 | -------------------------------------------------------------------------------- /acr/src/test/java/com/devs/acr/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.devs.acr; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.3" 6 | defaultConfig { 7 | applicationId "crashreporter.devs.com.myapplication" 8 | minSdkVersion 15 9 | targetSdkVersion 23 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:23.4.0' 28 | testCompile 'junit:junit:4.12' 29 | 30 | // compile project(":acr") 31 | compile 'com.devs:acr:1.0.1' 32 | } 33 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/devendramac/Android-SDK-AS/SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/crashreporter/devs/com/myapplication/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package crashreporter.devs.com.myapplication; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("crashreporter.devs.com.myapplication", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/crashreporter/devs/com/myapplication/MainActivity.java: -------------------------------------------------------------------------------- 1 | package crashreporter.devs.com.myapplication; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.Button; 7 | 8 | public class MainActivity extends AppCompatActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_main); 14 | 15 | ((Button)findViewById(R.id.btn_crash)).setOnClickListener(new View.OnClickListener() { 16 | @Override 17 | public void onClick(View v) { 18 | String s = null; 19 | s.length(); 20 | } 21 | }); 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/crashreporter/devs/com/myapplication/MyApplication.java: -------------------------------------------------------------------------------- 1 | package crashreporter.devs.com.myapplication; 2 | 3 | import android.app.Application; 4 | import com.devs.acr.AutoErrorReporter; 5 | 6 | 7 | public class MyApplication extends Application { 8 | 9 | @Override 10 | public void onCreate() { 11 | super.onCreate(); 12 | 13 | AutoErrorReporter.get(this) 14 | .setEmailAddresses("developer@gmail.com") 15 | .setEmailSubject("Auto Crash Report") 16 | .start(); 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 17 | 18 | 19 |