跳到正文
Google Developers Blog·· 1 天前精选AI 评分76

Google AI Studio 集成 Gemini 4 Carbon 与 Hydrogen 支持构建全栈 Android 应用并发布到 Google Play

Build full-stack Android apps with Gemini in Google AI Studio

AI 导读

Google AI Studio 结合 Gemini 4 Carbon 和 Hydrogen,可从单个提示词生成生产级 Kotlin Android 应用,并在几分钟内发布到个人 Google Play 库。

推荐理由

原文详细列出了全栈持久化、安全 API 调用、模拟器和 Play 发布等具体升级,读者可以对照判断是否迁移自己的 Android 开发流程。

正文 · 原文

NOV. 17, 2026

Google AI Studio, with Gemini 4 Carbon and Hydrogen, now enables you to build and ship full-stack, Android applications and publish to the Play Store in minutes. You can now go from a single prompt to a production-ready Kotlin Android app complete with data persistence, user sign-in, and AI features. Simply bring your idea and the Google AI Studio Build agent takes care of the entire setup. From configuring your database to securely calling the Gemini API, you can rapidly build and test on your own device directly from the Play Store at no cost.

Alongside full-stack Firebase backend provisioning, a major wave of upgrades is rolling out across the Android development workflow in Google AI Studio. Developers can now iterate in a faster, high-definition (HD) Android emulator with real-time audio output, send one-click emulator screenshots directly to the coding agent for visual UI changes, and style apps with custom fonts.

Sorry, your browser doesn't support playback for this video

What’s new at a glance

Here is what is launching today for Android app development in Google AI Studio:

  • Full-stack persistence and sign-in: Automatically provision a Cloud Firestore database with Security Rules and Google Sign-In so user data syncs across sessions and devices.
  • Secure Gemini API calls: Call Gemini models from your Android app without exposing API keys in your APK, protected by Firebase AI Logic and Firebase App Check.
  • Personal Google Play publishing: Ship Android apps directly to your personal Google Play library with a standard Google account and install them on your phone in clicks.
  • Faster, high-definition emulator with audio: Spin up Android emulators with lower latency, toggle HD video streaming, and test real-time audio output directly in your browser.
  • One-click screenshot to agent: Capture a live frame from the running emulator with a single click and attach it to your prompt to guide visual UI edits.
  • Custom fonts and Android CLI integration: Style Jetpack Compose UIs with custom typography, backed under the hood by the official Android CLI for reliable project scaffolding and builds.

Go full-stack in minutes with Cloud Firestore, Authentication, and Firebase AI Logic

Previously, Android apps generated in AI Studio were limited to local session storage. Now, when your prompt describes an Android app that needs persistent storage, user sign-in, or generative AI features, the Google AI Studio Build agent proactively detects those requirements. With your confirmation, the agent provisions the backend and wires up your Kotlin codebase automatically:

  • Persistent, cross-device data with Cloud Firestore: The Build agent provisions a Cloud Firestore database, configures the Firebase Android SDKs, and generates Firebase Security Rules tailored to your data model. Users can start a session on an Android tablet and pick up right where they left off on their phone, with offline caching that syncs automatically when connectivity returns.
  • Identity management with Firebase Authentication: When your app needs user profiles or private workspaces, the agent configures Firebase Authentication with Google Sign-In and pairs it with per-user authorization rules so users can only read and write their own documents.
  • Server-side credential protection with Firebase AI Logic: Hardcoding API keys inside a client APK risks credential extraction. When your Android app calls Gemini models, the Build agent automatically configures Firebase AI Logic and enforces Firebase App Check using Google Fraud Defense (formerly reCAPTCHA Enterprise). Credentials stay protected server-side, and App Check verifies that incoming requests originate from your authentic, untampered app—both in the browser emulator and on Google Play.

Under the hood, the Build agent automatically adds the Firebase Bill of Materials (BoM) and generates clean, idiomatic Kotlin code for your data and AI layers:

// Generated by Google AI Studio Build agent using Firebase AI Logic & Cloud Firestore
class WorkoutRepository(context: Context) {
    private val generativeModel by lazy {
        Firebase.ai(backend = GenerativeBackend.googleAI())
            .generativeModel("gemini-4-hydrogen")
    }


    private val db = FirebaseFirestore.getInstance(        context.applicationContext.getString(R.string.firestore_database_id))


    suspend fun generateAndSaveWorkout(goal: String, uid: String) {
        val response = generativeModel.generateContent("Create a 20-minute workout for: $goal")
        val workout = hashMapOf(
            "ownerId" to uid,
            "goal" to goal,
            "plan" to (response.text ?: ""),
            "createdAt" to FieldValue.serverTimestamp()
        )
        db.collection("workouts").add(workout).await()
    }
}

Kotlin

Copied

Iterate faster with an HD, audio-enabled emulator and visual debugging

Building great mobile interfaces requires a tight visual and interactive feedback loop. Both the in-browser Android emulator and the Build agent's toolchain include new capabilities to help you inspect, hear, and refine your app in real time:

  • Faster startup and 1200p HD streaming: Emulators now boot with significantly lower latency so you can test code changes rapidly. Use the HD toggle in the emulator toolbar to switch the stream to 1200p high definition, making it easy to inspect fine Jetpack Compose spacing, animations, and dense layouts.
  • Real-time audio output: Hear live audio from the Android emulator directly in your browser. You can build and test voice-driven Gemini Live API companions, text-to-speech (TTS) coaches, sound-enabled games, and media apps without leaving Google AI Studio.
  • One-click screenshot to agent: Describing a visual layout issue in text can take paragraphs. Click Take a screenshot in the emulator toolbar to capture the live app screen and attach it directly to your prompt. Point out the adjustment you want—such as tightening card padding, fixing contrast, or realigning a toolbar—and Gemini updates the Kotlin UI code with full visual context.
  • Custom fonts support: Give your app a distinct visual identity by asking the agent for custom fonts. The Build agent automatically downloads, configures, and applies your chosen typography across your Compose theme.
  • Powered by the Android CLI under the hood: Behind the scenes, the Google AI Studio Build agent now uses the official Android CLI to scaffold project structures, query current Android documentation, and execute Gradle builds, reducing build errors and supporting more complex multi-screen architectures.

Sorry, your browser doesn't support playback for this video

Ship straight to your phone with Google Play

Testing in an emulator accelerates iteration, but nothing replaces running your app on a physical device. Historically, installing a newly built Android app onto a phone required enabling USB debugging cables, managing signing keystores locally, or setting up a full developer console account.

With Google Play integrated directly into Google AI Studio, you can set up a Play account in a few clicks from the publish panel and publish your app straight to your personal Google Play library. Google AI Studio builds and signs the Android App Bundle (.aab) behind the scenes, so you can immediately download and run your custom Android app on your phone directly from Google Play.

What’s next: Start building your Android app today

All of these features are rolling out in Google AI Studio today. To get started, open Google AI Studio Build, select the Android chip at the top of the workspace, and try one of these prompts:

"Build an Android workout coach app that uses the Gemini API to generate personalized daily routines, reads cues aloud with audio, and saves workout history across devices using Cloud Firestore and Google Sign-In."
"Create a collaborative family recipe Android app with custom serif typography where users sign in with Google, snap photos of ingredients to generate recipe ideas with Gemini, and sync shared grocery lists in Firestore."

Explore the Google AI Studio documentation and Firebase Android documentation to learn more, try building your own full-stack Android app at aistudio.google.com/apps, and share what you build on X with @GoogleDevs, @GoogleAIStudio, and @AndroidDev.

Previous

Next

来源:Google Developers Blog · developers.googleblog.com