An Android app that uses AI (DeepSeek / OpenAI-compatible) to explain code line by line ? like having a patient programming tutor in your pocket.
CodeLearner is a free, open-source Android app that helps beginners understand programming code through AI-powered explanations. Paste any code snippet, select the lines you are curious about, and let AI break it down in plain language ? with real-life analogies, syntax explanations, and common pitfalls highlighted.
Perfect for: learning to code, code review, interview preparation, teaching assistants, and self-study.
| Feature | Description |
|---|---|
| ?? Line-by-Line AI Explanation | Select specific lines and get detailed explanations |
| ?? Paste or Type Code | Support pasting from clipboard or typing directly |
| ?? Customizable Prompts | Create your own explanation styles (beginner-friendly, algorithm-focused, etc.) |
| ?? History & Save | All explanations saved locally ? revisit anytime |
| ?? Bring Your Own API Key | Works with DeepSeek, OpenAI, Tongyi Qianwen, GLM, and any OpenAI-compatible API |
| ?? Dark Mode | Supports system dark theme |
| ?? Zero Dependencies | Pure Java + AndroidX ? fast, lightweight |
| ?? Material Design 3 | Modern Android UI with smooth animations |
| Learn Tab | History Tab | Prompt Settings |
|---|---|---|
| Paste code & get AI explanations | Browse past analyses | Customize how AI explains |
git clone https://github.com/a-luoluo/CodeLearner.git- Open the project in Android Studio
- Sync Gradle and wait for dependencies to download
- Connect your Android device or start an emulator
- Click Run ??
Download the latest APK from Releases and install on your Android 8.0+ device.
CodeLearner does NOT include any API key. You need to bring your own:
-
Get an API key from one of these providers:
- DeepSeek (Recommended ? cheap & fast)
- OpenAI
- Tongyi Qianwen (Alibaba)
- Zhipu GLM
- Any other OpenAI-compatible API
-
Open the app ? it will prompt you to enter the key on first launch
-
(Optional) Change the API base URL and model name in Settings (gear icon ??)
Your key is stored locally on your device only ? never sent anywhere except to the API provider you configured.
CodeLearner (Android App)
??? UI Layer (MVVM)
? ??? MainActivity ? Bottom Navigation + ViewPager2
? ??? LearnFragment ? Code editor + AI analysis display
? ??? HistoryFragment ? Past analyses list
? ??? PromptFragment ? Custom prompt management
??? ViewModel Layer
? ??? EditorViewModel ? Code editing + AI analysis logic
? ??? HistoryViewModel ? History CRUD operations
? ??? SharedViewModel ? Cross-tab communication
??? Data Layer
? ??? Retrofit + OkHttp ? Network calls to AI API
? ??? Room Database ? Local storage for history & prompts
? ??? Gson ? JSON parsing
??? Utils
??? AiHelper ? AI API call wrapper
Tech Stack: Java ? AndroidX ? ViewModel + LiveData ? Room ? Retrofit ? ViewPager2 ? Material Design 3
CodeLearner/
??? app/
? ??? src/main/
? ? ??? java/com/example/codelearner/
? ? ? ??? MainActivity.java
? ? ? ??? data/
? ? ? ? ??? api/ # Retrofit API service
? ? ? ? ??? db/ # Room database & DAOs
? ? ? ? ??? model/ # Request/Response models
? ? ? ??? ui/
? ? ? ? ??? editor/ # Learn tab
? ? ? ? ??? history/ # History tab
? ? ? ? ??? prompt/ # Prompt tab
? ? ? ? ??? settings/ # API config dialog
? ? ? ??? utils/
? ? ??? res/ # Layouts, drawables, themes
? ??? build.gradle.kts
??? gradle/
??? build.gradle.kts
??? settings.gradle.kts
??? README.md
Q: Why does the app need my API key?
A: AI explanation requires calling an AI service (like DeepSeek). These services charge per request. The app connects directly from your device to the API ? we never see or store your key on any server.
Q: Which AI provider should I use?
A: DeepSeek is recommended ? it is affordable, fast, and has great Chinese + code understanding. OpenAI, Tongyi, and GLM also work well.
Q: Does it work offline?
A: No. AI explanations require an internet connection to call the API. However, past explanations are saved locally and can be viewed offline.
Q: What languages does it support for code explanation?
A: The AI can explain code in any language. You can customize the output language via custom prompts (e.g., "Explain in Chinese", "Explain like I am 10").
Pull Requests are welcome! For major changes, please open an issue first.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
MIT ? a-luoluo
If you find this app useful, please give it a Star ? on GitHub ? it helps others discover it!
Found a bug or have a feature request? Open an Issue.
Keywords: AI code explainer, DeepSeek android app, code learning tool, AI programming tutor, code review assistant, Android code reader, AI explain code, Java learning app, Python learning tool, open-source AI tutor