Unit-3 (PPT)
Unit-3 (PPT)
AndroidManifest.xml
The Java folder contains the Java source code files. These files are used as
a controller for controlled UI (Layout file). It gets the data from the Layout
file and after processing that data output will be shown in the UI layout. It
works on the backend of an Android application.
drawable Folder :
A layout defines the visual structure for a user interface, such as the UI for
an Android application. This folder stores Layout files that are written in XML
language.
mipmap
Mipmap folder contains the Image Asset file that can be used in Android
Studio application. You can generate the icon types like Launcher icons,
Action bar and tab icons, and Notification icons.
colors.xml:
colors.xml file contains color resources of the Android application. Different color
values are identified by a unique name that can be used in the Android
application program.
The strings.xml file contains string resources of the Android application. The
different string value is identified by a unique name that can be used in
the Android application program. This file also stores string array by using
XML language.
The styles.xml file contains resources of the theme style in the Android application.
This file is written in XML language.
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
</style>
</resources>
build.gradle(Module: app):
This defines the module-specific build configurations. Here you can add
dependencies what you need in your Android application.
Fundamentals of UI Design
Views-
Views are the basic User Interface class for visual interface elements (commonly known as
controls or widgets).
All User Interface controls, and the layout classes, are derived from Views.
ViewGroups-
View Groups are extensions of the View class that can contain multiple child Views.
By extending the ViewGroup class, you can create compound controls that are made up of
interconnected child Views.
The ViewGroup class is also extended to provide the layout managers, such as LinearLayout,
that help you compose User Interfaces.
Activities-
Activities represent the window or screen being displayed to the user.
Activities are the Android equivalent of a Form.
To display a User Interface, you assign a View or layout to an Activity.
Android provides several common UI controls, widgets, and layout managers.
Layouts
It is a type of resource which gives definition on what is drawn on the screen or how
elements are placed on the device’s screen and stored as XML files in the /res/layout
resource directory for the application. It can also be a type of View class to organize
other controls.
There are many types of layout. Some of which are listed below −
1. Linear Layout
2. Absolute Layout
3. Table Layout
4. Frame Layout
5. Relative Layout
LINEAR LAYOUT
</LinearLayout>
ABSOLUTELAYOUT
Useful for overlaying views. For example, you can place a progress spinner
over other content, or a label over an image.
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/sample_image"
android:contentDescription="@string/image_desc" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Overlay Text"
android:textColor="#FFFFFF"
android:background="#AA000000" />
</FrameLayout>