<br />
<b>Warning</b>:  Undefined array key "global_protection_id" in <b>/home/wikitechy/public_html/interview-questions/wp-content/plugins/content-protector/inc/class-ps-rest-handler.php</b> on line <b>51</b><br />
{"id":108,"date":"2021-07-11T05:38:31","date_gmt":"2021-07-11T05:38:31","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=108"},"modified":"2021-09-15T06:08:25","modified_gmt":"2021-09-15T06:08:25","slug":"what-is-mvp-architecture-in-android","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/","title":{"rendered":"MVP Android &#8211; What is MVP architecture in Android ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h2 id=\"what-is-mvp-architecture-in-android\" class=\"color-pink\" style=\"text-align: justify;\">What is MVP architecture in Android ?<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>MVP is a design pattern for developers to write their code in a more readable, maintainable, and scalable manner.<\/li>\n<li>In MVP, our code is divided into three parts named Model, View, and Presenter rather than placing the whole code in one activity.\n<ul>\n<li>Model\u00a0&#8211; The model handles the data part of our application.<\/li>\n<li>Presenter &#8211; It acts as a bridge that connects a Model and a View.<\/li>\n<li>View &#8211; This is responsible for laying out\u00a0<a href=\"https:\/\/www.wikitechy.com\/tutorials\/ruby-on-rails\/ruby-on-rails-mvc\" target=\"_blank\" rel=\"noopener\">views<\/a>\u00a0with the relevant data as instructed by the Presenter.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"ImageContent\" style=\"text-align: justify;\">\n<div class=\"hddn\"><img decoding=\"async\" class=\"img-responsive center-block aligncenter\" src=\"https:\/\/cdn.wikitechy.com\/interview-questions\/android\/model-view-presenter.png\" alt=\"Model View Presenter\" \/><\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"model\" class=\"color-purple\">Model<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>Everything which is related with data is a part of the Model. The Model contains a data provider and the code which fetches and updates the data.<\/li>\n<li>This part of MVP updates the database or communicates with a web server.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"presenter\" class=\"color-purple\">Presenter<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>The Presenter contains the application&#8217;s business logic and when an operation is performed or data is changed then it will notify the View that it needs to update.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"view\" class=\"color-purple\">View<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>The View part of MVP contains the visual parts of our application, like showing messages, and also handles visibility.<\/li>\n<li>View contains only that part of the code which is related to UI and it does not contain any logic related to the displayed data. The View is controlled by the Presenter.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"android-mvp-architecture\" class=\"color-purple\">Android MVP Architecture<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>The diagram below depicts a basic MVP structure.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"ImageContent\" style=\"text-align: justify;\">\n<div class=\"hddn\"><img decoding=\"async\" class=\"img-responsive center-block aligncenter\" src=\"https:\/\/cdn.wikitechy.com\/interview-questions\/android\/android-mvp-architecture.png\" alt=\" Tell me honestly about the run Android MVP Architecture\" \/><\/div>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li style=\"text-align: justify;\"><a href=\"https:\/\/www.wikitechy.com\/tutorials\/android\/how-to-set-default-activity-for-android-application\" target=\"_blank\" rel=\"noopener\">Activity<\/a>,\u00a0<a href=\"https:\/\/www.wikitechy.com\/tutorials\/android\/android-fragment\" target=\"_blank\" rel=\"noopener\">Fragment<\/a>\u00a0and a\u00a0<a href=\"https:\/\/forums.wikitechy.com\/answer\/re-create-a-custom-view-by-inflating-a-layout\/\" target=\"_blank\" rel=\"noopener\">CustomView<\/a>\u00a0act as the View part of the application.<\/li>\n<li style=\"text-align: justify;\">The Presenter is responsible for listening to user interactions (on the View) and model updates (<a href=\"https:\/\/www.wikitechy.com\/tutorials\/sqoop\/sqoop-list-database\" target=\"_blank\" rel=\"noopener\">database<\/a>,\u00a0<a href=\"https:\/\/www.wikitechy.com\/tutorials\/elasticsearch\/elasticsearch-index-api\" target=\"_blank\" rel=\"noopener\">APIs<\/a>) as well as updating the Model and the View.<\/li>\n<li style=\"text-align: justify;\">Generally, a View and Presenter are in a one to one relationship. One Presenter class manages one View at a time.<\/li>\n<li style=\"text-align: justify;\">Interfaces need to be defined and implemented to communicate between View-Presenter and Presenter-Model.<\/li>\n<li style=\"text-align: justify;\">The Presenter is responsible for handling all the background tasks. Android SDK classes must be avoided in the presenter classes.<\/li>\n<li style=\"text-align: justify;\">The View and Model classes can\u2019t have a reference of one another.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer : MVP is a design pattern for developers to write their code&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"passster_activate_protection":false,"passster_protect_child_pages":"","passster_protection_type":"password","passster_password":"","passster_activate_overwrite_defaults":"","passster_headline":"","passster_instruction":"","passster_placeholder":"","passster_button":"","passster_id":"","passster_activate_misc_settings":"","passster_redirect_url":"","passster_hide":"no","passster_area_shortcode":"","gtb_hide_title":false,"gtb_wrap_title":false,"gtb_class_title":"","gtb_remove_headerfooter":false,"footnotes":""},"categories":[105],"tags":[195,219,201,250,232,245,224,225,231,241,234,235,226,236,233,252,254,238,237,221,211,203,199,214,198,209,205,220,222,218,196,212,213,223,15930,215,244,207,258,263,255,246,251,227,253,257,249,230,260,247,259,242,256,248,240,228,204,217,202,208,239,206,210,200,197,229,261,216],"class_list":["post-108","post","type-post","status-publish","format-standard","hentry","category-android","tag-accenture-interview-questions-and-answers","tag-agreeya-solutions-interview-questions-and-answers","tag-allstate-solutions-pvt-ltd-interview-questions-and-answers","tag-android-mvp-architecture","tag-android-mvp-base-presenter","tag-android-mvp-boilerplate","tag-android-mvp-example-tutorial","tag-android-mvp-fragment","tag-android-mvp-fragment-navigation","tag-android-mvp-google","tag-android-mvp-presenter-contract","tag-android-mvp-presenter-lifecycle","tag-android-mvp-recyclerview","tag-android-mvp-retrofit-example","tag-android-mvp-sqlite-example","tag-android-mvp-tutorial","tag-android-mvp-vs-mvvm","tag-android-recyclerview-mvc","tag-android-simple-mvp-example","tag-bharti-airtel-interview-questions-and-answers","tag-bosch-india-software-interview-questions-and-answers","tag-capgemini-interview-questions-and-answers","tag-casting-networks-india-pvt-limited-interview-questions-and-answers","tag-cgi-group-inc-interview-questions-and-answers","tag-chetu-interview-questions-and-answers","tag-collabera-technologies-interview-questions-and-answers","tag-dell-international-services-india-pvt-ltd-interview-questions-and-answers","tag-electronics-arts-inc-interview-questions-and-answers","tag-flipkart-interview-questions-and-answers","tag-g-cube-webwide-software-pvt-ltd-interview-questions-and-answers","tag-ibm-interview-questions-and-answers","tag-indecomm-global-services-interview-questions-and-answers","tag-infosys-technologies-interview-questions-and-answers","tag-lava-international-ltd-interview-questions-and-answers","tag-magicbricks-interview-questions-and-answers","tag-maintec-technologies-pvt-ltd-interview-questions-and-answers","tag-mindorks-mvp","tag-mphasis-interview-questions-and-answers","tag-mvc-mvp-mvvm","tag-mvc-vs-mvp","tag-mvp","tag-mvp-android","tag-mvp-android-example","tag-mvp-android-medium","tag-mvp-android-tutorial","tag-mvp-architecture","tag-mvp-architecture-android","tag-mvp-contract-android","tag-mvp-full-form","tag-mvp-in-android","tag-mvp-login","tag-mvp-medium","tag-mvp-pattern","tag-mvp-pattern-android","tag-mvp-tutorial-for-beginners-android","tag-mvp-vs-mvvm-androidm","tag-oracle-corporation-interview-questions-and-answers","tag-peoplestrong-interview-questions-and-answers","tag-photon-interactive-pvt-ltd-interview-questions-and-answers","tag-prokarma-softech-pvt-ltd-interview-questions-and-answers","tag-recyclerview-android","tag-sap-labs-india-pvt-ltd-interview-questions-and-answers","tag-symphony-teleca-interview-questions-and-answers","tag-tech-mahindra-interview-questions-and-answers","tag-unitedhealth-group-interview-questions-and-answers","tag-vvm-architecture-android","tag-what-is-mvp","tag-wipro-interview-questions-and-answers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MVP Android - What is MVP architecture in Android ? - Android<\/title>\n<meta name=\"description\" content=\"MVP Android - What is MVP architecture in Android ? - MVP is a design pattern for developers to write their code in a more readable, maintainable, and scalable manner\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MVP Android - What is MVP architecture in Android ? - Android\" \/>\n<meta property=\"og:description\" content=\"MVP Android - What is MVP architecture in Android ? - MVP is a design pattern for developers to write their code in a more readable, maintainable, and scalable manner\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-11T05:38:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-15T06:08:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.wikitechy.com\/interview-questions\/android\/model-view-presenter.png\" \/>\n<meta name=\"author\" content=\"Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/\",\"name\":\"MVP Android - What is MVP architecture in Android ? - Android\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/android\/model-view-presenter.png\",\"datePublished\":\"2021-07-11T05:38:31+00:00\",\"dateModified\":\"2021-09-15T06:08:25+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"MVP Android - What is MVP architecture in Android ? - MVP is a design pattern for developers to write their code in a more readable, maintainable, and scalable manner\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/#primaryimage\",\"url\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/android\/model-view-presenter.png\",\"contentUrl\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/android\/model-view-presenter.png\"},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\",\"name\":\"Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"caption\":\"Editor\"},\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MVP Android - What is MVP architecture in Android ? - Android","description":"MVP Android - What is MVP architecture in Android ? - MVP is a design pattern for developers to write their code in a more readable, maintainable, and scalable manner","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":"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/","og_locale":"en_US","og_type":"article","og_title":"MVP Android - What is MVP architecture in Android ? - Android","og_description":"MVP Android - What is MVP architecture in Android ? - MVP is a design pattern for developers to write their code in a more readable, maintainable, and scalable manner","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/","og_site_name":"Wikitechy","article_published_time":"2021-07-11T05:38:31+00:00","article_modified_time":"2021-09-15T06:08:25+00:00","og_image":[{"url":"https:\/\/cdn.wikitechy.com\/interview-questions\/android\/model-view-presenter.png"}],"author":"Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Editor","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/","name":"MVP Android - What is MVP architecture in Android ? - Android","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/android\/model-view-presenter.png","datePublished":"2021-07-11T05:38:31+00:00","dateModified":"2021-09-15T06:08:25+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"MVP Android - What is MVP architecture in Android ? - MVP is a design pattern for developers to write their code in a more readable, maintainable, and scalable manner","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/android\/what-is-mvp-architecture-in-android\/#primaryimage","url":"https:\/\/cdn.wikitechy.com\/interview-questions\/android\/model-view-presenter.png","contentUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/android\/model-view-presenter.png"},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757","name":"Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","caption":"Editor"},"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=108"}],"version-history":[{"count":4,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/108\/revisions"}],"predecessor-version":[{"id":3806,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/108\/revisions\/3806"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}