{"id":28544208,"url":"https://github.com/bitly/bitly_android_sdk_release","last_synced_at":"2026-02-09T11:03:39.296Z","repository":{"id":137883610,"uuid":"395427349","full_name":"bitly/bitly_android_sdk_release","owner":"bitly","description":"Bitly SDK for Android","archived":false,"fork":false,"pushed_at":"2021-09-30T20:33:47.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-08-01T19:52:51.056Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-12T19:45:05.000Z","updated_at":"2021-09-30T20:33:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"8138489f-731c-4940-8085-4b0dba8a604a","html_url":"https://github.com/bitly/bitly_android_sdk_release","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bitly/bitly_android_sdk_release","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitly%2Fbitly_android_sdk_release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitly%2Fbitly_android_sdk_release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitly%2Fbitly_android_sdk_release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitly%2Fbitly_android_sdk_release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitly","download_url":"https://codeload.github.com/bitly/bitly_android_sdk_release/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitly%2Fbitly_android_sdk_release/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29262861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-06-09T22:07:03.454Z","updated_at":"2026-02-09T11:03:38.255Z","avatar_url":"https://github.com/bitly.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitly Android SDK\n\n## Getting Started\nBefore integrating the SDK you will need to configure your mobile app in Bitly. To do this go to Brand Manager -\u003e Mobile Apps. When creating the Android app you will need to provide the `sha256_cert_fingerprints` for your app. You can determine the value using this command\n                                                                                                                                                                                                                                   \n```\nkeytool -list -v -keystore my-release-key.keystore\n```\n\nOnce the app is created the app ID required later will be available on the app detail panel.  Copy it for later in the setup.\n\nTo create the Digital Asset Links JSON file, which would be located at https://yourdomain.com/.well-known/assetlinks.json, you must got to Branded Short Domains -\u003e yourdomain.com -\u003e Mobile Behavior and associate the newly created Android App with your domain. After saving the changes you can validate the file exists. \n\n## Install the SDK\n1. Add the following to your `build.gradle` file\n\n  ```\n  implementation 'com.bitly:bitlysdk:1.0.x'\n  ```\n2. You may need to also add GitHub as a repository\n\n  ```\n  repositories {\n     maven {\n        url \"https://maven.pkg.github.com/bitly/bitly_android_sdk_release\"\n        credentials{\n            username = project.findProperty(\"gpr.user\") ?: System.getenv(\"GH_USERNAME\")\n            password = project.findProperty(\"gpr.key\") ?: System.getenv(\"GH_TOKEN\")\n        }\n    }\n  }\n  ```  \n\n## Configure the App Links\n\n1. Create an Activity to handle the App Links\n2. Configure the Activity in your AndroidManifest.xml to receive the App Links\n\n    ```xml\n    \u003cactivity android:name=”MainActivity”\u003e\n        \u003cintent-filter android:autoVerify=\"true\"\u003e\n            \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n            \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n            \u003ccategory android:name=\"android.intent.category.BROWSABLE\" /\u003e\n            \u003cdata android:scheme=\"http\" android:host=\"yourdomain.com\" /\u003e\n            \u003cdata android:scheme=\"https\" android:host=\"yourdomain.com\" /\u003e\n        \u003c/intent-filter\u003e\n        \u003cintent-filter\u003e\n            \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n            \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n            \u003ccategory android:name=\"android.intent.category.BROWSABLE\" /\u003e\n            \u003cdata android:scheme=\"yourscheme\" android:host=\"*\" /\u003e\n        \u003c/intent-filter\u003e\n    \u003c/activity\u003e\n    ```\n\n    \u003eYou cannot combine your launch activity and your App Links activity. These must be two separate activities.    \n\n3. Multiple `\u003cintent-filter\u003e` can be created to support multiple domains\n\n## Configure the SDK for App Links\n\n1. If your application doesn't already have a custom Application class, create it and configure it in the AndroidManifest.xml\n2. Import the SDK in your Application instance\n\n    ```java\n    import com.bitly.Bitly;\n    ```\n3. Initialize the SDK on Application creation\n\n    ```java\n    @Override\n    public void onCreate() {\n        super.onCreate();\n\n        Bitly.initialize(this, \"YOUR_APP_ID\", Arrays.asList(\"yourdomain.com\",\"yourotherdomain.com\"), Arrays.asList(\"yourscheme\"), new Bitly.Callback() {\n            @Override\n            public void onResponse(Response response) {\n                // response provides a Response object which contains the full URL information\n                // response includes a status code\n                // Your custom logic goes here...\n            }\n\n            @Override\n            public void onError(Error error) {\n                // error provides any errors in retrieving information about the URL\n                // Your custom logic goes here...\n            }\n        });\n    }\n    ```\n    \n    \u003e You can also provide the access token for shortening in the same initialize method\n\n4. Import the SDK in your Activity for handling App Links\n\n    ```java\n    import com.bitly.Bitly;\n    ```\n\n5. Handle the first intent\n\n    ```java\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        //Handle the intent creating the activity\n        Bitly.handleIntent(getIntent());\n    }\n    ```   \n\n6. Handle any additional intents after activity creation\n\n    ```java\n    @Override\n    protected void onNewIntent(Intent intent) {\n        super.onNewIntent(intent);\n        Bitly.handleIntent(intent);\n    }\n    ```\n\n    \u003eIf the activity is specified as having an `android:launchMode` that only allows for the creation of a single instance (\"singleTop\", etc) then handling intents in `protected void onNewIntent(Intent intent)` is necessary\n\n7. Retry on error\n\n    ```java\n    Bitly.retryError(error)\n    ```\n\n    \u003eIf there are any issues in handling an App Link the operation can be retried using the following line of code in your response handler from step 2\n\n## Configure the SDK for Shortening\n\n1. Configure an OAUTH token for your app http://bitly.com/a/oauth_apps\n2. If your application doesn't already have a custom Application class, create it and configure it in the AndroidManifest.xml\n3. Import the SDK in your Application instance\n\n    ```java\n    import com.bitly.Bitly;\n    ```\n4. Initialize the SDK on Application creation\n\n    ```java\n    @Override\n    public void onCreate() {\n        super.onCreate();\n\n        Bitly.initialize(this, \"YOUR_APP_ACCESS_TOKEN\");\n    }\n    ```\n    \n    \u003e You can combine this initialization with the App Link initialization\n\n5. You can shorten from anywhere in your application\n\n    ```java\n    Bitly.shorten(\"http://theurlyouwishtoshorten.com\", new Bitly.Callback() {\n        @Override\n        public void onResponse(Response response) {\n            // response provides a Response object which contains the shortened Bitlink\n            // response includes a status code\n            // Your custom logic goes here...\n        }\n\n        @Override\n        public void onError(Error error) {\n            // error provides any errors in shortening the link\n            // Your custom logic goes here...\n        }\n    });\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitly%2Fbitly_android_sdk_release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitly%2Fbitly_android_sdk_release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitly%2Fbitly_android_sdk_release/lists"}