{"id":28604035,"url":"https://github.com/uber/rides-android-sdk","last_synced_at":"2025-06-11T17:40:22.890Z","repository":{"id":47670401,"uuid":"46449357","full_name":"uber/rides-android-sdk","owner":"uber","description":"Uber Rides Android SDK (beta)","archived":false,"fork":false,"pushed_at":"2024-05-03T16:56:58.000Z","size":1050,"stargazers_count":288,"open_issues_count":46,"forks_count":126,"subscribers_count":2447,"default_branch":"main","last_synced_at":"2024-05-09T07:59:22.288Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://developer.uber.com/docs","language":"Java","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/uber.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2015-11-18T21:43:03.000Z","updated_at":"2024-05-29T21:46:46.940Z","dependencies_parsed_at":"2022-09-10T23:41:42.422Z","dependency_job_id":"9ac815ad-3b54-4d83-ad4b-cc87c1f31e6a","html_url":"https://github.com/uber/rides-android-sdk","commit_stats":{"total_commits":190,"total_committers":19,"mean_commits":10.0,"dds":0.5684210526315789,"last_synced_commit":"03e2c4ac61463eed051d5927036779d9f24e36c6"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/uber/rides-android-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Frides-android-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Frides-android-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Frides-android-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Frides-android-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uber","download_url":"https://codeload.github.com/uber/rides-android-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Frides-android-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259308163,"owners_count":22837974,"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":[],"created_at":"2025-06-11T17:40:12.035Z","updated_at":"2025-06-11T17:40:22.875Z","avatar_url":"https://github.com/uber.png","language":"Java","readme":"# Uber Rides Android SDK (beta) ![Build Status](https://github.com/uber/rides-android-sdk/workflows/CI/badge.svg)\n\nOfficial Android SDK to support:\n - Ride Request Button\n - Ride Request Deeplinks\n - Uber Authentication\n - REST APIs\n\nAt a minimum, this SDK is designed to work with Android SDK 15.\n\n## Before you begin\n\nBefore using this SDK, register your application on the [Uber Developer Site](https://developer.uber.com/).\n\n## Installation\n\nTo use the Uber Rides Android SDK, add the compile dependency with the latest version of the Uber SDK.\n\n### Gradle\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.uber.sdk/rides-android.svg)](https://mvnrepository.com/artifact/com.uber.sdk/rides-android)\n\n```gradle\ndependencies {\n    compile 'com.uber.sdk:rides-android:x.y.z'\n}\n```\n\n## SDK Configuration\n\nIn order for the SDK to function correctly, you need to add some information about your app. In your application, create a `SessionConfiguration` to use with the various components of the library. If you prefer the set it and forget it model, use the `UberSdk` class to initialize with a default `SessionConfiguration`.\n\n```java\nSessionConfiguration config = new SessionConfiguration.Builder()\n    .setClientId(\"YOUR_CLIENT_ID\") //This is necessary\n    .setRedirectUri(\"YOUR_REDIRECT_URI\") //This is necessary if you'll be using implicit grant\n    .setEnvironment(Environment.SANDBOX) //Useful for testing your app in the sandbox environment\n    .setScopes(Arrays.asList(Scope.PROFILE, Scope.RIDE_WIDGETS)) //Your scopes for authentication here\n    .build();\n```\n## Ride Request Deeplink\nThe Ride Request Deeplink provides an easy to use method to provide ride functionality against\nthe install Uber app or the mobile web experience.\n\n\nWithout any extra configuration, the `RideRequestDeeplink` will deeplink to the Uber app. We\nsuggest passing additional parameters to make the Uber experience even more seamless for your users. For example, dropoff location parameters can be used to automatically pass the user’s destination information over to the driver:\n\n```java\nRideParameters rideParams = new RideParameters.Builder()\n  .setProductId(\"a1111c8c-c720-46c3-8534-2fcdd730040d\")\n  .setPickupLocation(37.775304, -122.417522, \"Uber HQ\", \"1455 Market Street, San Francisco\")\n  .setDropoffLocation(37.795079, -122.4397805, \"Embarcadero\", \"One Embarcadero Center, San Francisco\")\n  .build();\nrequestButton.setRideParameters(rideParams);\n```\n\nAfter configuring the Ride Parameters, pass them into the `RideRequestDeeplink` builder object to\n construct and execute the deeplink.\n\n```java\nRideRequestDeeplink deeplink = new RideRequestDeeplink.Builder(context)\n                        .setSessionConfiguration(config))\n                        .setRideParameters(rideParameters)\n                        .build();\n                deeplink.execute();\n\n```\n\n### Deeplink Fallbacks\nThe Ride Request Deeplink will prefer to use deferred deeplinking by default, where the user is\ntaken to the Play Store to download the app, and then continue the deeplink behavior in the app\nafter installation. However, an alternate fallback may be used to prefer the mobile web\nexperience instead.\n\nTo prefer mobile web over an app installation, set the fallback on the builder:\n\n```java\nRideRequestDeeplink deeplink = new RideRequestDeeplink.Builder(context)\n                        .setSessionConfiguration(config)\n                        .setFallback(Deeplink.Fallback.MOBILE_WEB)\n                        .setRideParameters(rideParameters)\n                        .build();\n                deeplink.execute();\n\n```\n\n\n## Ride Request Button\n\nThe `RideRequestButton` offers the quickest ways to integrate Uber into your application. You can add a Ride Request Button to your View like you would any other View:\n```java\nRideRequestButton requestButton = new RideRequestButton(context);\nlayout.addView(requestButton);\n```\nThis will create a request button with deeplinking behavior, with the pickup pin set to the user’s current location. The user will need to select a product and input additional information when they are switched over to the Uber application.\n\nYou can also add your button through XML:\n```xml\n\u003cLinearLayout\n   xmlns:android=\"http://schemas.android.com/apk/res/android\"\n   xmlns:uber=\"http://schemas.android.com/apk/res-auto\"\n   android:layout_width=\"match_parent\"\n   android:layout_height=\"match_parent\"\u003e\n\n   \u003ccom.uber.sdk.android.rides.RideRequestButton\n      android:layout_width=\"wrap_content\"\n      android:layout_height=\"wrap_content\"\n      uber:ub__style=\"black\"/\u003e\n\u003c/LinearLayout\u003e\n```\n\nTo use the `uber` XML namespace, be sure to add `xmlns:uber=\"http://schemas.android.com/apk/res-auto\"` to your root view element.\n\n### Customization\n\nThe default color has a black background with white text:\n```xml\n\u003ccom.uber.sdk.android.rides.RideRequestButton\n      android:layout_width=\"wrap_content\"\n      android:layout_height=\"wrap_content\"/\u003e\n```\nFor a button with a white background and black text:\n```xml\n\u003ccom.uber.sdk.android.rides.RideRequestButton\n      android:layout_width=\"wrap_content\"\n      android:layout_height=\"wrap_content\"\n      uber:ub__style=\"white\"/\u003e\n```\n\nTo specify the mobile web deeplink fallback over app installation when using the\n`RideRequestButton`:\n\n```java\nrideRequestButton.setDeeplinkFallback(Deeplink.Fallback.MOBILE_WEB);\n```\n\n\nWith all the necessary parameters set, pressing the button will seamlessly prompt a ride request confirmation screen.\n\n## Ride Request Button with ETA and price\nTo further enhance the button with destination and price information, add a Session to it and call `loadRideInformation()` function.\n\n```java\n\nRideParameters rideParams = new RideParameters.Builder()\n  .setPickupLocation(37.775304, -122.417522, \"Uber HQ\", \"1455 Market Street, San Francisco\")\n  .setDropoffLocation(37.795079, -122.4397805, \"Embarcadero\", \"One Embarcadero Center, San Francisco\") // Price estimate will only be provided if this is provided.\n  .setProductId(\"a1111c8c-c720-46c3-8534-2fcdd730040d\") // Optional. If not provided, the cheapest product will be used.\n  .build();\n\nSessionConfiguration config = new SessionConfiguration.Builder()\n  .setClientId(\"YOUR_CLIENT_ID\")\n  .setServerToken(\"YOUR_SERVER_TOKEN\")\n  .build();\nServerTokenSession session = new ServerTokenSession(config);\n\nRideRequestButtonCallback callback = new RideRequestButtonCallback() {\n\n    @Override\n    public void onRideInformationLoaded() {\n\n    }\n\n    @Override\n    public void onError(ApiError apiError) {\n\n    }\n\n    @Override\n    public void onError(Throwable throwable) {\n\n    }\n};\n\nrequestButton.setRideParameters(rideParams);\nrequestButton.setSession(session);\nrequestButton.setCallback(callback);\nrequestButton.loadRideInformation();\n```\n\n## Custom Integration\nIf you want to provide a more custom experience in your app, there are a few classes to familiarize yourself with. Read the sections below and you'll be requesting rides in no time!\n\n### Login\n[Integration guide](https://github.com/uber/rides-android-sdk/tree/main/authentication) - Integrating a new client using Uber android authentication sdk\\\n[Migration guide](https://github.com/uber/rides-android-sdk/blob/2.x/MIGRATION.md) - Upgrading an old integration (using version 0.10.X and below) to the new authentication sdk (version 2.X and above)\n\n## Making an API Request\nThe Android Uber SDK uses a dependency on the Java Uber SDK for API requests.\nAfter authentication is complete, create a `Session` to use the Uber API.\n\n```java\nSession session = loginManager.getSession();\n```\n\nNow create an instance of the `RidesService` using the `Session`\n\n```java\nRidesService service = UberRidesApi.with(session).createService();\n```\n\n### Sync vs. Async Calls\nBoth synchronous and asynchronous calls work with the [Uber Rides Java SDK](https://github.com/uber/rides-java-sdk). The networking stack for the Uber SDK is powered by [Retrofit 2](https://github.com/square/retrofit) and the same model of threading is available.\n\n#### Sync\n```java\nResponse\u003cUserProfile\u003e response = service.getUserProfile().execute();\nif (response.isSuccessful()) {\n    //Success\n    UserProfile profile = response.body();\n} else {\n    //Failure\n    ApiError error = ErrorParser.parseError(response);\n}\n\n```\n\n#### Async\n```java\nservice.getUserProfile().enqueue(new Callback\u003cUserProfile\u003e() {\n    @Override\n    public void onResponse(Call\u003cUserProfile\u003e call, Response\u003cUserProfile\u003e response) {\n        if (response.isSuccessful()) {\n            //Success\n            UserProfile profile = response.body();\n        } else {\n            //Api Failure\n            ApiError error = ErrorParser.parseError(response);\n        }\n    }\n\n    @Override\n    public void onFailure(Call\u003cUserProfile\u003e call, Throwable t) {\n        //Network Failure\n    }\n});\n```\n\n## Sample Apps\n\nSample apps can be found in the `samples` folder. Alternatively, you can also download a sample from the [releases page](https://github.com/uber/rides-android-sdk/releases).\n\nThe Sample apps require configuration parameters to interact with the Uber API, these include the client id, redirect uri, and server token. They are provided on the [Uber developer dashboard](https://developer.uber.com/dashboard).\n\nSpecify your configuration parameters in the sample's gradle.properties file, where examples can be found adhering to the format `UBER_CLIENT_ID=insert_your_client_id_here`. These are generated into the BuildConfig during compilation.\n\nFor a more idiomatic storage approach, define these in your home gradle.properties file to keep them out of the git repo.\n\n~/.gradle/gradle.properties\n```xml\nUBER_CLIENT_ID=insert_your_client_id_here\nUBER_REDIRECT_URI=insert_your_redirect_uri_here\nUBER_SERVER_TOKEN=insert_your_server_token_here\n```\n\nTo install the sample app from Android Studio, File \u003e New \u003e Import Project and select the extracted folder from the downloaded sample.\n\n## Getting help\n\nUber developers actively monitor the `uber-api` tag on StackOverflow. If you need help installing or using the library, you can ask a question there. Make sure to tag your question with `uber-api` and `android`!\n\nFor full documentation about our API, visit our Developer Site.\n\n## Contributing\n\nWe :heart: contributions. Found a bug or looking for a new feature? Open an issue and we'll\nrespond as fast as we can. Or, better yet, implement it yourself and open a pull request! We ask\nthat you open an issue to discuss feature development prior to undertaking the work and that you\ninclude tests to show the bug was fixed or the feature works as expected.\n\n## MIT Licensed\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuber%2Frides-android-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuber%2Frides-android-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuber%2Frides-android-sdk/lists"}