{"id":83884,"date":"2021-08-26T09:00:35","date_gmt":"2021-08-26T03:30:35","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=83884"},"modified":"2024-08-05T21:47:50","modified_gmt":"2024-08-05T16:17:50","slug":"android-gridlayout","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/","title":{"rendered":"Android GridLayout with Example and Implementation"},"content":{"rendered":"<p>Android GridLayout is used to display elements and views in the form of a rectangular grid. GirdLayout and GridView are two completely different terms and are used for other purposes. GridView is a view, whereas GridLayout is a layout that can hold various views in it. Using GridView, you can display the items that are coming from the Adapter.<\/p>\n<p>GridLayout allows you to place many views and elements inside the layout and then style them. It allows you to set the number of rows and columns for your grid. So through this article, we will try to understand how you can use GridLayout while designing your layouts.<\/p>\n<h3>About GridLayout<\/h3>\n<p>Android provides you with a feature to style your app screens using various types of layouts. Some of the most commonly used layouts are LinearLayout, Constraint Layout, RelativeLayout, and GridLayout.<\/p>\n<p>Suppose you need to display the elements linearly, whether horizontally or vertically; you can use LinearLayout. Similarly, if you wish to display elements and views in rows and columns, you use the GridLayout.<\/p>\n<p>Let\u2019s see how you can create a GridLayout in Android.<\/p>\n<p><strong>XML Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;GridLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:rowCount=\"4\"\r\n    android:columnCount=\"2\"\r\n    android:background=\"#3F51B5\"\r\n    tools:context=\".MainActivity\"&gt;\r\n\r\n&lt;\/GridLayout&gt;\r\n<\/pre>\n<p>Now let\u2019s see how you can add several child elements in your GridLayout. The child elements can be any view element, such as Buttons, ImageViews, TextViews, etc. Below is an example that shows you how you can add child elements in a GridLayout.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;GridLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:rowCount=\"4\"\r\n    android:columnCount=\"2\"\r\n    android:background=\"#3F51B5\"\r\n    tools:context=\".MainActivity\"&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"130dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_1\"\r\n        \/&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"200dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_2\"\r\n        \/&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"130dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_3\"\r\n        \/&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"200dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_4\"\r\n        \/&gt;\r\n\r\n\r\n&lt;\/GridLayout&gt;\r\n<\/pre>\n<p>So in the above code, we have added four child elements in your GridLayout.<\/p>\n<h3>Specification of Android GridLayout<\/h3>\n<h4>1. Row and Column Specs<\/h4>\n<p>Using the row and column specs, you can specify the exact number of rows and columns needed, as well as how elements should be oriented within them. These specs allow you to define the position and span of each element, ensuring precise control over the layout. You can use rowSpec and columnSpec layout parameters to achieve this, providing a flexible way to align elements based on the design requirements.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var rowSpec: GridLayout.Spec!\r\n\r\nvar columnSpec: GridLayout.Spec!\r\n<\/pre>\n<h4>2. Default Cell Assignment<\/h4>\n<p>If an element doesn\u2019t specify its exact position in the grid, GridLayout automatically assigns its position. This automatic assignment is determined by the grid&#8217;s orientation, and the rowCount and columnCount properties. This feature helps maintain a clean and organized layout, ensuring that elements are placed logically even when explicit positioning is not provided.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">open fun setOrientation(orientation: Int): Unit\r\n\r\nopen fun setRowCount(rowCount: Int): Unit\r\n\r\nopen fun setColumnCount(columnCount: Int): Unit<\/pre>\n<h4>3. Space<\/h4>\n<p>To provide space between the elements of the grid, you can use the topMargin, bottomMargin, leftMargin, and rightMargin layout parameters. These margins help in creating a visually appealing and uncluttered layout by adding padding around each element. This ensures that elements are not cramped together and improves the overall readability and usability of the interface.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var topMargin: Int\r\n\r\nvar bottomMargin: Int\r\n\r\nvar leftMargin: Int\r\n\r\nvar rightMargin: Int\r\n<\/pre>\n<p>After setting up the above values you need to invoke the below method.<\/p>\n<p>ViewGroup#setLayoutParams(LayoutParams)<\/p>\n<h3>Attributes of GridLayout in Android<\/h3>\n<table>\n<tbody>\n<tr>\n<td><b>Attribute Name<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">android:columnCount<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The \u201ccolumnCount\u201d attribute is used to specify the maximum number of columns you can attain while positioning the elements.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">android:columnOrderPreserved<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The \u201ccolumnOrderPreserved\u201d when true makes the column boundaries follow the column indices.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">android:rowCount<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The \u201crowCount\u201d specifies the maximum number of rows you can attain while positioning the elements.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">android:rowOrderPreserved<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The \u201crowOrderPreserved\u201d, when set true, makes the row boundaries follow the row indices.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">android:useDefaultMargins<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The \u201cuseDefaultMargins\u201d attribute is used to specify whether or not to use the default margins for your GridLayout. It has true or false values.\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Methods involved in Android GridLayout<\/h3>\n<p>GridLayout has several public methods that allow us to manage and add functionalities to the layout.<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Method Name<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">getAlignmentMode()<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It is used to know the current alignment mode.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">getColumnCount()<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It is used to get the number of columns you can have at max while positioning elements.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">getRowCount()<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It is used to get the number of rows you can have at max while positioning elements.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">setAlignmentMode(alignmentMode: Int)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Using the setAlignmentMode() you can set the alignment of your GridLayout whether top, left, right, center, etc.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">setColumnCount(columnCount: Int)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It is used to set the number of columns you can have at max while positioning elements.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">setColumnOrderPreserved(columnOrderPreserved: Boolean)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It is used to make the column boundaries follow the order of column indices.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">setRowCount(rowCount: Int)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It is used to set the number of rows you can have at max while positioning elements.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">setRowOrderPreserved(rowOrderPreserved: Boolean)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It is used to make the row boundaries follow the order of row indices.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">setUseDefaultMargins(useDefaultMargins: Boolean)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It is used to specify that the GridLayout would use default margins or not.\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Implementation of Android GridLayout<\/h3>\n<p>Now, let&#8217;s try to figure out how you can create your GridLayout in Android. For implementing the GridLayout, you need to follow the below steps nicely.<\/p>\n<p><strong>1:<\/strong> Go ahead, start your Android Studio and click on create a new project.<\/p>\n<p><strong>2:<\/strong> Select Empty Activity and then provide a name to your application.<\/p>\n<p><strong>3:<\/strong> Now, open your activity_main.xml and paste in the code below.<\/p>\n<p><strong>Code: activity_main.xml<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;GridLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:rowCount=\"4\"\r\n    android:columnCount=\"2\"\r\n    android:background=\"#3F51B5\"\r\n    tools:context=\".MainActivity\"&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"130dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_1\"\r\n        \/&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"200dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_2\"\r\n        \/&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"130dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_3\"\r\n        \/&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"200dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_4\"\r\n        \/&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"130dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_5\"\r\n        \/&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"220dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_6\"\r\n        \/&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"130dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_7\"\r\n        \/&gt;\r\n\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"200dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_8\"\r\n        \/&gt;\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"130dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:src=\"@drawable\/image_9\"\r\n        \/&gt;\r\n    &lt;ImageView\r\n        android:layout_height=\"90dp\"\r\n        android:layout_width=\"130dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:layout_marginLeft=\"40dp\"\r\n        android:src=\"@drawable\/image_10\"\r\n        \/&gt;\r\n\r\n\r\n&lt;\/GridLayout&gt;\r\n<\/pre>\n<p>That&#8217;s it. Your GridLayout is now successfully implemented in your Android application. Now simply run your application, and you can see your GridLayout successfully created. Since we have kept rowCount as four and column count as 2. Therefore we see that we have two blocks in each row.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/08\/image2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-84326\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/08\/image2.jpg\" alt=\"Android Grid layout\" width=\"947\" height=\"1999\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>Through this article, you understood what a GridLayout is and how it is different from GridView. Later on, you saw the specifications, attributes, and methods of the GridLayout. Finally, you saw how you could implement GridLayout in your Android apps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android GridLayout is used to display elements and views in the form of a rectangular grid. GirdLayout and GridView are two completely different terms and are used for other purposes. GridView is a view,&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":84324,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2791],"tags":[4099,4100,4101],"class_list":["post-83884","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android-gridlayout","tag-android-gridlayout-example","tag-android-gridlayout-implementation"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android GridLayout with Example and Implementation - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn what id GridLayout &amp; how it is different from GridView in Android. See the specifications, attributes, &amp; methods of Android GridLayout.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android GridLayout with Example and Implementation - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn what id GridLayout &amp; how it is different from GridView in Android. See the specifications, attributes, &amp; methods of Android GridLayout.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-26T03:30:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-05T16:17:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android-GridLayout.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android GridLayout with Example and Implementation - TechVidvan","description":"Learn what id GridLayout & how it is different from GridView in Android. See the specifications, attributes, & methods of Android GridLayout.","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:\/\/techvidvan.com\/tutorials\/android-gridlayout\/","og_locale":"en_US","og_type":"article","og_title":"Android GridLayout with Example and Implementation - TechVidvan","og_description":"Learn what id GridLayout & how it is different from GridView in Android. See the specifications, attributes, & methods of Android GridLayout.","og_url":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-08-26T03:30:35+00:00","article_modified_time":"2024-08-05T16:17:50+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android-GridLayout.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Android GridLayout with Example and Implementation","datePublished":"2021-08-26T03:30:35+00:00","dateModified":"2024-08-05T16:17:50+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/"},"wordCount":902,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android-GridLayout.jpg","keywords":["Android GridLayout","Android GridLayout example","Android GridLayout implementation"],"articleSection":["Android Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/","url":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/","name":"Android GridLayout with Example and Implementation - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android-GridLayout.jpg","datePublished":"2021-08-26T03:30:35+00:00","dateModified":"2024-08-05T16:17:50+00:00","description":"Learn what id GridLayout & how it is different from GridView in Android. See the specifications, attributes, & methods of Android GridLayout.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android-GridLayout.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android-GridLayout.jpg","width":1200,"height":628,"caption":"Android GridLayout"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/android-gridlayout\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Android GridLayout with Example and Implementation"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/83884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=83884"}],"version-history":[{"count":2,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/83884\/revisions"}],"predecessor-version":[{"id":447605,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/83884\/revisions\/447605"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/84324"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=83884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=83884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=83884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}