AI features in apps

5 concepts · 15 practice questions

On-device AI

ML Kit runs tasks such as text recognition and barcode scanning on the device, offline and without sending data anywhere. Gemini Nano is a small generative model that runs on supported devices only. The app must check that it is available, wait for its download if needed, and cope with devices that lack it.

val recognizer = TextRecognition.getClient(TextRecognizerOptions.DEFAULT_OPTIONS)
recognizer.process(InputImage.fromBitmap(bitmap, 0))
    .addOnSuccessListener { result -> showText(result.text) }

Also covered

Calling cloud models
Designing the experience
Safety and policy
Cost and reliability

Sign in to read the rest and take the 15-question test.

Sign in to continue