Getting Started with Pleos Connect App Development
This guide is a quick-start guide for developers who are new to Pleos Connect app development. You will create an Android Studio project, run the Pleos Connect Emulator, and call your first Vehicle SDK API.
Prerequisites
- Android Studio
- Android SDK API 34
- An Android project with
minSdkAPI 28 or higher - Pleos Connect Emulator system image
1. Create an Android project
Open Android Studio and select File > New > New Project.
- In Templates, select the Car or Automotive category. The category name may differ depending on your Android Studio version.
- Select Empty Activity from the available templates.
- Specify the project name and location.
- Select Kotlin as the language and set Minimum SDK to Android API 28 or higher.
- Click Finish to create the project.
Android Studio downloads the required dependencies and builds the project. After the project is created, first verify that the app module builds successfully.
2. Install and configure the Pleos Connect Emulator
- In Android Studio, go to Tools > SDK Manager > SDK Update Sites, then select Add.
- Add the Pleos Connect system image repository with the following information:
- Name:
Pleos Connect System Image - URL: The Pleos Connect Emulator download URL provided to you
- Name:
- In SDK Platforms, select and install the Pleos Connect system image for API 34, then restart Android Studio.
- In Tools > Device Manager > Create device, select Automotive and create a Pleos Connect device.
- In advanced AVD settings, set Boot option to Cold boot and RAM to 4 GB, then select the API 34 Pleos Connect system image and create the AVD.
- Start the created AVD from Device Manager.
For installation screenshots, version-specific menu differences, and detailed options, see Installing and Running Pleos Connect Emulator.
3. Import the Vehicle SDK
Register the Maven repository
Add the Pleos Maven repository to the project's settings.gradle.kts file.
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = uri("https://nexus-playground.pleos.ai/repository/maven-releases/")
}
}
}
Add the SDK dependency
Add the Vehicle SDK to the dependencies block in app/build.gradle.kts.
dependencies {
implementation("ai.pleos.playground:Vehicle:2.3.1")
}
Select Sync Now. If the dependency cannot be resolved, check Maven repository access and the SDK version. For details, see Importing Vehicle SDK.
4. Declare the vehicle permission
The example reads the current door position, so declare the CAR_DOORS permission in app/src/main/AndroidManifest.xml.
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="pleos.car.permission.CAR_DOORS" />
<application
...>
...
</application>
</manifest>
See Vehicle SDK permissions for the permission required by each API.
5. Make your first API call
Create a Vehicle object, connect it to the Vehicle service, obtain the domain object with getDoor(), and then call the door position API. This example shows only the Vehicle SDK API flow and SDK resource initialization/release (initialize(), release()); it does not include Android app lifecycle code (onCreate, onStart, onStop, onDestroy) or UI code.
val vehicle = Vehicle(context)
vehicle.initialize()
val door = vehicle.getDoor()
door.getCurrentDoorPosition(
area = DoorArea(DoorValue.ROW_1_LEFT),
onComplete = { pos: Int? ->
// Use the current door position.
},
onFailed = { e: Exception ->
// Handle the Vehicle SDK error.
}
)
// Do not call release() here.
// Call release() when the app no longer needs Vehicle SDK (for example, in onDestroy()).
onComplete and onFailed are asynchronous callbacks. Call vehicle.release() after callback processing is complete, or at an app lifecycle point where the SDK is no longer needed (for example, onDestroy).
6. Check on the emulator
- Make sure the Pleos Connect Emulator has finished booting.
- In Android Studio, select the Pleos Connect Emulator as the app run target device.
- Click Run to build and install the app.
- Verify that the app processes the current door position result.
If the value cannot be read, check the following:
minSdkis API 28 or higher.pleos.car.permission.CAR_DOORSis declared.- The SDK dependency was synchronized successfully.
- Launch the app only after the emulator has finished booting.
- Check the exception message passed to
onFailed.
Next steps
After confirming your first API call, continue with the following guides to design, develop, test, and distribute your app.
- Review the Pleos Connect app planning and design guide for vehicle app screens, in-drive usability, performance, and privacy requirements.
- Review the Pleos Connect app development guide for implementing vehicle app features.
- Use the Pleos Connect SDK and API documentation to select an SDK and find detailed API references.
- Review Vehicle SDK permissions, the Capability API, and the Get API for the permissions and APIs required by your app.
- Refer to the Vehicle SDK Sample App guide for detailed Vehicle SDK usage and API call flow.
- Follow the Pleos Connect Virtual Console user guide to test vehicle states and app integration.
- Follow the Pleos Connect app registration and distribution guide to review and submit your app to Pleos App Market.