Android app that fetches and displays public repositories from any GitHub user via the GitHub REST API, with local persistence of the last searched username.
- ✅ Search any GitHub user by username
- ✅ List all public repositories from the searched user
- ✅ Local persistence of the last searched username
- ✅ Ability to reset the saved username
- ✅ Error handling for invalid usernames or network failures
- ✅ Clean UI with Material Design 3
com.example.githubsearch/
│
├── 📱 MainActivity.kt
│
├── 🧩 ui/
│ ├── UserInputActivity.kt
│ └── RepositoryListActivity.kt
│
├── 🌐 api/
│ ├── GithubService.kt
│ └── RetrofitClient.kt
│
├── 📊 model/
│ └── Repository.kt
│
└── 💾 data/
└── UserPreferences.kt
- Separation of Concerns — network, UI, and data layers are decoupled
- Repository Pattern — data access abstracted from UI
- Clean Code — readable and self-documented code
Consumes the GitHub public REST API — no authentication required:
GET https://api.github.com/users/{username}/repos
| Technology | Description |
|---|---|
| Kotlin 1.9+ | Modern, concise Android language |
| Retrofit 2.9+ | Type-safe HTTP client |
| Gson | JSON serialization |
| RecyclerView | Efficient list rendering |
| SharedPreferences | Lightweight local persistence |
| Android SDK 24+ | Compatible with 95%+ of devices |
- Android Studio Hedgehog (2023.1.1) or higher
- JDK 17+
- Android SDK 34
- Device or emulator with API 24+
- Clone the repository
git clone https://github.com/TallesGuerra/Github-search.git- Open in Android Studio → File → Open → Select the project folder
- Let Gradle sync automatically
- Click Run
▶️ or pressShift + F10
- REST API integration with Retrofit and Gson
- Asynchronous network calls with Coroutines
- RecyclerView with custom adapter
- SharedPreferences for local persistence
- Multi-screen navigation between Activities
- Error handling for network and API responses
- GitHub username input and persistence
- Fetch and display public repositories
- Reset saved username
- Migrate UI to Jetpack Compose
- Add ViewModel + StateFlow
- Repository detail screen
- Search history with Room Database
Made with ❤️ and Kotlin