Uploaded by mzh.ncbae

lab 7

advertisement
Department of Computer Sciences
Lab Journal 07
(Fall 2020)
Course:
Date:
Android
Application
Development
Course Code:
Faculty’s
Name:
Max Marks: 20
Name:
Enroll No:
Objective(s):
• To get student understand advance layout properties and object properties with in
android xml files
Lab Tasks:
Task 1: Create five layouts as layout_1,layout_2,layout_3
Task 2: See if different layouts are opening after changing class name in content view
Task 3: Create design in each layout as shown below
Task Bonus: Can we Decompile Android APK If yes then how.
Lab Grading Sheet :
Task
Max
Marks
1.
6
2.
7
3.
7
Total
20
Obtaine
d
Marks
Comments(if any)
Signature
Note : Attempt all tasks and get them checked by your Lab Instructor
Lab – Android Development Environment
To get student understand advance layout properties and object tagged properties with in android
xml files
Each layout has a set of attributes which define the visual properties of that layout. There are few
common attributes among all the layouts and there are other attributes which are specific to that
layout. Following are common attributes and will be applied to all the layouts:
android:id

This is the ID which uniquely identifies the view. 
android:layout_width

This is the width of the layout.. 
android:layout_height

This is the height of the layout. 
android:layout_marginTop

This is the extra space on the top side of the layout. 
android:layout_marginBottom

This is the extra space on the bottom side of the layout. 
android:layout_gravity

This specifies how child Views are positioned.. 
Here width and height are the dimension of the layout/view which can be specified in terms of dp
(Density-independent Pixels), sp ( Scale-independent Pixels), pt ( Points which is 1/72 of an inch),
px( Pixels), mm ( Millimeters) and finally in (inches).
You can specify width and height with exact measurements but more often, you will use one of
these constants to set the width or height −

android:layout_width=wrap_content tells your view to size itself to the dimensions
required by its content.

android:layout_width=fill_parent tells your view to become as big as its parent view.
Layout_1
Properties Required

Layout Width

Margin Top

Margin Bottom

Layout Gravity
Layout_2
Properties Required

Layout Width

Margin Top

Margin Bottom

Layout Gravity
Layout_3
Properties Required

Layout Width

Margin Top

Margin Bottom

Layout Gravity

Padding Top
Download