Skip to content

feat(ai-import): add Gemini Nano as on-device AI provider for Android - #1203

Open
Ekalips wants to merge 2 commits into
graphefruit:developfrom
Ekalips:feature/gemini-nano-ai-import
Open

Ekalips wants to merge 2 commits into
graphefruit:developfrom
Ekalips:feature/gemini-nano-ai-import

Conversation

@Ekalips

@Ekalips Ekalips commented Nov 4, 2026 •

Copy link
Copy Markdown

Description

Adds Gemini Nano (ML Kit GenAI Prompt API) as an on-device AI provider for bean import on Android (available on Pixel and Samsung flagships), the counterpart to Apple Intelligence on iOS.

  • Native bridge in BCAndroidNativeCallsPlugin (geminiNanoStatus, geminiNanoGenerate)
  • New GEMINI_NANO provider, shown on Android like Apple Intelligence on iOS
  • sendLLMPrompt / checkReadiness dispatch per platform; iOS path unchanged
  • AppleIntelligenceAIBeanImportService renamed to OnDeviceAIBeanImportService so naming makes more sense

Note: this can also be achieved via the capacitor plugin, but that would require more changes across the codebase that I was comfortable doing and checking, nevertheless could still be a viable path forward.

Tested on a Pixel 10 Pro: 2 photo import in ~14 s.

GitHub Issue / Discussion Reference

Ref / Closes: #

AI Assistance Disclosure

AI Usage Level

  • Completely on my own (0% AI)
  • Assisted by AI (up to 50% AI)
  • Completely or mostly generated by AI (50% - 100% AI)

AI Provider / Tool

  • Provider / Tool: Claude Opus 5.5 / Claude Code

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring / Code cleanup
  • Documentation update
  • Other (please describe):

Screenshots / Videos (if applicable)

Tested Platforms

  • Android
  • iOS
  • Web

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings or lint errors

Adds Gemini Nano (ML Kit GenAI Prompt API / AICore) as the Android
counterpart to the Apple Intelligence on-device bean import.

- BCAndroidNativeCalls: geminiNanoStatus (triggers model download when
  downloadable) and geminiNanoGenerate, using com.google.mlkit:genai-prompt
- New GEMINI_NANO provider; option is shown on Android and disabled with
  a "not supported on this device" label when Nano is unavailable
- sendLLMPrompt and checkReadiness dispatch per platform; the iOS
  Apple Intelligence path is unchanged
- Rename AppleIntelligenceAIBeanImportService to OnDeviceAIBeanImportService
  since it now serves both platforms
- Unit tests for the Gemini Nano prompt path (success, error, timeout)
- New strings added to en.json only; other languages follow via Lokalise
@Ekalips
Ekalips marked this pull request as ready for review November 4, 2026 23:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant