SPB Git

Repository Public

aistudio-android.md 6.3 KB 134 lines markdown

1# Build Android Apps in Google AI Studio23Google AI Studio lets you build native Android apps from a natural language4prompt. Describe the app you want, and the5[Antigravity Agent](https://ai.google.dev/gemini-api/docs/aistudio-build-mode#antigravity-agent)6generates a complete Kotlin and [Jetpack Compose](https://developer.android.com/develop/ui/compose)7project. From your browser, you can preview your app in a browser-based Android emulator, install8it on a physical device, and publish it for testing.910> [!NOTE]11> **Note:** Android apps in AI Studio are client-side only. Features that require a server-side runtime, such as [Firebase integration](https://ai.google.dev/gemini-api/docs/aistudio-fullstack#firebase-integration), [Google Workspace APIs](https://ai.google.dev/gemini-api/docs/aistudio-fullstack#workspace), [secrets management](https://ai.google.dev/gemini-api/docs/aistudio-fullstack#secrets), and [multiplayer](https://ai.google.dev/gemini-api/docs/aistudio-fullstack#multiplayer), are available for web apps only.1213## Get started1415To start building an Android app:16171. Go to [Build mode](https://aistudio.google.com/apps) in Google AI Studio using the left-hand navigation panel.182. Select **Android** from the platform picker.193. Enter a prompt describing the app you want to build (for example, *"Create a daily task tracker with local storage"* or *"Build a simple calculator"*).204. The agent generates the project and launches it in the browser-based Android emulator.2122You can then iterate on your app using the chat panel, just like the web23experience. The agent manages all files in your Android project and propagates24changes across the codebase.2526## Browser-based Android emulator2728The Android emulator runs entirely in the cloud and streams to your browser.29You don't need to install the Android SDK, Android Studio, or a local emulator.3031The emulator provides:3233- **Pixel-like device simulation**: tap, scroll, and interact with your app just like on a real device.34- **Rotation support**: toggle between portrait and landscape orientation.35- **Live preview**: when the agent makes code changes, the app rebuilds and the emulator refreshes automatically.3637### Emulator limitations3839The browser-based emulator doesn't support all hardware features. The following40are not available in the emulator:4142- Camera and photo capture43- NFC and Bluetooth44- GPS (location is simulated)45- Google Play services (Google Sign-In, Maps, and other Play services features work on a real device but not in the emulator)4647## Install on a device with ADB4849You can install the built APK directly on a physical Android device connected50to your computer using USB. This uses51[WebUSB](https://developer.chrome.com/docs/capabilities/usb) to52communicate with your device through the browser. No local ADB installation53is required.5455### Prerequisites5657- A Chrome or Edge browser that supports WebUSB.58- An Android device with [Developer Options and USB Debugging](https://developer.android.com/studio/debug/dev-options) enabled.59- A USB cable connecting your device to your computer.6061### Install the app on your device62631. Click **Install on Device** in the preview panel.642. Select your Android device from the browser's USB device picker.653. The APK is transferred and installed on your device.664. The app launches automatically.6768> [!NOTE]69> **Note:** Your device may show an **"Allow USB debugging"** prompt the first time you connect. You must accept this to proceed.7071## Publish to the Play Store7273You can publish your Android app to the74[Google Play Console](https://play.google.com/console) internal75testing track, which lets you distribute the app to up to 100 testers.7677### Prerequisites7879- A [Google Play Developer account](https://play.google.com/console/signup) (requires a one-time $25 registration fee).80- A completed developer profile in the Play Console.8182### Publish your app83841. Open **Settings \> Publish** in Google AI Studio.852. Click **Publish to Play Store**.863. Authenticate with your Google Play Developer account.874. AI Studio signs the APK, creates the app listing (or uploads a new version), and publishes to the internal testing track.885. You receive a link to share with your testers.8990AI Studio manages APK signing automatically using a managed keystore. You can91customize the app listing (icon, screenshots, description) later in the Play92Console.9394> [!NOTE]95> **Note:** Publishing is limited to the **internal testing track** only. Production releases must be managed directly in the Google Play Console.9697## What's generated9899When you build an Android app, the agent generates a standard Gradle-based100project with the following structure:101102- **Build configuration** : `build.gradle.kts` files (project and app level) using Kotlin DSL.103- **UI layer** : [Jetpack Compose](https://developer.android.com/develop/ui/compose) components with [Material 3](https://m3.material.io/) theming.104- **Architecture**: single-activity architecture with ViewModels and data classes.105- **Resources** : `AndroidManifest.xml`, drawables, strings, and other Android resources.106107The agent automatically manages Gradle dependencies, adding packages from Maven108and Google repositories as needed.109110You can view and edit the generated code using the **Code** tab in the preview111panel. To continue development in Android Studio, download the project as a112**ZIP file**.113114## Limitations115116Android app building in AI Studio has the following limitations:117118### Platform limitations119120- **Client-side only**: Android apps don't include a server-side component. Features requiring a server runtime (secrets management, multiplayer, Firebase, Google Workspace APIs) are not available.121- **Single-activity architecture**: only single-activity, single-module projects are supported.122- **Jetpack Compose only**: apps use Kotlin and Jetpack Compose. Java and XML layouts are not supported.123- **No NDK or native code**: C and C++ code is not supported.124- **No Wear OS or Android TV**: only phone and tablet form factors are supported.125126### Export limitations127128- **ZIP download only**: you can download the project as a ZIP file. GitHub export is not yet available for Android projects.129130## What's next131132- [Build apps in Google AI Studio](https://ai.google.dev/gemini-api/docs/aistudio-build-mode)133- [Developing Full-Stack Apps](https://ai.google.dev/gemini-api/docs/aistudio-fullstack) (web)134- See examples in the [App Gallery](https://aistudio.google.com/apps?source=showcase).
Files main
Menu

Theme