{"id":20740959,"url":"https://github.com/rollbar/rollbar-android","last_synced_at":"2025-05-11T03:33:12.532Z","repository":{"id":9576545,"uuid":"11491140","full_name":"rollbar/rollbar-android","owner":"rollbar","description":"Rollbar for Android","archived":true,"fork":false,"pushed_at":"2021-07-06T19:42:19.000Z","size":527,"stargazers_count":42,"open_issues_count":1,"forks_count":16,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-05-08T00:06:13.791Z","etag":null,"topics":["android","error-handler","error-handling","error-monitoring","exception-handler","exceptions","rollbar","rollbar-android","stack-traces","uncaught-exceptions"],"latest_commit_sha":null,"homepage":"https://rollbar.com/docs/notifier/rollbar-android/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"C2FO/nools","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rollbar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-18T00:57:12.000Z","updated_at":"2025-03-21T18:58:17.000Z","dependencies_parsed_at":"2022-08-31T17:50:19.951Z","dependency_job_id":null,"html_url":"https://github.com/rollbar/rollbar-android","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollbar%2Frollbar-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollbar%2Frollbar-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollbar%2Frollbar-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollbar%2Frollbar-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollbar","download_url":"https://codeload.github.com/rollbar/rollbar-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514352,"owners_count":21920327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","error-handler","error-handling","error-monitoring","exception-handler","exceptions","rollbar","rollbar-android","stack-traces","uncaught-exceptions"],"created_at":"2024-11-17T06:31:44.090Z","updated_at":"2025-05-11T03:33:12.250Z","avatar_url":"https://github.com/rollbar.png","language":"Java","readme":"# Rollbar for Android\n\n\u003c!-- RemoveNext --\u003e\nJava library for reporting exceptions, errors, and log messages to [Rollbar](https://rollbar.com).\n\n## Deprecated\n\nThe library in this repo has been deprecated in favor of the universal library\n[here](https://github.com/rollbar/rollbar-java).\n\n## Setup ##\n\n### Maven\n\nInstall from Maven central:\n\n```\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.rollbar\u003c/groupId\u003e\n     \u003cartifactId\u003erollbar-android\u003c/artifactId\u003e\n     \u003cversion\u003e0.2.1\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nor\n\n```\ncompile 'com.rollbar:rollbar-android:0.2.1'\n```\n\n### Jar\n\nDownload [rollbar-android.jar](https://github.com/rollbar/rollbar-android/releases/latest) and place it in your Android project's `libs` directory.\n\nAdd the following line in your custom Application subclass's `onCreate()` to initialize Rollbar:\n\n```java\nRollbar.init(this, \"POST_CLIENT_ITEM_ACCESS_TOKEN\", \"production\");\n```\n\n\nMake sure your `AndroidManifest.xml` contains the `android.permission.INTERNET` permission.\n\n## Usage ##\n\nBy default the notifier will report all uncaught exceptions to Rollbar.\n\nTo report caught exceptions, call `reportException()`:\n\n```java\nRollbar.reportException(new Exception(\"Test exception\")); // default level is \"warning\"\n\ntry {\n    amount = Integer.parseInt(data);\n} except (NumberFormatException e) {\n    // Providing a description for this exception\n    Rollbar.reportException(e, \"critical\", \"Unexpected data from server\");\n}\n```\n\nTo report your own messages, call `reportMessage()`:\n\n```java\nRollbar.reportMessage(\"A test message\", \"debug\"); // default level is \"info\"\n```\n\n## Configuration reference ##\n\nThe following configuration methods are available:\n\n * **Rollbar.setPersonData(String id, String username, String email)**\n\n    Sets the properties of the current user (called a \"person\" in Rollbar parlance) to be sent along with every report.\n\n    Default: all `null`\n\n\n * **Rollbar.setReportUncaughtExceptions(boolean report)**\n\n    Sets whether or not to report uncaught exceptions to Rollbar.\n\n    Default: `true`\n\n\n * **Rollbar.setIncludeLogcat(boolean includeLogcat)**\n\n    Sets whether or not to include logcat output in reports to Rollbar.\n\n    Note: For devices with API level 15 and lower, you will need to include the `android.permission.READ_LOGS` permission in your app's `AndroidManifest.xml` for logcat collection to work.\n\n    Default: `false`\n\n\n * **Rollbar.setDefaultCaughtExceptionLevel(String level)**\n\n    Sets the level caught exceptions are reported as by default.\n\n    Default: `\"warning\"`\n\n\n * **Rollbar.setUncaughtExceptionLevel(String level)**\n\n    Sets the level uncaught exceptions are reported as.\n\n    Default: `\"error\"`\n\n\n * **Rollbar.setSendOnUncaughtException(boolean send)**\n\n    If true, uncaught exceptions will immediately be sent to Rollbar, blocking the process shutdown sequence. If false, the exception will just be saved to disk so that it can be sent next time the process starts.\n\n    Default: `false`\n\n\n * **Rollbar.setEndpoint(String endpoint)**\n\n    If you are using Rollbar Enterprise, call `setEndpoint` to route events to your Rollbar instance. (Most users will not need to do this.)\n\n    Default: `\"https://api.rollbar.com/api/1/items/\"`\n\n* **Rollbar.setItemScheduleDelay(int delay)**\n\n    Sets the delay between retries of sending failed items, in seconds.\n\n    Default: `30`\n\n\n\n## Deobfuscation ##\n\nIf you use [ProGuard](http://developer.android.com/tools/help/proguard.html) to obfuscate your code in production, reported stack traces will not be very useful in most cases.\n\nRollbar provides a way for you to upload the `mapping.txt` file generated in the obfuscation process so that stack traces can be deobfuscated as they are reported.\n\nHere is an example cURL command to upload a `mapping.txt` file:\n\n```bash\ncurl 'https://api.rollbar.com/api/1/proguard' \\\n  -F access_token=POST_SERVER_ITEM_ACCESS_TOKEN \\\n  -F version=0.0.10 \\\n  -F mapping=@path/to/mapping.txt\n```\n\nWhere `version` matches the `android:versionName` in your app's `AndroidManifest.xml`, corresponding to the version the `mapping.txt` was generated for.\n\nAfter uploading, any future reported exceptions for the specified version will automatically be deobfuscated using the mapping file.\n\nBy default, file names and line numbers are removed by ProGuard. To preserve this information to make debugging easier, add the following to your `proguard-project.txt`:\n\n```\n-keepattributes SourceFile,LineNumberTable\n```\n\n## Help / Support\n\nIf you run into any issues, please email us at `support@rollbar.com`\n\n## Build\n\n1. Define property `sdk.dir` which contains path to Android SDK inside `local.properties`\n2. Make sure you have installed the platform specified in `project.properties`\n  - E.g. `sdk.dir = /Users/coryvirok/Development/adt-bundle-mac-x86_64-20140702/sdk/`\n3. Run `ant` from command line\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollbar%2Frollbar-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollbar%2Frollbar-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollbar%2Frollbar-android/lists"}