R20EP094
R20EP094
Mobile technology is the technology used for cellular communication. Over the past few years, mobile
code-division multiple access (CDMA) technology has advanced quickly. Since the beginning of this
decade, a typical mobile device has evolved from being nothing more than a straightforward two-way pager
to including a mobile phone, GPS navigational tool, an embedded web browser, and instant messaging
client, as well as a portable gaming console. The future of computer technology, according to many experts,
is wireless networking and mobile computing. Many types of mobile operating systems are available for
smartphones, including Android, BlackBerry OS, IOS, Symbian, Windows Mobile, and Bada.
1.2 Android
Android is a mobile operating system based on a modified version of the Linux kernel and other
opensource software, designed primarily for touchscreen mobile devices such as smartphones and tablets.
Android was developed by the Open Handset Alliance, led by Google, and other companies. Android offers
a unified approach to application development for mobile devices which means developers need only
develop for Android, and their applications should be able to run on different devices powered by Android.
Android versions
1
1.3 Mobile Application
A mobile application, most commonly referred to as an app, is a type of application software designed
to run on a mobile device, such as a smartphone or tablet computer. Mobile applications frequently serve
to provide users with similar services to those accessed on PCs. Apps are generally small, individual
software units with limited functions. This use of app software was originally popularized by Apple Inc.
and its App Store, which offers thousands of applications for the iPhone, iPad, and iPod Touch. A mobile
application also may be known as an app, web app, online app, iPhone app, or smartphone app.
Mobile applications are a move away from the integrated software systems generally found on PCs. Instead,
each app provides limited and isolated functionality such as a game, calculator, or mobile web browsing.
Although applications may have avoided multitasking because of the limited hardware resources of the
early mobile devices, their specificity is now part of their desirability because they allow consumers to
hand-pick what their devices are able to do.
The simplest mobile apps take PC-based applications and port them to a mobile device. As mobile apps
become more robust, this technique is somewhat lacking. A more sophisticated approach involves
2
developing specifically for the mobile environment, taking advantage of both its limitations and advantages.
For example, apps that use location-based features are inherently built from the ground up with an eye to
mobile given that the user is not tied to a location, as on PC.
Apps are divided into two broad categories: native apps and web apps. Native apps are built for a specific
mobile operating system, usually iOS or Android. Native apps enjoy better performance and a more
finelytuned user interface (UI), and usually need to pass a much stricter development and quality assurance
process before they are released.
Web apps are used in HTML5 or CSS and require minimum device memory since they’re run through a
browser. The user is redirected to a specific web page, and all information is saved on a server-based
database. Web apps require a stable connection to be used.
2. Introduction to Android
The android architecture contains a different number of components to support any android device’s
needs. Android software contains an open-source Linux Kernel has a collection of a number of C/C++
libraries which are exposed through application framework services. Among all the components Linux
Kernel provides the main functionality of operating system functions to smartphones and Dalvik Virtual
Machine (DVM) provides a platform for running an android application.
• Applications
• Application Framework
• Android Runtime
• Platform Libraries
• Linux Kernel
3
Applications
Applications are the top layer of the android architecture. The pre-installed applications like home,
contacts, camera, gallery, etc, and third-party applications downloaded from the play store like chat
applications, games, etc. will be installed on this layer only. It runs within the Android run time with the
help of classes and services provided by the application framework.
Application Framework
Application Framework provides several important classes which are used to create an Android
application. It provides a generic abstraction for hardware access and also helps in managing the user
4
interface with application resources. Generally, it provides the services with the help of which we can create
a particular class and make that class helpful for the Application creation.
It includes different types of services activity manager, notification manager, view system, package manager,
etc. which are helpful for the development of our application according to the prerequisite.
Application Runtime
Android Runtime environment is one of the most important part of Android. It contains components
like core libraries and the Dalvik Virtual Machine(DVM). Mainly, it provides the base for the application
framework and powers our application with the help of the core libraries.
Like Java Virtual Machine (JVM), Dalvik Virtual Machine (DVM) is a register-based virtual machine and
specially designed and optimized for android to ensure that a device can run multiple instances efficiently.
It depends on the layer Linux Kernel for threading and low-level memory management. The core libraries
enable us to implement android applications using the standard JAVA or Kotlin programming languages.
Platform Libraries
The Platform Libraries include various C/C++ core libraries and Java-based libraries such as Media,
Graphics, Surface Manager, OpenGL etc.to provide support for android development.
• Media library provides support to play and record audio and video formats.
• Surfaces manager responsible for managing access to the display subsystem.
• SQL and OpenGL both cross-language, cross-platform application program interface(API)
are used for 2D and 3D computer graphics.
• SQLite provides database support and FreeType provides font support.
• Web-Kit This open-source web browser engine provides all the functionality to display web
content and simplify page loading.
• SSL(Secure Sockets Layer) is a security technology to establish an encrypted link between a
web server and a web browser.
Linux Kernel
Linux Kernel is the heart of android architecture. It manages all the available drivers such as
5
display drivers, camera drivers, Bluetooth drivers, audio drivers, memory drivers, etc. which are required
during the runtime.
The Linux Kernel will provide an abstraction layer between the device hardware and the other components
of the android architecture. It is responsible for the management of memory, power, devices, etc.
• Security: The Linux Kernel handles the security between the application and the system.
• Memory Management: It efficiently handles memory management thereby providing the
freedom to develop our apps.
• Process Management: It manages the process well, and allocates resources to processes
whenever they need them.
• Network Stack: It effectively handles network communication.
• Driver Model: It ensures that the application works properly on the device and
hardware manufacturers responsible for building their drivers into the Linux build.
6
3. Android Building Blocks
An android component is simply a piece of code that has a well-defined life cycle e.g. Activity, Receiver,
Service, etc. The core building blocks or fundamental components of android are activities, views,
intents, services, content providers, fragments and AndroidManifest.xml.
3.1 Activities
The mobile-app experience differs from its desktop counterpart in that a user's interaction with the app
doesn't always begin in the same place. Instead, the user journey often begins non-deterministically. For
instance, if you open an email app from your home screen, you might see a list of emails. By contrast, if
you are using a social media app that then launches your email app, you might go directly to the email app's
screen for composing an email. The Activity class is designed to facilitate this paradigm. When one app
invokes another, the calling app invokes an activity in the other app, rather than the app as an atomic whole.
In this way, the activity serves as the entry point for an app's interaction with the user. You implement an
activity as a subclass of the Activity class. An activity provides the window in which the app draws its UI.
This window typically fills the screen but may be smaller than the screen and float on top of other windows.
Generally, one activity implements one screen in an app. For instance, one of an app’s activities may
implement a Preferences screen, while another activity implements a Select Photo screen. Most apps
contain multiple screens, which means they comprise multiple activities. Typically, one activity in an app
is specified as the main activity, which is the first screen to appear when the user launches the app. Each
activity can then start another activity in order to perform different actions. For example, the main activity
in a simple e-mail app may provide a screen that shows an e-mail inbox. From there, the main activity might
launch other activities that provide screens for tasks like writing e-mails and opening individual e-mails.
Although activities work together to form a cohesive user experience in an app, each activity is only loosely
bound to the other activities; there are usually minimal dependencies among the activities in an app. In fact,
activities often start-up activities belonging to other apps. For example, a browser app might launch the
Share activity of a social-media app. To use activities in your app, you must register information about them
in the app’s manifest, and you must manage activity lifecycles appropriately. The rest of this document
introduces these subjects.
6
Fig. 1 Transition between activities
7
Fig. 2 Lifecycle of an activity
3.2 Services
Application services are software solutions that improve the speed, security, and operability of
applications.
The environment in which applications are deployed is always changing. Traffic can suddenly spike as a
result of legitimate demand. Bots can impersonate users perpetrate fraud or cause other types of mayhem.
Determined cyber criminals can break through previously solid defenses. Server outages can disrupt normal
traffic patterns, potentially taking an application offline for some or all users. Application security and
delivery technology—such as traffic management, web application firewalls, load balancing, distributed
denial-of-service (DDoS) protection, and API management—interacts with the environment around the
application, enabling it to adapt to changing conditions. These and other application services help to ensure
the performance, security, and operability of the applications they support by shaping and steering traffic in
response to the application state, the nature of the traffic itself, and other environmental factors.
As digital transformation reshapes the modern enterprise, applications are becoming an increasingly
important source of differentiation. In today’s ever-more competitive economy, organizations often need to
manage hundreds and even thousands of applications with unprecedented speed, scale, and agility. As
innovation continues to increase, so, too, have concerns about security and delivering a consistent
experience across environments. Application services help organizations boost performance, maintain
availability, improve network and application security, and gain visibility into the behavior and health of
their apps. By incorporating F5 application services into their systems today, enterprises can obtain the
foundation they need to improve efficiency, increase their adaptability, and achieve a long-term competitive
advantage.
A content provider manages access to a central repository of data. A provider is part of an Android
application, which often provides its own UI for working with the data. However, content providers are
primarily intended to be used by other applications, which access the provider using a provider client object.
8
Together, providers and provider clients offer a consistent, standard interface to data that also handles
interprocess communication and secure data access.
Android Broadcast Receiver is a dormant component of android that listens to system-wide broadcast
events or intents. When any of these events occur, it brings the application into action by either creating a
status bar notification or performing a task. Unlike activities, android Broadcast Receiver doesn’t contain
any user interface. A broadcast receiver is generally implemented to delegate tasks to services depending
on the type of intent data that are received.
3.5 Intent
Android Intent is the message that is passed between components such as activities, content
providers, broadcast receivers, services, etc. It is generally used with the start Activity() method to invoke
activity, broadcast receivers, etc.
9
3.6 Using the intent to launch the activities
• You can start an activity (or give it something new to do) by passing Intent to startActivity()
or startActivityForResult().
• You can start a service (or give new instructions o an ongoing service) by passing an Intent
to startService(). Or you can bind to the service by passing an Intent to bindServices().
• You can initiate a broadcast by passing an Intent to methods like sendBroadcast(),
sendOrderedBroadcast(), or sendStickyBroadcast().
• You can perform a query to a content provider by calling query on a ContentResolver.
10
4. Introduction to the Development tool “Android Studio”
Android Studio is the official Integrated Development Environment (IDE) for Android app
development. Android Studio offers even more features that enhance your productivity when building
Android apps, such as:
Android application development can be started on either of the following operating systems-
All the required tools to develop Android applications are open source and can be downloaded from the Web.
Following is the list of software that is needed before starting Android application programming.
11
5. Android UI Design
5.1 Introducing Layouts
Frame Layout
Frame layouts are one of the simplest layout types used to organize controls within the user interface
of an Android application. They are used less often than some other layouts, simply because they are
generally used to display only one view or view which overlaps. The efficiency of a frame layout makes it
a good choice for screens containing few view controls (home screens, games screens with a single canvas,
and the like). Sometimes other inefficient layout designs can be reduced to a frame layout design that is
more efficient, while other times a more specialized layout type is appropriate. Frame layouts are the normal
layout of choice when you want to overlap views.
Linear Layout
The linear layout is a simple layout used in android for layout designing. In the Linear layout, all
the elements are displayed in a linear fashion means all the child/elements of a Linear layout are displayed
according to their orientation. The value for orientation property can be either horizontal or vertical.
1. Vertical:
In this, all the child are arranged vertically in a line one after the other. In the below code snippets,
we have specified orientation “vertical” so the childs/views of this layout are displayed vertically.
2. Horizontal:
In this, all the child are arranged horizontally in a line one after the other. In the below code
snippets, we have specified orientation as “horizontal” so the childs/views of this layout are
displayed horizontally.
1. Orientation: The orientation attribute used to set the childs/views horizontally or vertically. In
a Linear layout, the default orientation is vertical.
2. Gravity: The gravity attribute is an optional attribute that is used to control the alignment of the
layout like left, right, center, top, bottom, etc.
3. Layout_Weight: The layout weight attribute specify each child control’s relative importance
within the parent linear layout.
12
4. WeightSum: WeightSum is the sum of all the child attributes weight. This attribute is required
if we define the weight property of the childs.
Relative Layout
A relative Layout is a view group that displays child views in relative positions. The position of
each view can be specified as relative to sibling elements (such as to the left of or below another view) or
in positions relative to the parent Relative Layout area (such as aligned to the bottom, left, or center)
13
Table Layout
Android Table Layout is a ViewGroup subclass that is used to display the child view elements in
rows and columns. It will arrange all the children’s elements into rows and columns and does not display
any border lines between rows, columns, or cells.
The working of Table Layout is almost similar to an HTML table and it contains as many columns as a row
with the most cells.
• Text View
• Edit Text
• Last View
• Spinner
• Button
• Check Box
• Radio Button
• Scroll View
5.3 Menus
The options menu is the primary collection of menu items for an activity. It’s where you should
place actions that have a global impact on the app, such as “Search”, “Compose email”, and “Settings”. On
Android 3.0 and higher, items from the options menu are presented by the action bar as a combination of
on-screen action items and overflow options. Beginning with Android 3.0, the Menu button is deprecated
(some devices don’t have one), so you should migrate toward using the action bar to provide access to
actions and other options.
14
Context Menu and Contextual Action Mode
A context menu is a floating menu that appears when the user performs a long click on an
element. It provides actions that affect the selected content or context frame. A contextual menu offers
actions that affect a specific item or context frame in the UI. You can provide a context menu for any view
, but they are most often used for items in a ListView, GridView, or other view collections in which the
user can perform direct actions on each item.
Popup Menu
A popup menu displays a list of items in a vertical list that’s anchored to the view that invoked
the menu. It’s good for provoking an overflow of actions that relate to specific content or to provide options
for a second part of a command.
A dialog is a small window that prompts the user to make a decision or enter additional
information. A dialog does not fill the screen and is normally used for modal events that require users to
take an action before they can proceed.
5.5 Toast
A toast provides simple feedback about an operation in a small popup. It only fills the amount of
space required for the message and the current activity remains visible and interactive.
5.6 Adapters
An Adapter acts as a bridge between a ListView and the underlying data for that view. The
Adapter provides access to the data items. The Adapter is also responsible for making a View for each item
in the data set.
Array Adapter
15
An array Adapter is a concrete BaseAdapter that is backed by an array of arbitrary objects. By
default, this class expects that the provided resource id references a single TextView. If you want to use a
more complex layout, use the constructor that also takes a field id. That field id should reference a TextView
in the larger layout resource.
Notification Manager. Android allows putting notifications into the title bar of the application.
The user can expand the notification bar and by selecting the notification the user can trigger another
activity. Because notifications can be very annoying, the user can disable notifications for each application.
Class to notify the user of events that happen. This is how you tell the user that something has happened in
the background.
• A persistent icon that goes in the status bar and is accessible through the launcher,
(when the user selects it, a designated Intent can be launched),
• Turning on or flashing LEDs on the device, or • Alerting the user by flashing the
backlight, playing a sound, or vibrating.
Each of the notify methods takes an int id parameter and optionally a string tag parameter, which may be
null. These parameters are used to form a pair (tag, id), or (null, id) if the tag is unspecified. This pair
identifies this notification from your app to the system, so that pair should be unique within your app. If
you call one of the notify methods with a (tag, id) pair that is currently active and a new set of notification
parameters, it will be updated. For example, if you pass a new status bar icon, the old icon in the status bar
will be replaced with the new one. This is also the same tag and id you pass to the cancel(int) method to
clear this notification.
6. Database SQLite
16
transactional SQL database engine. SQLite is one of the fastest-growing database engines around, but that's
growth in terms of popularity, not anything to do with its size. The source code for SQLite is in the public
domain.
What is SQLite?
SQLite engine is not a standalone process like other databases, you can link it statically or dynamically as
per your requirement with your application. SQLite accesses its storage files directly.
Why SQLite?
• SQLite does not require a separate server process or system to operate (serverless).
• SQLite comes with zero configuration, which means no setup or administration is needed.
• A complete SQLite database is stored in a single cross-platform disk file.
• SQLite is very small and lightweight, less than 400KiB fully configured or less than 250KiB
with optional features omitted.
• SQLite is self-contained, which means no external dependencies.
• SQLite transactions are fully ACID-compliant, allowing safe access from multiple processes
or threads.
• SQLite supports most of the query language features found in the SQL92 (SQL2) standard.
• SQLite is written in ANSI-C and provides a simple and easy-to-use API.
• SQLite is available on UNIX (Linux, Mac OS-X, Android, iOS) and Windows (Win32,
WinCE, WinRT).
6.1 Query
Using a query makes it easier to view, add, delete, or change data in your Access database. Some
other reasons for using queries:
In a well-designed database, the data that you want to present through a form or report is usually located
in multiple tables. A query can pull the information from various tables and assemble it for display in the
form or report. A query can either be a request for data results from your database or for action on the
data, or for both. A query can give you an answer to a simple question, perform calculations, combine
data from different tables, and add, change, or delete data from a database. Since queries are so versatile,
there are many types of queries and you would create a type of query based on the task.
7. Design
Software Design encompasses the set of principles, concepts, and practices that led to the
development of a high-quality system or product. The goal of design is to produce a model that exhibits
firmness, commodity, and delight. Once the requirements have been analyzed and modeled, software design
sets the stage for the construction of the software. Each of the elements of the analysis model provides
information for a complete specification of design.
A flowchart is a type of diagram that represents an algorithm workflow or process, showing the steps as
boxes of various kinds, and their order by connecting them with arrows. This diagrammatic representation
illustrates a solution model to a given problem. Flowcharts are used in analyzing, designing, documenting
or managing a process or program in various fields.
18
19
8. Overall View Of “Android Application Development” Skill Development
Program
Day -1
• Running your app in Real Android Device, Manifest File, Gradle Files, setting up App Icon.
• Integration of Text View, Edit Text, Image View and Video View, Text Button, and Image Button.
• Implementation of Toggle Button and Switch, Check Box, Radio Button, Seek Bar, or Variable Bar
• Relative Layout, Linear Layout, List View and Recycle View and Adaptors
• Table Layout and Grid Layout and Adaptors Fixed and Dynamic Tab Layout Page View with Slide
and Page Turn
• Card View Scroll View and Horizontal Scroll View, Stack View.
Day - 2
• Integrating Action Bar and Button, Navigation Drawer, Floating Action Button, and Spinner Developed
app.
20
• Hands-On experiments with Drop Menu, Slide Menu, and Floating Menu development.
• Backend code development for Tap Gesture and Double Tap Gesture, Touch Gesture, Long
Click Gesture.
Day-3
• Implementation of Custom Floating Message Box, Custom Alert Dialog Box, Custom Choice Box,
Custom Check Box, Push Notification, Local Broadcast, Broadcast Services, and Badge Numbers.
• Audio Video Functions and working with mp3 files and mp3 functions respectively.
Day - 4
• Usage of Camera Intent, Gallery Intent, Call Intent, Message Intent, Calendar Intent, and Service.
• Interaction with Server using volley, JSON Data, and GSON Format
21
• Uploading Audio and Video to Server
• Downloading
9. Course Outcomes
• Clear understanding of the need for java programming in mobile app development.
10. Conclusion
22
Android smartphones are on hype in the 21st century. The scope of android applications is
increasing day by day. Its development has become an essential part of today’s programming curriculum.
Through this skill development program, we got to learn about Android Java Programming,
Methodologies for Android App Development, Android Layout, Drawable, Assets Usage, and Exposure
to the methodology of innovative project development. Being new to app development, we came to know
a lot about developing an android application from scratch.
23
References
1. https://www.geeksforgeeks.org/android-architecture/
2. https://developer.android.com/guide/components/activities/intro-activities
3. https://developer.android.com/guide/topics/providers/content-provider-basics
4. https://www.digitalocean.com/community/tutorials/android-broadcastreceiver-
example- tutorial
5. https://www.javatpoint.com/android-intent-tutorial
6. https://abhiandroid.com/ui/linear-layout
7. https://developer.android.com/reference/android/widget/RelativeLayout
8. https://www.geeksforgeeks.org/android-tablelayout-in-kotlin/
24