0% found this document useful (0 votes)
8 views

lab5

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

lab5

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

MOBILE PROGRAMMING Prepared by:

Eng. Marwa ELDeeb


I
APPLICATION
ANDROID MANIFEST FILE
 An application is just a collection of components held together by
a manifest file,
The manifest file provides essential information about your app to
the Android operating system, and Google Play store.
The Android manifest file helps to declare the permissions that an
app must have to access data from other apps.
The Android manifest file also specifies the app’s package name
that helps the Android SDK while building the app.
The Android manifest file provides information such as activities,
services, broadcast receivers, and content providers of an android
application.
ANDROID MANIFEST .XML
1. manifest The main component of the AndroidManifest.xml file is
known as manifest. Additionally, the packaging field describes the
activity class’s package name.
ANDROID MANIFEST .XML
2. uses-sdk It is used to define a minimum and maximum SDK
version by means of an API Level integer that must be available on
a device so that our application functions properly
ANDROID MANIFEST .XML
3. uses-permission It outlines a system permission that must be
granted by the user for the app to function properly and is
contained within the <manifest> element. When an application is
installed (on Android 5.1 and lower devices or Android 6.0 and
higher), the user must grant the application permissions.
ANDROID MANIFEST .XML
4. application A manifest can contain only one application node.
It uses attributes to specify the metadata for your application
(including its title, icon, and theme).
ANDROID MANIFEST .XML
5. uses-library It defines a shared library against which the
application must be linked. This element instructs the system to
add the library’s code to the package’s class loader. It is contained
within the <application> element.
ANDROID MANIFEST .XML
6. activity The Activity sub-element of an application refers to an
activity that needs to be specified in the AndroidManifest.xml file. It
has various characteristics, like label, name, theme, launchMode,
and others. In the manifest file, all elements must be represented
by <activity>. Any activity that is not declared there won’t run and
won’t be visible to the system. It is contained within the
<application> element.
ANDROID MANIFEST .XML
APPLICATION
• java: all Java & Kotlin files are organized
here
• res: all Android resource files will go here
• Drawable: images, compound drawables
• Layout: layout files for Activities,
Fragments, custom Views
• Values: other value types; strings, colors,
styles, etc.
BUILD FILE
2 build.gradle files present in the application:
1. root level controls configuration for entire project
2. app level controls configuration and dependencies for the
application module
UI TYPE
The View is the base class or we can say that it is the superclass
for all the GUI components in android. For example, the EditText
class is used to accept the input from users in android apps, which
is a subclass of View, and another example of the TextView class
which is used to display text labels in Android apps is also a
subclass of View. ” a self-contained element drawn to the screen”
ViewGroup is a subclass of the View class. And also it will act as
a base class for layouts and layouts parameters. The ViewGroup
will provide an invisible container to hold other Views or
ViewGroups and to define the layout properties. For example,
Linear Layout is the ViewGroup that contains UI controls like
Button, TextView, etc” define how views should be drawn on screen
in relation to one another”
LINEAR LAYOUT
a view group that aligns all children in a single direction, vertically
or horizontally. You can specify the layout direction with the
android:orientation attribute.
LINEAR LAYOUT
LAYOUT FILE "TEXT VIEW”
The activity_main. xml file is where we are going to style what the
user sees and interacts with when they are viewing the application.
layouts in Android are written in eXtensible Markup Language
(XML).
Note:” The Android wrap_content: sets a view's size to
wrap_content which will only expand enough to contain the
values.”
LAYOUT FILE "TEXT VIEW”
The activity_main. xml file is where we are going to style what the
user sees and interacts with when they are viewing the application.
layouts in Android are written in eXtensible Markup Language
(XML).
ACTIVITY LIFE CYCLE
ACTIVITY LIFE CYCLE
onCreate() Created but not yet active
on the screen

onStart() Activity is visible but not


quite ready to receive focus or
interaction

onResume() Activity is visible and


active in the app foreground

onPause() Activity is visible, but


something has taken foreground
priority

onStop() Activity is no longer visible on


screen
THANKS Eng.Marwa
ELDeeb

You might also like