{"id":17719,"date":"2013-10-01T13:34:40","date_gmt":"2013-10-01T10:34:40","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=17719"},"modified":"2013-10-25T17:53:39","modified_gmt":"2013-10-25T14:53:39","slug":"android-header-and-footer-layout-example","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html","title":{"rendered":"Android Header and Footer layout example"},"content":{"rendered":"<p>In this article we are going to see how you can create a simple Android Layout that includes a header part, a footer part and the content area. It is relatively easy to do that in the Android platform. The important bit is to try to make your layouts reusable and independent from one another, so you can use it anywhere in your application, not just in one Activity. So that&#8217;s what are we going to do in this example.<\/p>\n<p>For this tutorial, we will use the following tools in a Windows 64-bit platform:<\/p>\n<ol>\n<li>JDK 1.7<\/li>\n<li>Eclipse 4.3 Kepler<\/li>\n<li>Android SKD 4.3<\/li>\n<\/ol>\n<h2>1. Create a new Android Project<\/h2>\n<p>Open Eclipse IDE and go to File -&gt; New -&gt; Project -&gt; Android -&gt; Android Application Project.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-android-project1.jpg\"><img decoding=\"async\" alt=\"new-android-project\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-android-project1.jpg\" width=\"513\" height=\"486\" \/><\/a><\/p>\n<p>You have to specify the Application Name, the Project Name and the Package name in the appropriate text fields and then click Next.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-android-app.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-18426\" alt=\"new-android-app\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-android-app.jpg\" width=\"531\" height=\"438\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-android-app.jpg 531w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-android-app-300x247.jpg 300w\" sizes=\"(max-width: 531px) 100vw, 531px\" \/><\/a><\/p>\n<p>In the next window make sure the \u201cCreate activity\u201d option is selected in order to create a new activity for your project, and click Next. This is optional as you can create a new activity after creating the project, but you can do it all in one step.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/configure-project1.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-18427\" alt=\"configure-project\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/configure-project1.jpg\" width=\"523\" height=\"437\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/configure-project1.jpg 523w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/configure-project1-300x250.jpg 300w\" sizes=\"(max-width: 523px) 100vw, 523px\" \/><\/a><\/p>\n<p>Select \u201cBlankActivity\u201d and click Next.<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"http:\/\/1-ps.googleusercontent.com\/x\/www.javacodegeeks.com\/cdn.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/xcreate-blanc-activity.jpg.pagespeed.ic.GZgcABlIZD.webp\" width=\"528\" height=\"502\" \/><\/p>\n<p>You will be asked to specify some information about the new activity. \u00a0In the Layout Name text field you have to specify the name of the file that will contain the layout description of your app. In our case the file\u00a0<code>res\/layout\/main.xml<\/code>\u00a0will be created. Then, click Finish.<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"http:\/\/cdn.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/new-activity-attr.jpg\" \/><\/p>\n<h2>2. Creating the layout of the Main Activity<\/h2>\n<p>Open\u00a0<code>res\/layout\/main.xml<\/code>\u00a0file :<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/package-explorer.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-18429\" alt=\"package-explorer\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/package-explorer.jpg\" width=\"388\" height=\"572\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/package-explorer.jpg 388w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/package-explorer-203x300.jpg 203w\" sizes=\"(max-width: 388px) 100vw, 388px\" \/><\/a><\/p>\n<p>And paste the following code :<\/p>\n<p><span style=\"text-decoration: underline;\"><em>main.xml:<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;RelativeLayout 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\" &gt;\r\n\r\n    &lt;!-- Header aligned to top --&gt;\r\n\r\n    &lt;RelativeLayout\r\n        android:id=\"@+id\/header\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_alignParentTop=\"true\"\r\n        android:background=\"#FC9\"\r\n        android:gravity=\"center\" &gt;\r\n\r\n        &lt;TextView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:layout_margin=\"5dp\"\r\n            android:text=\"Fixed Header\"\r\n            android:textColor=\"#000\"\r\n            android:textSize=\"20sp\" \/&gt;\r\n    &lt;\/RelativeLayout&gt;\r\n\r\n    &lt;!-- Footer aligned to bottom --&gt;\r\n\r\n    &lt;RelativeLayout\r\n        android:id=\"@+id\/footer\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_alignParentBottom=\"true\"\r\n        android:background=\"#FC0\"\r\n        android:gravity=\"center\" &gt;\r\n\r\n        &lt;TextView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:layout_margin=\"5dp\"\r\n            android:text=\"Fixed Footer\"\r\n            android:textColor=\"#000\"\r\n            android:textSize=\"20sp\" \/&gt;\r\n    &lt;\/RelativeLayout&gt;\r\n\r\n    &lt;!-- Content below header and above footer --&gt;\r\n\r\n    &lt;RelativeLayout\r\n        android:id=\"@+id\/content\"\r\n        android:layout_width=\"fill_parent\"\r\n        android:layout_height=\"fill_parent\"\r\n        android:layout_above=\"@id\/footer\"\r\n        android:layout_below=\"@id\/header\"\r\n        android:gravity=\"center\" &gt;\r\n\r\n        &lt;TextView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:text=\"Content\"\r\n            android:textColor=\"#33E\"\r\n            android:textSize=\"20sp\" \/&gt;\r\n    &lt;\/RelativeLayout&gt;\r\n\r\n&lt;\/RelativeLayout&gt;<\/pre>\n<p>The idea here is very simple. We have two\u00a0<code>RelativeLayouts<\/code>, one aligned at the top of the screen, using<code>android:layout_alignParentTop=\"true\"<\/code>\u00a0property, and one aligned at the bottom of the screen using<code>android:layout_alignParentBottom=\"true\"<\/code>\u00a0property. Then we simply place a\u00a0<code>RelativeLayout<\/code>\u00a0between these two view using\u00a0<code>android:layout_above=\"@id\/footer\"<\/code>\u00a0and\u00a0<code>android:layout_below=\"@id\/header\"<\/code>. These properties will place our\u00a0<code>RelativeLayout<\/code> with id <code>content<\/code>, representing the content area of our Layout, above the element with id\u00a0<code>footer<\/code>\u00a0and bellow the element with id\u00a0<code>header<\/code>.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>You can preview the layout you&#8217;ve created in the Graphical Layout editor:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/graphical-layout.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-18431\" alt=\"graphical-layout\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/graphical-layout.jpg\" width=\"641\" height=\"630\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/graphical-layout.jpg 641w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/graphical-layout-300x294.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/graphical-layout-42x42.jpg 42w\" sizes=\"(max-width: 641px) 100vw, 641px\" \/><\/a><\/p>\n<h2>2. Code the Main Activity<\/h2>\n<p>Use the Package Explorer to navigate to the Java file of the Activity you\u2019ve created:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/main-activity.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-18430\" alt=\"main-activity\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/main-activity.jpg\" width=\"388\" height=\"325\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/main-activity.jpg 388w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/main-activity-300x251.jpg 300w\" sizes=\"(max-width: 388px) 100vw, 388px\" \/><\/a><\/p>\n<p>For this example you don\u2019t have to change anything to the auto generated code so you can leave it as it is.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>MainActivity.java:<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.android.androidlayoutsexample;\r\n\r\nimport android.os.Bundle;\r\nimport android.app.Activity;\r\nimport android.view.Menu;\r\n\r\npublic class MainActivity extends Activity {\r\n\r\n\t@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.main);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\r\n\t\t\/\/ Inflate the menu; this adds items to the action bar if it is present.\r\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}\r\n}<\/pre>\n<h2>4. Run the application<\/h2>\n<p>This is how our Layout looks on the emulator:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/android-emulator.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-18428\" alt=\"android-emulator\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/android-emulator.jpg\" width=\"256\" height=\"470\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/android-emulator.jpg 256w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/android-emulator-163x300.jpg 163w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><\/p>\n<h2>Making your Layout flexible<\/h2>\n<p>In the above code we sort of hard coded everything\u00a0in the main layout of the activity. But you may want to inflate the contents of each layout\u00a0dynamically in your code. Or, more importantly you may want to make this layout reusable to your other activities, each one having their own contents to display and may be their own headers and footers.<\/p>\n<p>To achieve that, we are simply going to separate every component from the other. We are going to create the header layout to a different XML file and do the same for the footer. Now, every activity that has its own content can include the header and the footer in their own Layouts.<\/p>\n<p>To create a new XML Layout file containing the items you want to fill your\u00a0<code>ScrollView<\/code>\u00a0with. To create a new layout file, go to the Package Explorer and find\u00a0<code>\/res\/layout<\/code>\u00a0folder. Right Click on the folder -&gt; New -&gt; Other -&gt; Android -&gt; Android XML Layout file:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-layout-file.jpg\"><img decoding=\"async\" alt=\"new-layout-file\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-layout-file.jpg\" width=\"598\" height=\"532\" \/><\/a><\/p>\n<p>Put a name for your new layout file, and select RelativeLayout from the list (although this is not absolutely necessary) and click \u201cFinish\u201d:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/header-xml.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-18434\" alt=\"header-xml\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/header-xml.jpg\" width=\"503\" height=\"479\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/header-xml.jpg 503w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/header-xml-300x285.jpg 300w\" sizes=\"(max-width: 503px) 100vw, 503px\" \/><\/a><\/p>\n<p>You need to create <code>footer.xml<\/code> also.<\/p>\n<p>So,after the creation of the new layout XML files, this is the new Project Structure:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-project-structure1.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-18435\" alt=\"new-project-structure\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-project-structure1.jpg\" width=\"393\" height=\"580\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-project-structure1.jpg 393w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/new-project-structure1-203x300.jpg 203w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/a><\/p>\n<p><span style=\"text-decoration: underline;\"><em>header.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;RelativeLayout\r\n        android:id=\"@+id\/footer\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_alignParentBottom=\"true\"\r\n        android:background=\"#FC0\"\r\n        android:gravity=\"center\" &gt;\r\n\r\n        &lt;TextView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:layout_margin=\"5dp\"\r\n            android:text=\"Fixed Footer\"\r\n            android:textColor=\"#000\"\r\n            android:textSize=\"20sp\" \/&gt;\r\n    &lt;\/RelativeLayout&gt;<\/pre>\n<p><span style=\"text-decoration: underline;\"><em>footer.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;RelativeLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    android:id=\"@+id\/footer\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:layout_alignParentBottom=\"true\"\r\n    android:background=\"#FC0\"\r\n    android:gravity=\"center\" &gt;\r\n\r\n    &lt;TextView\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_margin=\"5dp\"\r\n        android:text=\"Fixed Footer\"\r\n        android:textColor=\"#000\"\r\n        android:textSize=\"20sp\" \/&gt;\r\n\r\n&lt;\/RelativeLayout&gt;<\/pre>\n<p><span style=\"text-decoration: underline;\"><em>main.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;RelativeLayout 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\" &gt;\r\n\r\n    &lt;!-- Header aligned to top --&gt;\r\n\r\n    &lt;include layout=\"@layout\/header\" \/&gt;\r\n\r\n    &lt;!-- Footer aligned to bottom --&gt;\r\n\r\n    &lt;include layout=\"@layout\/footer\" \/&gt;\r\n\r\n    &lt;!-- Content below header and above footer --&gt;\r\n\r\n    &lt;RelativeLayout\r\n        android:id=\"@+id\/content\"\r\n        android:layout_width=\"fill_parent\"\r\n        android:layout_height=\"fill_parent\"\r\n        android:layout_above=\"@id\/footer\"\r\n        android:layout_below=\"@id\/header\"\r\n        android:gravity=\"center\" &gt;\r\n\r\n        &lt;TextView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:text=\"Content\"\r\n            android:textColor=\"#33E\"\r\n            android:textSize=\"20sp\" \/&gt;\r\n    &lt;\/RelativeLayout&gt;\r\n\r\n&lt;\/RelativeLayout&gt;<\/pre>\n<p>As you can see we&#8217;ve simply separated the RelativeLayouts of the header and the footer to different XML files. So now, you can include them in any Layout you want. You can do that by writting <code>&lt;include layout=\"@layout\/header\" \/&gt;<\/code> to include the header and <code>&lt;include layout=\"@layout\/footer\" \/&gt;<\/code> (<code>header<\/code> and <code>footer<\/code> must correspond to the names you gave to the respective XML Layout files)<\/p>\n<h2>Run the application<\/h2>\n<p>This is how our Layout looks on the emulator:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/android-emulator.jpg\"><img decoding=\"async\" alt=\"android-emulator\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/android-emulator.jpg\" width=\"256\" height=\"470\" \/><\/a><\/p>\n<h3>Download Eclipse Project<\/h3>\n<p>This was an Android example on how to create\u00a0fixed Header and Footer reusable layouts. Download the Eclipse Project of this tutorial:\u00a0<a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/AndroidLayoutsExample.zip\">AndroidLayoutsExample.zip<\/a><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/AndroidScrollableContent.zip\"><br \/>\n<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article we are going to see how you can create a simple Android Layout that includes a header part, a footer part and the content area. It is relatively easy to do that in the Android platform. The important bit is to try to make your layouts reusable and independent from one another, &hellip;<\/p>\n","protected":false},"author":7,"featured_media":46,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-17719","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android-core"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Header and Footer layout example<\/title>\n<meta name=\"description\" content=\"In this article we are going to see how you can create a simple Android Layout that includes a header part, a footer part and the content area. It is\" \/>\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.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Header and Footer layout example\" \/>\n<meta property=\"og:description\" content=\"In this article we are going to see how you can create a simple Android Layout that includes a header part, a footer part and the content area. It is\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-10-01T10:34:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-10-25T14:53:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Nikos Maravitsas\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikos Maravitsas\" \/>\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\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html\"},\"author\":{\"name\":\"Nikos Maravitsas\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/aca65ecdda8de63ce629d2754da61f11\"},\"headline\":\"Android Header and Footer layout example\",\"datePublished\":\"2013-10-01T10:34:40+00:00\",\"dateModified\":\"2013-10-25T14:53:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html\"},\"wordCount\":722,\"commentCount\":11,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"articleSection\":[\"Android Core\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html\",\"name\":\"Android Header and Footer layout example\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"datePublished\":\"2013-10-01T10:34:40+00:00\",\"dateModified\":\"2013-10-25T14:53:39+00:00\",\"description\":\"In this article we are going to see how you can create a simple Android Layout that includes a header part, a footer part and the content area. It is\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/10\\\/android-header-and-footer-layout-example.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/android\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Android Core\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/android\\\/android-core\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Android Header and Footer layout example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/aca65ecdda8de63ce629d2754da61f11\",\"name\":\"Nikos Maravitsas\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3969f52bbf541170fe1ae074a6848e1085b8180438db323f626a436a7d19b23f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3969f52bbf541170fe1ae074a6848e1085b8180438db323f626a436a7d19b23f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3969f52bbf541170fe1ae074a6848e1085b8180438db323f626a436a7d19b23f?s=96&d=mm&r=g\",\"caption\":\"Nikos Maravitsas\"},\"description\":\"Nikos has graduated from the Department of Informatics and Telecommunications of The National and Kapodistrian University of Athens.\",\"sameAs\":[\"http:\\\/\\\/www.javacodegeeks.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/nikos-maravitsas\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Header and Footer layout example","description":"In this article we are going to see how you can create a simple Android Layout that includes a header part, a footer part and the content area. It is","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.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html","og_locale":"en_US","og_type":"article","og_title":"Android Header and Footer layout example","og_description":"In this article we are going to see how you can create a simple Android Layout that includes a header part, a footer part and the content area. It is","og_url":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-10-01T10:34:40+00:00","article_modified_time":"2013-10-25T14:53:39+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","type":"image\/jpeg"}],"author":"Nikos Maravitsas","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Nikos Maravitsas","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html"},"author":{"name":"Nikos Maravitsas","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/aca65ecdda8de63ce629d2754da61f11"},"headline":"Android Header and Footer layout example","datePublished":"2013-10-01T10:34:40+00:00","dateModified":"2013-10-25T14:53:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html"},"wordCount":722,"commentCount":11,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","articleSection":["Android Core"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html","url":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html","name":"Android Header and Footer layout example","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","datePublished":"2013-10-01T10:34:40+00:00","dateModified":"2013-10-25T14:53:39+00:00","description":"In this article we are going to see how you can create a simple Android Layout that includes a header part, a footer part and the content area. It is","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/10\/android-header-and-footer-layout-example.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Android","item":"https:\/\/www.javacodegeeks.com\/category\/android"},{"@type":"ListItem","position":3,"name":"Android Core","item":"https:\/\/www.javacodegeeks.com\/category\/android\/android-core"},{"@type":"ListItem","position":4,"name":"Android Header and Footer layout example"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/aca65ecdda8de63ce629d2754da61f11","name":"Nikos Maravitsas","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3969f52bbf541170fe1ae074a6848e1085b8180438db323f626a436a7d19b23f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3969f52bbf541170fe1ae074a6848e1085b8180438db323f626a436a7d19b23f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3969f52bbf541170fe1ae074a6848e1085b8180438db323f626a436a7d19b23f?s=96&d=mm&r=g","caption":"Nikos Maravitsas"},"description":"Nikos has graduated from the Department of Informatics and Telecommunications of The National and Kapodistrian University of Athens.","sameAs":["http:\/\/www.javacodegeeks.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/nikos-maravitsas"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/17719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=17719"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/17719\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/46"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=17719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=17719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=17719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}