MVP Architecture Setup for Android App

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
MVP Architecture Setup for Android App
Medium
~2-3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

MVP Architecture Setup for Android App

MVP on Android — pattern with history. Before Architecture Components it was de facto standard: separated logic from Activity through Presenter interface. Now chosen for Java projects where switch to Kotlin + ViewModel unjustified, or where team knows pattern well and change costly.

MVP structure in Android context

Three participants: Model (data and business logic), View (interface, implemented by Activity or Fragment), Presenter (manages logic, doesn't know Android SDK).

public interface ProfileContract {
    interface View {
        void showProfile(UserProfile profile);
        void showError(String message);
        void showLoading(boolean show);
    }

    interface Presenter {
        void loadProfile(String userId);
        void onDestroy();
    }
}

public class ProfilePresenter implements ProfileContract.Presenter {
    private final ProfileContract.View view;
    private final UserRepository repository;
    private CompositeDisposable disposables = new CompositeDisposable();

    public ProfilePresenter(ProfileContract.View view, UserRepository repository) {
        this.view = view;
        this.repository = repository;
    }

    @Override
    public void loadProfile(String userId) {
        view.showLoading(true);
        disposables.add(
            repository.getProfile(userId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(
                    profile -> { view.showLoading(false); view.showProfile(profile); },
                    error -> { view.showLoading(false); view.showError(error.getMessage()); }
                )
        );
    }

    @Override
    public void onDestroy() { disposables.clear(); }
}

Activity implements ProfileContract.View, creates Presenter in onCreate, calls presenter.onDestroy() in onDestroy.

Screen rotation problem

This main MVP disadvantage versus MVVM: Presenter doesn't outlive Activity recreation. Solutions: store Presenter via retain Fragment (outdated), via ViewModelStore (irony — use ViewModel as Presenter container), or accept state loss and reload data.

In projects where MVP settled, often choose second path: RetainedPresenterFragment without UI, holding Presenter in setRetainInstance(true). Works, but looks like workaround.

When MVP appropriate

Legacy Java project without Kotlin plans. Team familiar with pattern. Project with small screen count where MVVM + StateFlow overhead unjustified.

For new Kotlin project — MVVM + ViewModel preferable: better Jetpack integration, no rotation problems, cleaner testing.

What's included in setup

Create base contract structure (View/Presenter interfaces). Set up base BasePresenter class with lifecycle management. Wire DI via Dagger 2. Example module with Presenter tests via JUnit + Mockito without Android dependencies.

Timelines

MVP structure setup from scratch: 2–3 days. Refactoring existing project: 1–2 weeks depending on volume. Cost — by code analysis results.