Android-MVVM-Architecture-Android-Voice-AI-SDK

作者 ahmedeltaher已验证

Voice AI SDK is a reusable Android library that gives any app a full voice-driven AI conversation pipeline in minutes. Voice Assistant + Android Voide AI + SDK + MVVM + Kotlin

2,577
Stars
614
Forks
Kotlin
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/ahmedeltaher/Android-MVVM-Architecture-Android-Voice-AI-SDK

快速入门

使用 Android-MVVM-Architecture-Android-Voice-AI-SDK 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Android Voice AI SDK in Model-View-ViewModel (ie MVVM)

Android Voice AI SDK Kotlin Coroutines Jetpack Compose Hilt MockK JUnit5 Espresso MVVM STT - Android SpeechRecognizer STT - OpenAI Whisper TTS - Android TTS TTS - ElevenLabs Anthropic Claude build: passing license: MIT minSdk: 24

MVVM3

flowchart LR
    Microphone --> AudioRecord --> VAD --> STT --> ClaudeAI["Claude AI"] --> TTS --> Speaker

The Android Voice AI SDK is a reusable Android library that gives any app a full voice-driven AI conversation pipeline in minutes. It captures audio from the device microphone, transcribes speech to text, sends the transcript to Anthropic Claude for an intelligent response, and speaks the reply back to the user through text-to-speech — all wired together with a single VoiceAISDK.Builder call. The SDK ships ready-to-drop-in Jetpack Compose UI components, swappable STT/TTS engine adapters, on-device emotion detection, and security utilities including PII redaction and encrypted key storage.

Features

LayerCapability
Audio InputVoice Activity Detection (VAD), noise handling, streaming PCM capture
RecognitionSpeech-to-Text (STT), language detection, speaker diarization
UnderstandingIntent extraction, entity recognition, conversation context
ActionAPI orchestration, workflow execution, task automation
ResponseLLM answer generation (Anthropic Claude)
Voice OutputText-to-Speech (TTS), voice style selection, audio streaming
SafetyUser consent, authentication, abuse prevention
AnalyticsConversation logs, session summaries, quality metrics

Requirements

RequirementVersion
Android StudioMeerkat or newer
Minimum SDK24 (Android 7.0)
Kotlin2.0+ (project uses 2.3.21)
Anthropic API keyRequired — obtain at console.anthropic.com

Quick Start

Step 1 — Add the dependency and manifest permissions

In your app build.gradle.kts:

dependencies {
    implementation("com.sdk:voice-ai-sdk:1.0.0")
}

In app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Step 2 — Hilt setup

Annotate your Application class with @HiltAndroidApp and your Activity with @AndroidEntryPoint:

@HiltAndroidApp
class MyApp : Application()

@AndroidEntryPoint
class MainActivity : ComponentActivity() { ... }

Step 3 — Add your API key to local.properties

local.properties is git-ignored, so your key never ends up in source control:

ANTHROPIC_API_KEY=sk-ant-...

Then expose it via BuildConfig in app/build.gradle.kts:

defaultConfig {
    buildConfigField(
        "String",
        "ANTHROPIC_API_KEY",
        "\"${project.findProperty("ANTHROPIC_API_KEY") ?: ""}\"",
    )
}

buildFeatures {
    buildConfig = true
}

Step 4 — Build the SDK

Provide the SDK through Hilt by creating an AppModule:

@Module
@InstallIn(SingletonComponent::class)
object AppModule {

    @Provides
    @Singleton
    fun provideVoiceAIConfig(): VoiceAIConfig =
        VoiceAIConfig(anthropicApiKey = BuildConfig.ANTHROPIC_API_KEY)

    @Provides
    @Singleton
    fun provideVoiceAISDK(
        @ApplicationContext context: Context,
        config: VoiceAIConfig,
    ): VoiceAISDK = VoiceAISDK.Builder(context)
        .anthropicApiKey(config.anthropicApiKey)
        .debugLogging(BuildConfig.DEBUG)
        .build()
}

Or construct the SDK directly without Hilt:

val sdk = VoiceAISDK.Builder(context)
    .anthropicApiKey(BuildConfig.ANTHROPIC_API_KEY)
    .debugLogging(true)
    .config { copy(systemPrompt = "You are a concise voice assistant.") }
    .build()

val session: VoiceAISession = sdk.createSession()
session.start()

Step 5 — Add the VoiceScreen composable

Use VoiceSessionPermissionGate to handle the RECORD_AUDIO runtime permission automatically, then place VoiceButton and ConversationView inside:

@Composable
fun VoiceScreen(viewModel: VoiceViewModel = hiltViewModel()) {
    VoiceSessionPermissionGate(
        rationale = "Microphone access is required for voice conversations.",
    ) {
        Column(
            modifier = Modifier
                .fillMaxSize()
                .padding(16.dp),
            verticalArrangement = Arrangement.SpaceBetween,
        ) {
            ConversationView(
                messages = viewModel.messages.collectAsStateWithLifecycle().value,
                modifier = Modifier.weight(1f),
            )
            VoiceButton(
                session = viewModel.session,
                modifier = Modifier.align(Alignment.CenterHorizontally),
            )
        }
    }
}

Architecture

The SDK is organised into six layers, each with a single responsibility:

LayerPackageResponsibility
Audioaudio/Raw PCM capture via AudioRecord, voice activity detection (VAD), audio level metering, and PCM-to-WAV conversion
STTstt/SpeechToTextEngine interface with a drop-in Android built-in implementation; plug in Whisper or any other engine
AIai/AIEngine interface backed by ClaudeAIEngine, which wraps the official Anthropic Java SDK and maintains conversation history
TTStts/TextToSpeechEngine interface with a drop-in Android built-in implementation; plug in ElevenLabs for premium voices
SessionVoiceAISessionOrchestrates the full pipeline — audio in, transcript out, AI reply, speech out — as a single coroutine-based lifecycle
UIui/Ready-to-use Jetpack Compose components: VoiceButton, ConversationView, VoiceSessionPermissionGate, WaveformVisualizer, LiveCaptionBanner, VoiceStatusIndicator

Available Engines

CategoryEngineClassNotes
STTAndroid built-inAndroidSttEngineDefault; free; uses android.speech.SpeechRecognizer; requires network
STTOpenAI WhisperWhisperSttEngineHigher accuracy; POSTs PCM/WAV to OpenAI REST API; requires OpenAI key
AIAnthropic ClaudeClaudeAIEngineDefault and only AI engine; uses com.anthropic:anthropic-java; model is configurable
TTSAndroid built-inAndroidTtsEngineDefault; free; uses android.speech.tts.TextToSpeech
TTSElevenLabsElevenLabsTtsEngineHigh-quality natural voices; POSTs to ElevenLabs REST API; requires ElevenLabs key
EmotionOn-devicebuilt-inLightweight on-device audio feature analysis; no external key required
EmotionHume AIHumeEmotionDetectorCloud-based; high accuracy across 7 emotions; requires Hume API key

Configuration Reference

All options are fields on VoiceAIConfig. Pass a config { } block to VoiceAISDK.Builder to override defaults.

FieldTypeDefaultDescription
anthropicApiKeyStringRequired. Your Anthropic API key. Never hardcode; read from BuildConfig or encrypted storage.
aiModelString"claude-3-5-sonnet-20241022"Claude model ID used for all AI turns.
systemPromptString?"You are a helpful voice assistant…"System instruction prepended to every conversation.
inputModeInputModeHANDS_FREEHANDS_FREE activates VAD; PUSH_TO_TALK records only while button is held.
localeLocaleLocale.getDefault()Locale passed to the STT engine for language hints.
silenceTimeoutMsLong1200Milliseconds of silence after speech before the STT turn is finalised.
maxHistoryTurnsInt20Maximum number of conversation turns kept in the Claude context window.
piiRedactionBooleanfalseWhen true, strips phone numbers, emails, and credit-card numbers from transcripts before sending to the AI.
emotionDetectionEnabledBooleanfalseEnables voice emotion detection. Requires user consent; set emotionConsentRationale.
certificatePinsList<String>emptyList()SHA-256 certificate pins applied to the OkHttp client for network requests.

Voice Emotion Detection

When enabled, the SDK analyses the acoustic features of each recorded utterance and annotates AI turns with the detected emotion (NEUTRAL, HAPPY, SAD, ANGRY, FEARFUL, SURPRISED, or DISGUSTED). Set emotionAwareAI = true to have the detected emotion automatically injected into the Claude system context so the AI can adapt its tone. Always present a clear consent rationale before enabling this feature.

val sdk = VoiceAISDK.Builder(context)
    .anthropicApiKey(BuildConfig.ANTHROPIC_API_KEY)
    .config {
        copy(
            emotionDetectionEnabled = true,
            emotionConsentRationale = "Emotion analysis helps the assistant respond more empathetically.",
            emotionAwareAI = true,
        )
    }
    .build()

Security

  • API keys are never hardcoded. Keys are read from BuildConfig fields populated via local.properties (git-ignored) or CI environment variables, never embedded in source files or strings.xml.
  • Encrypted local storage. VoiceAIKeyStorage wraps EncryptedSharedPreferences with AES-256-GCM key encryption and AES-256-SIV value encryption backed by the Android Keystore.
  • PII redaction. When piiRedaction = true, PiiRedactor strips phone numbers, email addresses, and credit-card numbers from transcripts before they leave the device.
  • Certificate pinning. Populate VoiceAIConfig.certificatePins with SHA-256 digests to enable OkHttp certificate pinning on all outbound API calls.
  • R8/ProGuard minification. Release builds should enable isMinifyEnabled = true; the Anthropic Java SDK ships consumer ProGuard rules that are merged automatically.

License

MIT License

Copyright (c) 2026 Android Voice AI SDK Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

常见问题

What is Android-MVVM-Architecture-Android-Voice-AI-SDK?

Android-MVVM-Architecture-Android-Voice-AI-SDK is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by ahmedeltaher. Voice AI SDK is a reusable Android library that gives any app a full voice-driven AI conversation pipeline in minutes. Voice Assistant + Android Voide AI + SDK + MVVM + Kotlin. It has 2,577 GitHub stars.

Is Android-MVVM-Architecture-Android-Voice-AI-SDK safe to use?

Yes. Android-MVVM-Architecture-Android-Voice-AI-SDK passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install Android-MVVM-Architecture-Android-Voice-AI-SDK?

Clone the repository with "git clone https://github.com/ahmedeltaher/Android-MVVM-Architecture-Android-Voice-AI-SDK" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is Android-MVVM-Architecture-Android-Voice-AI-SDK written in?

Android-MVVM-Architecture-Android-Voice-AI-SDK is primarily written in Kotlin. It is open-source under ahmedeltaher on GitHub, so you can review or fork the full source.

Are there alternatives to Android-MVVM-Architecture-Android-Voice-AI-SDK?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh Android-MVVM-Architecture-Android-Voice-AI-SDK against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情