Skip to content

a-luoluo/CodeLearner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

?? CodeLearner ? AI Code Explainer for Android

An Android app that uses AI (DeepSeek / OpenAI-compatible) to explain code line by line ? like having a patient programming tutor in your pocket.

Android License API


?? What is CodeLearner?

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.


? Features

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

?? Screenshots

Learn Tab History Tab Prompt Settings
Paste code & get AI explanations Browse past analyses Customize how AI explains

?? Installation

From Source (Android Studio)

git clone https://github.com/a-luoluo/CodeLearner.git
  1. Open the project in Android Studio
  2. Sync Gradle and wait for dependencies to download
  3. Connect your Android device or start an emulator
  4. Click Run ??

Direct APK

Download the latest APK from Releases and install on your Android 8.0+ device.


?? API Key Setup

CodeLearner does NOT include any API key. You need to bring your own:

  1. Get an API key from one of these providers:

  2. Open the app ? it will prompt you to enter the key on first launch

  3. (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.


??? Architecture

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


?? Project Structure

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

? FAQ

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").


?? Contributing

Pull Requests are welcome! For major changes, please open an issue first.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

?? License

MIT ? a-luoluo


? Support

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

About

AI-powered code explainer for Android - Supports DeepSeek/OpenAI/GLM - Bring your own API key - Line-by-line code analysis with customizable prompts

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages