Skip to main content

Android Different Layout For Portrait and Landscape Mode

A problem that we face mostly while developing Android application for Multiple screen i.e designing layout such that it suits for multiple screen.In particular situation we need to design two layout, one for portrait and another for landscape.This tutorial going to focus about this.
For designing different layout for portrait and landscape  mode,you need to create folder in resource named layout-land and put layout name same as then name of layout inside layout folder.Now design layout inside layout-land for landscape mode and inside layout folder for portrait mode.
Write some code in AndroidManifest.xml
<activity android:configchanges="uiMode" 
android:label="@string/app_name" 
android:name=".SplashScreen" 
android:screenorientation="sensor">
Good luck


Comments

Popular posts from this blog

Android O New Features Overview

This post assumes, you are an experienced developer who wants to get started with the latest version of Android. Android O is not a huge update to the OS and application framework like M but it still has many useful features for both developer and an user. Android O has focus on below areas. Notification redesigned Picture-in-Picture(PIP)  Visual adaption for different devices  Battery life improved Setting app reorganized Notification redesigned: Android O notification changes includes more easy and manageable way to manager your notification behavior and settings. It includes: Notification Channel: Notification channel allows you to create user customizable channel for each type of notification you wanna display. A single application can have multiple channel, a separate channel for each type of notification you wanna display. Having said this, you can create s separate channel for audio & image notification. User can disable specific notification channe...

Display News and Videos through RSS and Display it in Listview

Hi friends , In this tutorial ,i'm going to describe about how to fetch data from rss feed.Here i had also problem ,when i was developing my recent project.I had also faced  many problem and at last i developed my best project. Here is the code that describe how to fetch news headline from rss This class describes how to parse XML data: import java.net.URL; import java.util.ArrayList; import org.xmlpull.v1.XmlPullParser; import android.content.res.XmlResourceParser; import android.util.Log; import android.util.Xml; public class XmlFeedParser {         //Feed Parsing Method     public ArrayList<Implement> parse(String url) {                 //Array of Episode Objects         ArrayList<Implement> episodes = null;          ...

Display video from specific folder with rounded shape thumbnail

Hi friends ,This is complete post, about how to display video form specific folder and display it with rounded shape and play it on click event. For Rounded shape I have used custom ImageView. Now have a look on code part. main.xml <?xml version="1.0" encoding="utf-8"?> <GridView xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/gridView1"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:columnWidth="100dp"     android:gravity="center"     android:numColumns="auto_fit"     android:stretchMode="columnWidth" > </GridView> gridlayout.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="wrap_content"     android:layo...