An Android application that allows users to register, log in, and manage blogs with co-owner functionality. Built using Kotlin and MVVM architecture, this project demonstrates clean architecture, REST API integration, JWT authentication, and unit testing.
The Android app mirrors the functionality of the iOS version while following Android best practices such as ViewModels, LiveData, Repository pattern, and Retrofit networking.
- Displays a list of all blogs.
- Shows Login and Register options for unauthenticated users.
- Logged-in users can manage blogs they own or co-own.
- Users can register and log in.
- JWT authentication is used for all protected endpoints.
- Access tokens are automatically attached to API requests.
Authenticated users can:
- Create new blogs
- Edit blogs they own or co-own
- Delete blogs they own or co-own
- Add co-owners from the user list
Co-owners have the same editing privileges as the blog creator.
The project follows the MVVM architecture to ensure separation of concerns.
Layers
UI Layer
- Activities
- RecyclerView Adapters
Presentation Layer
- ViewModels
- LiveData state management
Data Layer
- Repository pattern
- Retrofit API services
- Network models
This architecture ensures:
- Clean code
- Easier maintenance
- Better testability
Networking is implemented using Retrofit and OkHttp.
Features:
- Retrofit for REST API communication
- Gson for JSON serialization/deserialization
- OkHttp logging interceptor for debugging
- Repository pattern for network abstraction
All API calls are handled through a centralized BlogRepository.
- JWT token-based authentication
- Access token is attached automatically using OkHttp Interceptor
- Token is persisted locally for authenticated sessions
Unit tests are implemented to verify ViewModel and Repository logic.
The following unit tests are included:
BlogRepositoryTestLoginViewModelTestRegisterViewModelTestAddEditBlogViewModelTestDashboardViewModelTest
Testing tools used:
- JUnit
- Mockito
- Coroutines Test
- Robolectric
- AndroidX Test Core
These tests validate:
- API interaction logic
- ViewModel business logic
- Coroutine execution
- LiveData updates
| Login | Dashboard |
|---|---|
![]() |
![]() |
| Register | Add / Edit Blog |
|---|---|
![]() |
![]() |
- Kotlin
- MVVM (Model View ViewModel)
- Repository Pattern
- Retrofit
- OkHttp
- Gson Converter
- RecyclerView
- Material Components
- ConstraintLayout
- CardView
- Kotlin Coroutines
- ViewModel
- LiveData
- JUnit
- Mockito
- Robolectric
- AndroidX Test
Key dependencies used in this project:
- androidx.core.ktx
- androidx.appcompat
- androidx.constraintlayout
- androidx.lifecycle
- androidx.recyclerview
- material components
Retrofit 2.9.0
OkHttp Logging Interceptor
Gson Converter
Kotlin Coroutines
RecyclerView
CardView
Material Components
ConstraintLayout
JUnit
Mockito
Mockito-Kotlin
Coroutines Test
Robolectric
AndroidX Test
BlogPost_AndroidApp
│
├── data
│ ├── model
│ │ ├── Blog
│ │ ├── User
│ │ └── Owner
│ │
│ ├── network
│ │ └── RetrofitClient
│ │
│ └── repository
│ └── BlogRepository
│
├── ui
│ ├── auth
│ ├── dashboard
│ └── blog
│ └── AddEditBlogActivity
│
├── utils
│ └── TokenManager
│ └── SessionManager
│
└── README.md
git clone https://github.com/shuvojoseph/BlogPostAndroid.gitOpen the project using Android Studio.
Allow Gradle to download dependencies.
Run the project on:
- Android Emulator
- Physical Android device
The backend APIs are hosted on Render Cloud and provide:
- Blog CRUD operations
- User registration
- User authentication
- Co-owner management
Example endpoint:
https://blogpostspringboot.onrender.com/api/blogs
The backend service may go inactive after ~45 minutes of inactivity.
If this happens:
- Open the following link in a browser to wake the server:
https://blogpostspringboot.onrender.com/api/blogs
-
Wait 1–2 minutes for the server to start.
-
After activation, the mobile app will function normally.
This project demonstrates understanding of:
- Android MVVM Architecture
- Clean code structure
- REST API integration
- Retrofit networking
- JWT authentication
- Dependency separation
- RecyclerView UI design
- Unit testing in Android
- Coroutine-based asynchronous programming
Shuvo Joseph
GitHub https://github.com/shuvojoseph



