### startPackageInstallerSessionDetailsActivity Source: https://developer.android.com/reference/android/content/pm/LauncherApps Starts the package installer session details activity. ```APIDOC ## startPackageInstallerSessionDetailsActivity ### Description Starts the package installer session details activity. ### Method startPackageInstallerSessionDetailsActivity ``` -------------------------------- ### Install Specific NDK or CMake Versions Source: https://developer.android.com/tools/sdkmanager Examples demonstrating how to install a particular NDK version from a specific channel or a precise CMake version. ```bash sdkmanager --install "ndk;21.3.6528147" --channel=3 // Install the NDK from the canary channel (or below) ``` ```bash sdkmanager --install "cmake;10.24988404" // Install a specific version of CMake ``` -------------------------------- ### Start Split Installation Request (Java) Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Initiates a request to download and install split APKs for additional features or language resources. Returns a `Task` with the session ID. ```java public Task startInstall (SplitInstallRequest request) ``` -------------------------------- ### Example of Getting Activity Result Source: https://developer.android.com/reference/androidx/test/core/app/ActivityScenario Demonstrates how to launch an activity for a result and then assert on the result code after the activity finishes. ```java ActivityScenario scenario = ActivityScenario.launchActivityForResult(MyActivity.class); // Let's say MyActivity has a button that finishes itself. onView(withId(R.id.finish_button)).perform(click()); assertThat(scenario.getResult().getResultCode()).isEqualTo(Activity.RESULT_OK); ``` -------------------------------- ### Launch Android Studio for Platform on Linux Source: https://developer.android.com/studio/platform/install Execute this script from the terminal to start Android Studio for Platform after installation. ```bash /opt/android-studio-for-platform/bin/studio.sh ``` -------------------------------- ### Install SDK Packages from a File Source: https://developer.android.com/tools/sdkmanager This command installs packages listed in a specified text file. Each line in the `package_file` should contain an SDK-style path without quotes. ```bash sdkmanager --package_file=package_file [options] ``` -------------------------------- ### installation(action: Installation.() -> Unit) Source: https://developer.android.com/reference/tools/gradle-api/9.1/com/android/build/api/dsl/KotlinMultiplatformAndroidDeviceTest Specifies options for the Android Debug Bridge (ADB), such as APK installation options. ```APIDOC ## Function: installation(action: Installation.() -> Unit) ### Description Specifies options for the Android Debug Bridge (ADB), such as APK installation options. ### Signature `Unit installation(action: Installation.() -> Unit)` ### Parameters - **action** (`Installation.() -> Unit`) - A lambda to configure the `Installation` options. ``` -------------------------------- ### Start Confirmation Dialog with ActivityResultLauncher (Java) Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Initiates a user confirmation dialog for a split install session using an `ActivityResultLauncher`. This method is not implemented in `FakeSplitInstallManager`. ```java public boolean startConfirmationDialogForResult (SplitInstallSessionState sessionState, ActivityResultLauncher activityResultLauncher) ``` -------------------------------- ### start() Source: https://developer.android.com/reference/android/graphics/drawable/AnimatedImageDrawable Start the animation. ```APIDOC ## Method: `start()` ### Description Start the animation. ### Signature `void start()` ### Parameters (None) ### Returns `void` - This method does not return a value. ``` -------------------------------- ### abstract void start() Source: https://developer.android.com/reference/android/graphics/drawable/AnimatedImageDrawable Starts the drawable's animation. ```APIDOC ## start() ### Description Starts the drawable's animation. ### Method start ``` -------------------------------- ### Install Multiple Specific SDK Packages Source: https://developer.android.com/tools/sdkmanager Use this command to install multiple SDK packages by providing their SDK-style paths, each wrapped in quotes and separated by a space. ```bash sdkmanager "platform-tools" "platforms;android-36" ``` -------------------------------- ### Start Confirmation Dialog with Activity (Java) Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Initiates a user confirmation dialog for a split install session using an `Activity` and a request code. This method is not implemented in `FakeSplitInstallManager`. ```java public boolean startConfirmationDialogForResult (SplitInstallSessionState sessionState, Activity activity, int requestCode) ``` -------------------------------- ### Installation Interface Declaration Source: https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/Installation Declares the `Installation` interface, serving as a base for configuring adb installation options. ```kotlin interface Installation ``` -------------------------------- ### Install SDK Packages Source: https://developer.android.com/tools/sdkmanager This command installs specified SDK packages. The `packages` argument should be an SDK-style path, such as "build-tools;36.0.0", wrapped in quotes. ```bash sdkmanager packages [options] ``` -------------------------------- ### Accessing Install Options List Source: https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/Installation Retrieves the mutable list of strings representing FULL_APK installation options. ```kotlin val installOptions: MutableList ``` -------------------------------- ### Install a specific version of Android SDK Command-Line Tools Source: https://developer.android.com/tools/sdkmanager Use this command to install a previous or specific version of the Android SDK Command-Line Tools. Substitute `version` with the desired version number, for example `5.0`. For scripts, always choose a specific version to ensure stability. ```bash android_sdk/cmdline-tools/latest/bin/sdkmanager --install "cmdline-tools;version" ``` -------------------------------- ### List Installed and Available SDK Packages Source: https://developer.android.com/tools/sdkmanager Use this command to display a list of all installed and available SDK packages. The `--channel` option allows filtering packages by their release channel, from stable to canary. ```bash sdkmanager --list [options] \ [--channel=channel_id] // Channels: 0 (stable), 1 (beta), 2 (dev), or 3 (canary) ``` -------------------------------- ### Get the Semantic Value Type (Java) Source: https://developer.android.com/reference/androidx/wear/watchface/complications/data/RangedValueComplicationData Returns an integer representing the semantic meaning of the complication's value. This type can guide renderers in visually differentiating how the value is presented, for example, for `TYPE_RATING`. ```java public final int getValueType() ``` -------------------------------- ### startShortcut(String packageName, String shortcutId, Rect sourceBounds, Bundle startActivityOptions, UserHandle user) Source: https://developer.android.com/reference/android/content/pm/LauncherApps Starts a shortcut. ```APIDOC ## void startShortcut(String packageName, String shortcutId, Rect sourceBounds, Bundle startActivityOptions, UserHandle user) ### Description Starts a shortcut. ### Parameters - **packageName** (String) - **shortcutId** (String) - **sourceBounds** (Rect) - **startActivityOptions** (Bundle) - **user** (UserHandle) ### Returns void - This method does not return a value. ``` -------------------------------- ### fun installation(action: Installation.() -> Unit): Unit Source: https://developer.android.com/reference/tools/gradle-api/9.1/com/android/build/api/dsl/KotlinMultiplatformAndroidDeviceTest Specifies options for the Android Debug Bridge (ADB), such as APK installation options. For more information about the properties you can configure in this block, see `Installation`. ```APIDOC ## installation ### Description Specifies options for the Android Debug Bridge (ADB), such as APK installation options. For more information about the properties you can configure in this block, see `Installation`. ### Method fun ### Parameters #### Function Parameters - **action** (Installation.() -> Unit) - Required - A lambda that configures `Installation` options. ### Return Value Unit ``` -------------------------------- ### public Task startInstall (SplitInstallRequest request) Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Initiates a request to download and install split APKs for additional features or language resources. To learn more, read Request an on demand module or Download additional language resources. ```APIDOC ## startInstall ### Description Initiates a request to download and install split APKs for additional features or language resources. To learn more, read Request an on demand module or Download additional language resources. ### Method `public Task startInstall (SplitInstallRequest request)` ### Parameters #### Method Parameters - **request** (`SplitInstallRequest`) - the `SplitInstallRequest` you built for the install request ### Returns - `Task` - session id, which can be used to subsequently interact with the session after it is created. A session id of 0 indicates that the splits are already installed; in this case no session is generated. ``` -------------------------------- ### Get Split Install Session State Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Returns the current state of a specific split install session. Do not use this to determine if a module is installed; use getInstalledModules() instead. ```java public Task getSessionState (int sessionId) ``` -------------------------------- ### Migrating from Robolectric setupActivity to ActivityScenario.launch Source: https://developer.android.com/reference/androidx/test/core/app/ActivityScenario This example demonstrates how to replace Robolectric.setupActivity with ActivityScenario.launch for launching an activity and performing assertions on it. It highlights the use of onActivity for interacting with the launched activity. ```Java Before: MyActivity activity = Robolectric.setupActivity(MyActivity.class); assertThat(activity.getSomething()).isEqualTo("something"); After: try(ActivityScenario scenario = ActivityScenario.launch(MyActivity.class)) { scenario.onActivity(activity -> { assertThat(activity.getSomething()).isEqualTo("something"); }); } ``` -------------------------------- ### getTextStartIndex() Source: https://developer.android.com/reference/android/graphics/pdf/models/PageMatchBounds Gets the starting index of the match found on the page. ```APIDOC ## Method: getTextStartIndex() ### Description Gets the starting index of the match found on the page. ### Returns - **int** - The starting index of the match. ``` -------------------------------- ### Access Application Installation Options Source: https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/ApplicationInstallation This property provides a mutable list to specify full APK installation options. ```Kotlin val installOptions: MutableList ``` -------------------------------- ### Cancel a Pending Split Install Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Starts a request to cancel a pending split install. Cancellation requests are best-effort and can be monitored for the CANCELED state. ```java public Task cancelInstall (int sessionId) ``` -------------------------------- ### Installation Interface Properties Source: https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/Installation This section details the public properties available in the `Installation` interface for configuring adb installation settings. ```APIDOC ## Interface: Installation ### Description Local installation options for the adb tool. This interface is used to configure settings related to the installation process via adb. ### Properties #### `installOptions` - **Type**: `MutableList` - **Description**: The list of FULL_APK installation options. - **Added in**: 7.0.0 - **Code Example**: ``` val installOptions: MutableList ``` #### `timeOutInMs` - **Type**: `Int` - **Description**: The time out used for all adb operations. - **Added in**: 7.0.0 - **Code Example**: ``` var timeOutInMs: Int ``` ``` -------------------------------- ### startShortcut(ShortcutInfo shortcut, Rect sourceBounds, Bundle startActivityOptions) Source: https://developer.android.com/reference/android/content/pm/LauncherApps Launches a shortcut. ```APIDOC ## void startShortcut(ShortcutInfo shortcut, Rect sourceBounds, Bundle startActivityOptions) ### Description Launches a shortcut. ### Parameters - **shortcut** (ShortcutInfo) - **sourceBounds** (Rect) - **startActivityOptions** (Bundle) ### Returns void - This method does not return a value. ``` -------------------------------- ### Get Chunk Start Time in Java Source: https://developer.android.com/reference/androidx/media3/test/utils/FakeAdaptiveDataSet This snippet shows the declaration of the `getStartTime` method, which returns the start time of a specific chunk in microseconds. ```Java public long getStartTime(int chunkIndex) ``` -------------------------------- ### startInstall(SplitInstallRequest request) Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Initiates a request to download and install split APKs for additional features or language resources. ```APIDOC ## Task startInstall(SplitInstallRequest request) ### Description Initiates a request to download and install split APKs for additional features or language resources. ### Return Type Task ### Parameters - **request** (SplitInstallRequest) ``` -------------------------------- ### Configure ADB Installation Options (Kotlin) Source: https://developer.android.com/reference/tools/gradle-api/9.1/com/android/build/api/dsl/KotlinMultiplatformAndroidDeviceTest Provides options for Android Debug Bridge (ADB) configurations, including APK installation settings. See `Installation` for more details. ```kotlin val installation: Installation ``` -------------------------------- ### installation(action: DynamicFeatureInstallation.() -> Unit) Source: https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/DynamicFeatureExtension Specifies options for the Android Debug Bridge (ADB), such as APK installation options. ```APIDOC ## installation(action: DynamicFeatureInstallation.() -> Unit) ### Description Specifies options for the Android Debug Bridge (ADB), such as APK installation options. ### Method Signature `Unit installation(action: DynamicFeatureInstallation.() -> Unit)` ### Parameters - **action** (`DynamicFeatureInstallation.() -> Unit`) - Required - Configuration block for `DynamicFeatureInstallation`. ``` -------------------------------- ### getDrawingTime Source: https://developer.android.com/reference/kotlin/androidx/constraintlayout/widget/ConstraintLayout Gets the time elapsed since the view started drawing. ```APIDOC ## getDrawingTime ### Description Gets the time elapsed since the view started drawing. ### Returns * **Long** - The drawing time in milliseconds. ``` -------------------------------- ### startInstall(SplitInstallRequest request) Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Initiates a request to download and install split APKs for additional features or language resources. ```APIDOC ## startInstall ### Description Initiates a request to download and install split APKs for additional features or language resources. ### Signature ```java Task startInstall(SplitInstallRequest request) ``` ### Parameters - **request** (SplitInstallRequest) - The request to initiate the installation. ### Returns **Task** - A Task that provides the session ID of the initiated installation. ``` -------------------------------- ### Get Installed Modules Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Returns the set of modules currently considered installed by the fake manager, excluding the base module. Modules emulated by SplitCompat are included. ```java public Set getInstalledModules () ``` -------------------------------- ### cancelInstall(int sessionId) Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Starts a request to cancel a pending split install. ```APIDOC ## cancelInstall ### Description Starts a request to cancel a pending split install. ### Signature ```java Task cancelInstall(int sessionId) ``` ### Parameters - **sessionId** (int) - The ID of the session to cancel. ### Returns **Task** - A Task that completes when the cancellation request has been sent. ``` -------------------------------- ### cancelInstall(int sessionId) Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Starts a request to cancel a pending split install. ```APIDOC ## Task cancelInstall(int sessionId) ### Description Starts a request to cancel a pending split install. ### Return Type Task ### Parameters - **sessionId** (int) ``` -------------------------------- ### startSupportActionMode(callback: ActionMode.Callback) Source: https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatDelegate Start an action mode. ```APIDOC ## `startSupportActionMode(callback: ActionMode.Callback)` ### Description Start an action mode. ### Method Signature `abstract ActionMode? startSupportActionMode(callback: ActionMode.Callback)` ### Parameters - **callback** (ActionMode.Callback) - The callback to control the action mode. ### Return Value - **Type**: ActionMode? - **Description**: The started `ActionMode`, or `null` if it could not be started. ``` -------------------------------- ### Example: Configure Release Build Type Source: https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/LibraryExtension This example demonstrates how to access and configure the `release` build type within the `android` block of a Gradle build script. ```Gradle android { buildTypes { release { // ... } } } ``` -------------------------------- ### int onStartCommand(Intent intent, int flags, int startId) Source: https://developer.android.com/sdk/api_diff/b-dp1/changes/android.media.midi.MidiUmpDeviceService Callback for when a client explicitly starts the service, providing arguments and a unique start request token. ```APIDOC ## Method: int onStartCommand(Intent intent, int flags, int startId) ### Description Called by the system every time a client explicitly starts the service by calling `Context.startService(Intent)`, providing the arguments it supplied and a unique integer token representing the start request. ### Return Value - **Type**: int - **Description**: No explicit description provided. ### Parameters - **intent** (Intent) - No explicit description provided. - **flags** (int) - No explicit description provided. - **startId** (int) - No explicit description provided. ``` -------------------------------- ### build() Source: https://developer.android.com/reference/androidx/room3/RoomDatabase.Builder Creates the database and initializes it. ```APIDOC ## build() ### Description Creates the database and initializes it. ### Parameters - This method takes no parameters. ### Returns @NonNull T - The created database instance. ``` -------------------------------- ### Define LibraryInstallation Interface Source: https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/LibraryInstallation This snippet shows the interface definition for `LibraryInstallation`, which extends the `Installation` interface to provide specific installation options for Library plugins. ```kotlin interface LibraryInstallation : Installation ``` -------------------------------- ### Example: Drawing Multi-Styled Text in Compose Canvas Source: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary This example demonstrates how to draw text with different paragraph styles (start and end alignment) on a `Canvas` using `drawText` and `rememberTextMeasurer`. ```kotlin import androidx.compose.foundation.Canvas import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.text.ParagraphStyle import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.text.drawText import androidx.compose.ui.text.rememberTextMeasurer import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.withStyle val textMeasurer = rememberTextMeasurer() Canvas(Modifier.fillMaxSize()) { drawText( textMeasurer = textMeasurer, text = buildAnnotatedString { withStyle(ParagraphStyle(textAlign = TextAlign.Start)) { append("Hello") } withStyle(ParagraphStyle(textAlign = TextAlign.End)) { append("World") } }, ) } ``` -------------------------------- ### void onStart(Intent intent, int startId) Source: https://developer.android.com/sdk/api_diff/b-dp1/changes/android.media.midi.MidiUmpDeviceService Deprecated method for starting a service. Use `onStartCommand(Intent,int,int)` instead. ```APIDOC ## Method: void onStart(Intent intent, int startId) ### Description No explicit description provided. ### Return Value - **Type**: void - **Description**: No explicit description provided. ### Parameters - **intent** (Intent) - No explicit description provided. - **startId** (int) - No explicit description provided. ### Deprecation This method was deprecated in API level 15. Implement `onStartCommand(Intent,int,int)` instead. ``` -------------------------------- ### Verify KVM Installation Status on Linux Source: https://developer.android.com/studio/run/emulator-acceleration Runs the `kvm-ok` command to check if KVM is installed and can be used for acceleration. ```bash sudo kvm-ok ``` -------------------------------- ### Get All Package Installer Sessions Source: https://developer.android.com/reference/android/content/pm/LauncherApps Returns a list of all known install sessions for the current user and managed profiles. Callers need to declare a element, have `QUERY_ALL_PACKAGES` permission, or be the session owner. ```java public List getAllPackageInstallerSessions () ``` -------------------------------- ### Handle Activity Start with AppCompatDelegate (Kotlin) Source: https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatDelegate Call this method from `onStart` to allow AppCompat to perform start actions. ```kotlin abstract fun onStart(): Unit ``` -------------------------------- ### public void startActivities (Intent[] intents) Source: https://developer.android.com/reference/android/content/ContextWrapper Launches multiple new activities with no options specified, equivalent to `startActivities(Intent[],Bundle)` without the Bundle. ```APIDOC ## Method: public void startActivities (Intent[] intents) ### Description Same as `startActivities(Intent[],Bundle)` with no options specified. ### Method Signature public void startActivities (Intent[] intents) ### Parameters - **intents** (`Intent[]`) - An array of Intents to be started. ``` -------------------------------- ### Get Installed Languages Source: https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager Returns the set of languages currently considered installed by the fake manager, excluding the app's default language. This method may not work as expected when deploying from Android Studio or Gradle. ```java public Set getInstalledLanguages () ``` -------------------------------- ### Check Hypervisor Installation on macOS Source: https://developer.android.com/studio/run/emulator-acceleration Use this command to verify if Hypervisor.Framework is installed and usable on a macOS system for Android emulator acceleration. ```bash janedoe-macbookpro:Android janedoe$ ./Sdk/emulator/emulator -accel-check accel: 0 Hypervisor.Framework OS X Version 13.2 accel ``` -------------------------------- ### onStart() Source: https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatDelegate Should be called from `onStart` Activity.onStart()} ```APIDOC ## `onStart()` ### Description Should be called from `Activity.onStart()`. ### Method Signature `abstract Unit onStart()` ### Parameters (None) ### Return Value - **Type**: Unit - **Description**: This method does not return a value. ``` -------------------------------- ### Retrieve Instant from CountUpTimeReference in Java Source: https://developer.android.com/reference/androidx/wear/watchface/complications/data/CountUpTimeReference Call this method to get the `Instant` that defines the starting point for the count-up complication. ```java public final @NonNull Instant getInstant() ``` -------------------------------- ### Example Public Resource List Entry Format Source: https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/artifact/SingleArtifact.PUBLIC_ANDROID_RESOURCES_LIST This snippet shows an example line format for the public resources list file, specifying a resource type and its name. ```Plain Text string public_string ```