Build intelligent Android apps: Cloud and hybrid inference
Posted by Thomas Ezan, Jolanda Verhoef, Caren Chang, Senior Developer Relations Engineers, Android Developer Relations Welcome back to the blog post series " Build intelligent Android apps " where we take a basic Android app and transform it into a personalized , intelligent , and agentic experience. In our previous post we explored how to build intelligent on-device features using Gemini Nano through ML Kit's Prompt API. In this post, we will look at how you can leverage Firebase AI Logic to build cloud-hosted and hybrid AI features: Grounding answers in real-world context Routing requests dynamically between cloud and local execution using hybrid inference Translating content with custom routing systems Sometimes a use case requires AI models with greater world knowledge, a much larger context window, or the ability to handle complex queries.
Other times, you want the best of both worlds: using hybrid inference to run on-device when available to lower costs, while falling back to the cloud to ensure compatibility for all devices. Cloud and hybrid features in Jetpacker: Museum assistant with web grounding, hybrid restaurant review drafting, and support chat featuring custom-routed live translation. Let’s look at how we implemented three cloud and hybrid features in Jetpacker : a museum assistant with web grounding hybrid restaurant review drafting hotel support chat featuring custom-routed live translation.
Use LLM grounding for up-to-date informationMuseum assistant chatbot with LLM grounding The Museum assistant is an interactive chatbot designed to help users plan their museum visits. It provides visitors with up-to-date details regarding specific exhibits, current opening hours, ticket pricing, and more. ’ When building AI features, getting the model to answer with fresh, accurate, and specific real-world information is a common challenge.
Grounding data is added to the context window to enable the model to answer questions correctly and accurately. To bridge this gap, we can use grounding techniques to add extra context to the model’s context window. g.
current ticket prices or museum rules). Google Search grounding : Letting the model query the real-time Google search index for up-to-date details. Maps grounding : Using Google Maps location data.
generativeModel( modelName = "gemini-3-flash", systemInstruction = content { text("You are a helpful museum assistant answering questions about a museum. sendMessage(prompt) Hybrid inference: On-device review generation with Maps deep link Not every AI task requires a cloud-based model, and not every device is online. To help developers balance latency, cost, and offline availability, we recently introduced the Firebase API for Hybrid Inference .
Android Developers Blog
android-developers.googleblog.com