{"id":9376,"date":"2024-04-29T12:20:20","date_gmt":"2024-04-29T12:20:20","guid":{"rendered":"https:\/\/shivlab.com\/blog\/\/"},"modified":"2024-04-30T05:37:34","modified_gmt":"2024-04-30T05:37:34","slug":"mastering-android-architecture-tutorial-on-mvp-or-mvvm","status":"publish","type":"post","link":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/","title":{"rendered":"Mastering Android Architecture: A Tutorial on MVP or MVVM"},"content":{"rendered":"<p>This post is about Android architectures to make testability better. Read on to know the complete details.<\/p>\n<h3>1. Architectures for Android<\/h3>\n<hr \/>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9378\" src=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Architectures-for-Android.jpg\" alt=\"Architectures for Android\" width=\"950\" height=\"566\" srcset=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Architectures-for-Android.jpg 950w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Architectures-for-Android-300x179.jpg 300w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Architectures-for-Android-768x458.jpg 768w\" sizes=\"auto, (max-width: 950px) 100vw, 950px\" \/><\/p>\n<p>In default templates, they make you create large activities or fragments. These components usually have business logic mixed with their UI logic. Because of this, it becomes difficult to test and therefore maintain Android applications.<\/p>\n<p>There are several patterns which are popularly used in the Android community to make testing easier.<\/p>\n<p><strong>The most commonly used architectural styles include:<\/strong><\/p>\n<ul class=\"orangeList\">\n<li>Model View Presenter (MVP)<\/li>\n<li>Model View View Model (MVVM) with Android Data Binding<\/li>\n<\/ul>\n<h3>2. Android\u2019s Model View Presenter Architecture<\/h3>\n<hr \/>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9379\" src=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Androids-Model-View-Presenter-Architecture.jpg\" alt=\"Android\u2019s Model View Presenter Architecture\" width=\"950\" height=\"566\" srcset=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Androids-Model-View-Presenter-Architecture.jpg 950w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Androids-Model-View-Presenter-Architecture-300x179.jpg 300w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Androids-Model-View-Presenter-Architecture-768x458.jpg 768w\" sizes=\"auto, (max-width: 950px) 100vw, 950px\" \/>The Model View Presenter (MVP) architecture pattern improves the application\u2019s architecture to make it more testable. The MVP pattern separates the data model from a view through a presenter.<\/p>\n<h4>2.1 A Visual Part<\/h4>\n<p>A view in MVP is a visual part of an application. It contains only the UI and doesn\u2019t have any logic or knowledge about what data it shows. In most cases, a view in MVP (model-view-presenter pattern) exports an interface that is utilized by the Presenter \u2013 therefore, these methods are used by him to manipulate the view itself; for example: showProgressBar(), updateData() etc.<\/p>\n<h4>2.2 The Program Giver<\/h4>\n<p>The presenter triggers business logic and tells the view when to update; it interacts with the model hence fetching and transforming data from the model into updating views. If possible, a presenter should not depend on Android SDK.<\/p>\n<h4>2.3 Data Supplier<\/h4>\n<p>A model consists of two parts: a data provider and code that fetches\/updates data. This section of MVP updates databases or communicates with web servers.<\/p>\n<h4>2.4. Things to Consider When Using the Design Pattern MVP<\/h4>\n<p>MVP makes it easier for you to test your presenter logic and replace dependencies. But also with this comes longer application code. This structure may not be easily comprehensible by every Android developer as this is not followed in the standard Android templates at the moment.<\/p>\n<h4>2.5 Comparison to Model View Controller<\/h4>\n<p>In the Model View Presenter pattern, the views more separated from the model. The presenter communicates between model and view; this makes it easier to create unit tests Generally there is a one-to-one mapping between view and Presenter but also it\u2019s possible to use multiple presenters for complex views.<\/p>\n<p><strong>Also Read:-<\/strong> <a href=\"http:\/\/167.86.116.248\/shivlab\/blog\/what-are-widgets-in-flutter-exploring-types-and-benefits\/\">What are Widgets in Flutter? Exploring Types and Benefits<\/a><\/p>\n<p>In Model View Controller pattern controllers are behavior based and can share multiple views. View can communicate directly with model. MVP is currently on of the patterns that the Android community prefers.<\/p>\n<h3>3. The Model View View Model Architecture for Android<\/h3>\n<hr \/>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9380\" src=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/The-Model-View-View-Model-Architecture-for-Android.jpg\" alt=\"The Model View View Model Architecture for Android\" width=\"950\" height=\"566\" srcset=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/The-Model-View-View-Model-Architecture-for-Android.jpg 950w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/The-Model-View-View-Model-Architecture-for-Android-300x179.jpg 300w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/The-Model-View-View-Model-Architecture-for-Android-768x458.jpg 768w\" sizes=\"auto, (max-width: 950px) 100vw, 950px\" \/><\/p>\n<p>Also known as the Model View Binder, the design pattern Model View ViewModel.<\/p>\n<h4>3.1. The Scene<\/h4>\n<p>In MVP, a view component represents the visual part of an app.<\/p>\n<p>Views are usually bound to observable variables and actions that are exposed by the view model via a data binding framework.<\/p>\n<p>Some of the responsibilities of a view include:<\/p>\n<ul class=\"orangeList\">\n<li>Menus<\/li>\n<li>Permissions<\/li>\n<li>Event listeners<\/li>\n<li>Showing dialogs, Toasts, Snackbars<\/li>\n<li>Starting activities<\/li>\n<li>All functionality related to the Android Context<\/li>\n<\/ul>\n<h4>3.2. Sight Model (ViewModel)<\/h4>\n<p>This is where we store all data that should be displayed in our application\u2019s views. It acts as an intermediary between them \u2013 exposing public properties and commands, using observables so they can easily notify about any changes etc., also allowing events passing through it from models (a raw model data value converter into presentation friendly properties).<\/p>\n<p><strong>Below are the responsibilities of a view model:<\/strong><\/p>\n<ul class=\"orangeList\">\n<li>Data Exposure<\/li>\n<li>State Exposure (progress, offline, empty, error etc)<\/li>\n<li>Visibility Handling<\/li>\n<li>Input Validation<\/li>\n<li>Executes calls to the Model<\/li>\n<li>Executes methods in the view<\/li>\n<\/ul>\n<p>The Application Context should be only known by the View Model. The application context can do things like:<\/p>\n<ul class=\"orangeList\">\n<li style=\"list-style-type: none;\">\n<ul class=\"orangeList\">\n<li>Start a Service.<\/li>\n<li>Bind to a Service.<\/li>\n<li>Send a Broadcast.<\/li>\n<li>Register a Broadcast Receiver.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul class=\"orangeList\">\n<li>Load Resource Values.<\/li>\n<\/ul>\n<p>But it cannot do things like:<\/p>\n<ul class=\"orangeList\">\n<li>Show a Dialog.<\/li>\n<li>Inflating a Layout.<\/li>\n<\/ul>\n<h4>3.3 The Model:<\/h4>\n<p>It contains the code to fetch and update data along with data provider. Different sources for getting data can be used such as:<\/p>\n<h4>3.4. Differences From MVP<\/h4>\n<p>This has a greater number of synonyms and uses them well. MVVM is more event-driven because it uses data binding. The presenter and the view are typically mapped one to one in MVP, but many views can be associated with a single view model in MVVM On this level, the view knows the presenter while in that level of abstraction the view model doesn\u2019t have any reference to it.<\/p>\n<p><strong>Also Read:-<\/strong> <a href=\"http:\/\/167.86.116.248\/shivlab\/blog\/select-the-right-iot-database-architecture\/\">How to Select the Right IoT Database Architecture?<\/a><\/p>\n<h3>4. Using Build Flavors as Architectural Style to Improve Testability<\/h3>\n<hr \/>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9381\" src=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Using-Build-Flavors-as-Architectural-Style-to-Improve-Testability.jpg\" alt=\"Using Build Flavors as Architectural Style to Improve Testability\" width=\"950\" height=\"566\" srcset=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Using-Build-Flavors-as-Architectural-Style-to-Improve-Testability.jpg 950w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Using-Build-Flavors-as-Architectural-Style-to-Improve-Testability-300x179.jpg 300w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Using-Build-Flavors-as-Architectural-Style-to-Improve-Testability-768x458.jpg 768w\" sizes=\"auto, (max-width: 950px) 100vw, 950px\" \/><\/p>\n<p>Using build flavors can be done by developers for improving testability in their applications. They need to define different classes for providing data within each build flavor.<\/p>\n<p>Here\u2019s an example: if you had two flavors \u2018prod\u2019 and \u2018mock\u2019 then you could have these different implementations in your flavors.<\/p>\n<p>This might be a theoretical implementation for the &#8216;mock&#8217; flavor:<\/p>\n<p>This could be a theoretical implementation for the &#8216;prod&#8217; flavour.<\/p>\n<p>In the case of your application code, you can access the provided implementation via Injection.provideNotesRepository(). You will receive the mocked version or the real one depending on which flavor you are building. Your unit test would build against the mock flavor to mock away external dependencies.<\/p>\n<h3>5. Enhancing Testability Using Dependency Injection as Architectural Style<\/h3>\n<hr \/>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9382\" src=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Enhancing-Testability-Using-Dependency-Injection-as-Architectural-Style.jpg\" alt=\"Enhancing Testability Using Dependency Injection as Architectural Style\" width=\"950\" height=\"566\" srcset=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Enhancing-Testability-Using-Dependency-Injection-as-Architectural-Style.jpg 950w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Enhancing-Testability-Using-Dependency-Injection-as-Architectural-Style-300x179.jpg 300w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Enhancing-Testability-Using-Dependency-Injection-as-Architectural-Style-768x458.jpg 768w\" sizes=\"auto, (max-width: 950px) 100vw, 950px\" \/><\/p>\n<p>Dependency injection is a way of building testable applications. Most Android applications use Dagger 2 for dependency injection. When tests are run, they inject mock or fake objects. When the real application starts, correct objects are injected.<\/p>\n<h3>6. Presenter Testing<\/h3>\n<hr \/>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9383\" src=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Presenter-Testing.jpg\" alt=\"Presenter Testing\" width=\"950\" height=\"566\" srcset=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Presenter-Testing.jpg 950w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Presenter-Testing-300x179.jpg 300w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Presenter-Testing-768x458.jpg 768w\" sizes=\"auto, (max-width: 950px) 100vw, 950px\" \/><\/p>\n<p>The presenter typically has dependencies, eg to an implementation of the view contract. To unit test the presenter, you mock or fake these dependencies away.<\/p>\n<p>For example, testing the presenter we don\u2019t need to know whether the view displays a dialog or progress indicator; but we want to test that presenter calls a method on view to display progress information.<\/p>\n<h3>7. Exercise Model View Presenter<\/h3>\n<hr \/>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9384\" src=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Exercise-Model-View-Presenter.jpg\" alt=\"Exercise Model View Presenter\" width=\"950\" height=\"566\" srcset=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Exercise-Model-View-Presenter.jpg 950w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Exercise-Model-View-Presenter-300x179.jpg 300w, http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Exercise-Model-View-Presenter-768x458.jpg 768w\" sizes=\"auto, (max-width: 950px) 100vw, 950px\" \/><\/p>\n<p>Here you will design a small application for maintaining tasks. === Create a new application.<\/p>\n<h4>7.1 Generate Package<\/h4>\n<p>This project groups classes according to their use cases. Create these Java packages:<\/p>\n<ul class=\"orangeList\">\n<li>Createtask<\/li>\n<li>Data<\/li>\n<li>Overview<\/li>\n<li>Util<\/li>\n<\/ul>\n<h4>7.2 Build Tasks Activity<\/h4>\n<p>Create a new TasksActivity and make it the entry point of your app.<\/p>\n<p>You have a screen with an overview of repositories for the selected user. When you click on the repository, you would see details about this repository.<\/p>\n<p>The contract between this view and presenter should be through a GitHubContract interface. The view would call one of its methods whenever it needs to perform an operation on the presenter, and when the presenter finishes, it would call back the view via defined interface methods.<\/p>\n<p>In the create method of the activity you would instantiate the responsible presenter and pass a reference to the presenter to the view.<\/p>\n<p>For the refresh action, put in at least a button. In the onClick method of the button, call loadRepositories on your presenter. Call setProgressIndicator method on the view in the presenter, create some test data and call showRepositories repositories on the view with this data.<\/p>\n<p>Can you write unit tests for the presenter which could run on the JVM? <strong><a href=\"http:\/\/167.86.116.248\/shivlab\/contact\/\">Contact Shiv Technolabs<\/a><\/strong> now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unlock the secrets of Android architecture with our tutorial on MVP or MVVM! Dive deep into mastery at Shiv Technolabs.<\/p>\n","protected":false},"author":2,"featured_media":9377,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-9376","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mobile-app-deveploment"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Mastering Android Architecture: A Tutorial on MVP or MVVM<\/title>\n<meta name=\"description\" content=\"Gain expertise in MVC, MVP, and MVVM using Google Android Architecture Components in Java with our latest tutorial series on our website.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mastering Android Architecture: A Tutorial on MVP or MVVM\" \/>\n<meta property=\"og:description\" content=\"Gain expertise in MVC, MVP, and MVVM using Google Android Architecture Components in Java with our latest tutorial series on our website.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/\" \/>\n<meta property=\"og:site_name\" content=\"Shiv Technolabs Pvt. Ltd.\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ShivTechnolabs\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/kishan.2204\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-29T12:20:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T05:37:34+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Mastering-Android-Architecture-A-Tutorial-on-MVP-or-MVVM.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1140\" \/>\n\t<meta property=\"og:image:height\" content=\"762\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Kishan Mehta\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@KishanRMehta\" \/>\n<meta name=\"twitter:site\" content=\"@Shiv_Technolabs\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kishan Mehta\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/\"},\"author\":{\"name\":\"Kishan Mehta\",\"@id\":\"http:\/\/167.86.116.248\/shivlab\/#\/schema\/person\/881e4ba4247b26ad41c7f8284086ab5f\"},\"headline\":\"Mastering Android Architecture: A Tutorial on MVP or MVVM\",\"datePublished\":\"2024-04-29T12:20:20+00:00\",\"dateModified\":\"2024-04-30T05:37:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/\"},\"wordCount\":1197,\"publisher\":{\"@id\":\"http:\/\/167.86.116.248\/shivlab\/#organization\"},\"image\":{\"@id\":\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Mastering-Android-Architecture-A-Tutorial-on-MVP-or-MVVM.jpg\",\"articleSection\":[\"Mobile App Deveploment\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/\",\"url\":\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/\",\"name\":\"Mastering Android Architecture: A Tutorial on MVP or MVVM\",\"isPartOf\":{\"@id\":\"http:\/\/167.86.116.248\/shivlab\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Mastering-Android-Architecture-A-Tutorial-on-MVP-or-MVVM.jpg\",\"datePublished\":\"2024-04-29T12:20:20+00:00\",\"dateModified\":\"2024-04-30T05:37:34+00:00\",\"description\":\"Gain expertise in MVC, MVP, and MVVM using Google Android Architecture Components in Java with our latest tutorial series on our website.\",\"breadcrumb\":{\"@id\":\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#primaryimage\",\"url\":\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Mastering-Android-Architecture-A-Tutorial-on-MVP-or-MVVM.jpg\",\"contentUrl\":\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Mastering-Android-Architecture-A-Tutorial-on-MVP-or-MVVM.jpg\",\"width\":1140,\"height\":762,\"caption\":\"Mastering Android Architecture - A Tutorial on MVP or MVVM\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/167.86.116.248\/shivlab\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mastering Android Architecture: A Tutorial on MVP or MVVM\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/167.86.116.248\/shivlab\/#website\",\"url\":\"http:\/\/167.86.116.248\/shivlab\/\",\"name\":\"Shiv Technolabs Pvt. Ltd.\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\/\/167.86.116.248\/shivlab\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/167.86.116.248\/shivlab\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/167.86.116.248\/shivlab\/#organization\",\"name\":\"Shiv Technolabs Pvt. Ltd\",\"url\":\"http:\/\/167.86.116.248\/shivlab\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/167.86.116.248\/shivlab\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2022\/11\/stl-logo1.png\",\"contentUrl\":\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2022\/11\/stl-logo1.png\",\"width\":1280,\"height\":371,\"caption\":\"Shiv Technolabs Pvt. Ltd\"},\"image\":{\"@id\":\"http:\/\/167.86.116.248\/shivlab\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ShivTechnolabs\/\",\"https:\/\/x.com\/Shiv_Technolabs\",\"https:\/\/www.linkedin.com\/company\/shivtechnolabs\/\",\"https:\/\/www.instagram.com\/shivtechnolabs\/\",\"https:\/\/in.pinterest.com\/ShivTechnolabs\/\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/167.86.116.248\/shivlab\/#\/schema\/person\/881e4ba4247b26ad41c7f8284086ab5f\",\"name\":\"Kishan Mehta\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/167.86.116.248\/shivlab\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2023\/07\/kishan-mehta-150x150.png\",\"contentUrl\":\"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2023\/07\/kishan-mehta-150x150.png\",\"caption\":\"Kishan Mehta\"},\"description\":\"I am a dynamic and visionary Managing Director of Shiv Technolabs, a leading IT company at the forefront of innovation. With over a decade of hands-on experience in mobile app development, web development, and eCommerce solutions, I am a qualified professional. My expertise goes beyond technical proficiency, containing a keen understanding of evolving market dynamics. I have successfully delivered exceptional IT solutions, catering to the unique needs of entrepreneurs and businesses across diverse industries.\",\"sameAs\":[\"http:\/\/167.86.116.248\/shivlab\/\",\"https:\/\/www.facebook.com\/kishan.2204\",\"https:\/\/www.instagram.com\/kishanmehta2204\/\",\"https:\/\/www.linkedin.com\/in\/kishan-mehta\/\",\"https:\/\/x.com\/KishanRMehta\",\"https:\/\/www.youtube.com\/@ShivTechnolabs\"],\"url\":\"http:\/\/167.86.116.248\/shivlab\/author\/kishan_mehta\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mastering Android Architecture: A Tutorial on MVP or MVVM","description":"Gain expertise in MVC, MVP, and MVVM using Google Android Architecture Components in Java with our latest tutorial series on our website.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/","og_locale":"en_US","og_type":"article","og_title":"Mastering Android Architecture: A Tutorial on MVP or MVVM","og_description":"Gain expertise in MVC, MVP, and MVVM using Google Android Architecture Components in Java with our latest tutorial series on our website.","og_url":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/","og_site_name":"Shiv Technolabs Pvt. Ltd.","article_publisher":"https:\/\/www.facebook.com\/ShivTechnolabs\/","article_author":"https:\/\/www.facebook.com\/kishan.2204","article_published_time":"2024-04-29T12:20:20+00:00","article_modified_time":"2024-04-30T05:37:34+00:00","og_image":[{"width":1140,"height":762,"url":"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Mastering-Android-Architecture-A-Tutorial-on-MVP-or-MVVM.jpg","type":"image\/jpeg"}],"author":"Kishan Mehta","twitter_card":"summary_large_image","twitter_creator":"@KishanRMehta","twitter_site":"@Shiv_Technolabs","twitter_misc":{"Written by":"Kishan Mehta","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#article","isPartOf":{"@id":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/"},"author":{"name":"Kishan Mehta","@id":"http:\/\/167.86.116.248\/shivlab\/#\/schema\/person\/881e4ba4247b26ad41c7f8284086ab5f"},"headline":"Mastering Android Architecture: A Tutorial on MVP or MVVM","datePublished":"2024-04-29T12:20:20+00:00","dateModified":"2024-04-30T05:37:34+00:00","mainEntityOfPage":{"@id":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/"},"wordCount":1197,"publisher":{"@id":"http:\/\/167.86.116.248\/shivlab\/#organization"},"image":{"@id":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#primaryimage"},"thumbnailUrl":"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Mastering-Android-Architecture-A-Tutorial-on-MVP-or-MVVM.jpg","articleSection":["Mobile App Deveploment"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/","url":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/","name":"Mastering Android Architecture: A Tutorial on MVP or MVVM","isPartOf":{"@id":"http:\/\/167.86.116.248\/shivlab\/#website"},"primaryImageOfPage":{"@id":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#primaryimage"},"image":{"@id":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#primaryimage"},"thumbnailUrl":"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Mastering-Android-Architecture-A-Tutorial-on-MVP-or-MVVM.jpg","datePublished":"2024-04-29T12:20:20+00:00","dateModified":"2024-04-30T05:37:34+00:00","description":"Gain expertise in MVC, MVP, and MVVM using Google Android Architecture Components in Java with our latest tutorial series on our website.","breadcrumb":{"@id":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#primaryimage","url":"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Mastering-Android-Architecture-A-Tutorial-on-MVP-or-MVVM.jpg","contentUrl":"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Mastering-Android-Architecture-A-Tutorial-on-MVP-or-MVVM.jpg","width":1140,"height":762,"caption":"Mastering Android Architecture - A Tutorial on MVP or MVVM"},{"@type":"BreadcrumbList","@id":"http:\/\/167.86.116.248\/shivlab\/blog\/mastering-android-architecture-tutorial-on-mvp-or-mvvm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/167.86.116.248\/shivlab\/"},{"@type":"ListItem","position":2,"name":"Mastering Android Architecture: A Tutorial on MVP or MVVM"}]},{"@type":"WebSite","@id":"http:\/\/167.86.116.248\/shivlab\/#website","url":"http:\/\/167.86.116.248\/shivlab\/","name":"Shiv Technolabs Pvt. Ltd.","description":"","publisher":{"@id":"http:\/\/167.86.116.248\/shivlab\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/167.86.116.248\/shivlab\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/167.86.116.248\/shivlab\/#organization","name":"Shiv Technolabs Pvt. Ltd","url":"http:\/\/167.86.116.248\/shivlab\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/167.86.116.248\/shivlab\/#\/schema\/logo\/image\/","url":"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2022\/11\/stl-logo1.png","contentUrl":"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2022\/11\/stl-logo1.png","width":1280,"height":371,"caption":"Shiv Technolabs Pvt. Ltd"},"image":{"@id":"http:\/\/167.86.116.248\/shivlab\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ShivTechnolabs\/","https:\/\/x.com\/Shiv_Technolabs","https:\/\/www.linkedin.com\/company\/shivtechnolabs\/","https:\/\/www.instagram.com\/shivtechnolabs\/","https:\/\/in.pinterest.com\/ShivTechnolabs\/"]},{"@type":"Person","@id":"http:\/\/167.86.116.248\/shivlab\/#\/schema\/person\/881e4ba4247b26ad41c7f8284086ab5f","name":"Kishan Mehta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/167.86.116.248\/shivlab\/#\/schema\/person\/image\/","url":"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2023\/07\/kishan-mehta-150x150.png","contentUrl":"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2023\/07\/kishan-mehta-150x150.png","caption":"Kishan Mehta"},"description":"I am a dynamic and visionary Managing Director of Shiv Technolabs, a leading IT company at the forefront of innovation. With over a decade of hands-on experience in mobile app development, web development, and eCommerce solutions, I am a qualified professional. My expertise goes beyond technical proficiency, containing a keen understanding of evolving market dynamics. I have successfully delivered exceptional IT solutions, catering to the unique needs of entrepreneurs and businesses across diverse industries.","sameAs":["http:\/\/167.86.116.248\/shivlab\/","https:\/\/www.facebook.com\/kishan.2204","https:\/\/www.instagram.com\/kishanmehta2204\/","https:\/\/www.linkedin.com\/in\/kishan-mehta\/","https:\/\/x.com\/KishanRMehta","https:\/\/www.youtube.com\/@ShivTechnolabs"],"url":"http:\/\/167.86.116.248\/shivlab\/author\/kishan_mehta\/"}]}},"jetpack_featured_media_url":"http:\/\/167.86.116.248\/shivlab\/wp-content\/uploads\/2024\/04\/Mastering-Android-Architecture-A-Tutorial-on-MVP-or-MVVM.jpg","_links":{"self":[{"href":"http:\/\/167.86.116.248\/shivlab\/wp-json\/wp\/v2\/posts\/9376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/167.86.116.248\/shivlab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/167.86.116.248\/shivlab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/167.86.116.248\/shivlab\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/167.86.116.248\/shivlab\/wp-json\/wp\/v2\/comments?post=9376"}],"version-history":[{"count":1,"href":"http:\/\/167.86.116.248\/shivlab\/wp-json\/wp\/v2\/posts\/9376\/revisions"}],"predecessor-version":[{"id":9385,"href":"http:\/\/167.86.116.248\/shivlab\/wp-json\/wp\/v2\/posts\/9376\/revisions\/9385"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/167.86.116.248\/shivlab\/wp-json\/wp\/v2\/media\/9377"}],"wp:attachment":[{"href":"http:\/\/167.86.116.248\/shivlab\/wp-json\/wp\/v2\/media?parent=9376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/167.86.116.248\/shivlab\/wp-json\/wp\/v2\/categories?post=9376"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/167.86.116.248\/shivlab\/wp-json\/wp\/v2\/tags?post=9376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}