Professional Documents
Culture Documents
CHAPTER-1
INTRODUCTION
1.1 What is Android?
Apps are developed for a variety of reasons: addressing business requirements, building
new services, creating new businesses, and providing games and other types of content for users.
Developers choose to develop for Android to reach most mobile device users.
Use the Android software development kit (SDK) to develop apps that take advantage of
the Android operating system and UI. The SDK includes a comprehensive set of development
tools including a debugger, software libraries of prewritten code, a device emulator,
documentation, sample code, and tutorials. To develop apps using the SDK, use the Java
programming language for developing the app and Extensible Mark-up Language (XML) files
for describing data resources. To develop the apps efficiently, Google offers a full Java
Integrated Development Environment (IDE) called Android Studio, with advanced features for
developing, debugging, and packaging Android apps.
Android operating system is roughly divided into five sections and four main layers as
shown below in the architecture diagram.
Native libraries such as Web Kit, OpenGL, Free Type, SQLite, Media, C runtime library
etc.
The Web Kit library is responsible for browser support.
Android Runtime:
In android runtime, there are core libraries and DVM (Dalvik Virtual Machine) which is
responsible to run android application. DVM is like JVM, but it is optimized for mobile devices.
It consumes less memory and provides fast performance.
Linux kernel:
It is the heart of android architecture that exists at the root of android architecture. Linux
kernel is responsible for device drivers, power management, memory management, device
management like camera, keypad, display etc. and resource access.
Android Versions:
XML stands for Extensible Markup Language. It is a text-based markup language derived
from Standard Generalized Markup Language (SGML).XML tags identify the data and are used
to store and organize the data, rather than specifying how to display it like HTML tags, which
are used to display the data. XML is not going to replace HTML soon, but it introduces new
possibilities by adopting many successful features of HTML.
There are three important characteristics of XML that make it useful in a variety of systems
and solutions –
XML is extensible − XML allows you to create your own self-descriptive tags, or
language, that suits your application.
XML carries the data, does not present it − XML allows you to store the
data irrespective of how it will be presented.
XML is a public standard − XML was developed by an organization called the
World Wide Web Consortium (W3C) and is available as an open standard.
XML Usage:
A short list of XML usage says it all −
XML can work behind the scenes to simplify the creation of HTML documents for
large web sites.
XML can be used to exchange the information between organizations and systems.
XML can be used for offloading and reloading of databases.
XML can be used to store and arrange the data, which can customize your data
handling needs.
XML can easily be merged with style sheets to create almost any desired output.
Virtually, any type of data can be expressed as an XML document.
MARKUP:
XML is a markup language that defines set of rules for encoding documents in a format that
is both human-readable and machine-readable. Markup is information added to a document
that enhances its meaning in certain ways, in that it identifies the parts and how they relate to
each other. More specifically, a markup language is a set of symbols that can be placed in the
text of a document to demarcate and label the parts of that document.
Following example shows how XML markup looks, when embedded in a piece of text −
<message>
<text> Hello, world! </text>
</message>
This snippet includes the markup symbols, or the tags such as <message>...</message> and
<text>... </text>. The tags <message> and </message> mark the start and the end of the XML code
fragment. The tags <text> and </text> surround the text Hello, world!
Following is a complete XML document −
<?xml version = "1.0"?>
<contact-info>
<name> XYZ </name>
<company> Dr. TTIT </company>
<phone>(+91)123-4567-890</phone>
</contact-info>
The following diagram depicts the syntax rules to write different types of markup and text
in an XML document.
XML DECLARATION:
It’s The XML document can optionally have an XML declaration. It is written as follows:
<?xml version = "1.0" encoding = "UTF-8"?>
where version is the XML version and encoding specifies the character encoding used in the
document.
The XML declaration is case sensitive and must begin with "<?xml>" where "xml"
is written in lower-case.
If document contains XML declaration, then it strictly needs to be the first statement of
the XML document.
The XML declaration strictly needs be the first statement in the XML document.
An HTTP protocol can override the value of encoding that you put in the XML declaration.
Tags and Elements:
Element Syntax − Each XML-element needs to be closed either with start or with end
elements as shown below −
<element>....</element>
<element/>
Root Element − An XML document can have only one root element. For example, following
is not a correct XML document, because both the x and y elements occur at the top level
without a root element –
<x>...</x>
<y>...</y>
<root>
<x>...</x>
<y>...</y>
</root>
XML ATTRIBUTES:
An attribute specifies a single property for the element, using a name/value pair. An XML-
element can have one or more attributes. For example −
Attribute names in XML (unlike HTML) are case sensitive. That is, HREF and href are
considered two different XML attributes.
Same attribute cannot have two values in a syntax. The following example shows
incorrect syntax because the attribute b is specified twice
Attribute names are defined without quotation marks, whereas attribute values must
always appear in quotation marks. Following example demonstrates incorrect xml syntax
<a b = x>....</a>
In the above syntax, the attribute value is not defined in quotation marks.
XML Text:
The names of XML-elements and XML-attributes are case-sensitive, which means the name of
start and end elements need to be written in the same case. To avoid character encoding problems, all
XML files should be saved as Unicode UTF-8 or UTF-16 files.
Whitespace characters like blanks, tabs and line-breaks between XML-elements and between
the XML-attributes will be ignored.
Some characters are reserved by the XML syntax itself. Hence, they cannot be used directly.
To use them, some replacement-entities are used, which are listed below –
‘ ' apostrophe
“ " quotation
Android Studio is the official integrated development environment (IDE) for Google's
Android operating system, built on JetBrains' IntelliJ IDEA software and designed specifically
for Android development. It is available for download on Windows, macOS and Linux based
operating systems or as a subscription-based service in 2020. It is a replacement for the Eclipse
Android Development Tools (E-ADT) as the primary IDE for native Android application
development.
Android Studio was announced on May 16, 2013, at the Google I/O conference. It was in
early access preview stage starting from version 0.1 in May 2013, then entered beta stage starting
from version 0.8 which was released in June 2014. The first stable build was released in
December 2014, starting from version 1.0.
On May 7, 2019, Kotlin replaced Java as Google's preferred language for Android app
development.[13] Java is still supported, as is C++.[14]A specific feature of the Android Studio
is an absence of the possibility to switch autosave feature off.
Lint tools to catch performance, usability, version compatibility and other problems
Built-in support for Google Cloud Platform, enabling integration with Firebase
Cloud Messaging (Earlier 'Google Cloud Messaging') and Google App Engine
Android Virtual Device (Emulator) to run and debug apps in the Android studio.
Android Studio supports all the same programming languages of IntelliJ (and CLion) e.g.,
Java, C++, and more with extensions, such as Go; and Android Studio 3.0 or later supports
Kotlin and "all Java 7 language features and a subset of Java 8 language features that vary by
platform version." External projects backport some Java 9 features. While IntelliJ states that
Android Studio supports all released Java versions, and Java 12, it's not clear to what level
Android Studio supports Java versions up to Java 12 (the documentation mentions partial Java 8
support). At least some new language features up to Java 12 are usable in Android.
Once an app has been compiled with Android Studio, it can be published on the Google Play
Store. The application must be in line with the Google Play Store developer content policy.
CHAPTER-2
REQUIREMENTS SPECIFICATIONS
You can download Android Studio from the Android Studio home page,
(https://developer.android.com/studio/index.html) where you will also find the traditional SDKs
with Android Studio’s command-line tools.
Before downloading Android Studio, make sure your platform meets the following
requirements:
CHAPTER 3
DESIGN
3.1 LAYOUTS:
Text View:
Text View refers to the widget which displays some text on the screen based on the
layout, size, color, etc set for that Text View. It optionally allows us to modify or edit itself as
well.
<Text View>
of attribute2"
</Text View>
Image View:
Image View class is used to display any kind of image resource in the android application
either it can be android. Graphics. Bitmap or android.graphics.drawable.Application of Image
View is also in applying tints to an image to reuse a drawable resource and create overlays on
background images. Moreover, Image View is also used to control the size and movement of an
image.
<Image View>
of attribute2"
</Image View>
Button :
<Button>
android:SomeAttribute1 = "Value of
attribute1" android:SomeAttribute2 = "Value
of attribute2"
.
android:SomeAttributeN = "Value of attributeN"
</Button>
TextClock :
TextClock can display the current date and/or time as a formatted string. This view honors
the 24-hour format system setting. As such, it is possible and recommended to provide two
different formatting patterns: one to display the date/time in 24-hour mode and one to display the
date/time in 12-hour mode. Most callers will want to use the defaults, though, which will be
appropriate for the user's locale.ng.
<TextClock>
android:SomeAttribute1 = "Value of
of attribute2"
</TextClock>
CHAPTER-4
CODING
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Pro">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
</application>
</manifest>
<TextView
android:id="@+id/txtmarquee3"
android:layout_width="249dp"
android:layout_height="55dp"
android:layout_marginTop="24dp"
android:ellipsize="marquee"
android:fontFamily="@font/audiowide"
android:marqueeRepeatLimit="marquee_forever"
android:padding="10dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="S JATHISH MURALI (1GV18CS051)"
android:textDirection="ltr"
android:textSize="25sp"
android:textStyle="bold|italic"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.537"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtmarquee"
app:layout_constraintVertical_bias="0.088" />
<Button
android:id="@+id/buttonstart"
android:layout_width="286dp"
android:layout_height="49dp"
android:layout_marginTop="12dp"
android:background="#43A047"
android:fontFamily="@font/aclonica"
android:text="START TASK"
android:textSize="25sp"
android:textStyle="bold|italic"
app:backgroundTint="#43A047"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.512"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView2"
app:layout_constraintVertical_bias="0.0" />
<Button
android:id="@+id/buttonstop"
android:layout_width="287dp"
android:layout_height="51dp"
android:layout_marginTop="8dp"
android:background="#D81B60"
android:fontFamily="@font/aclonica"
android:text="End Task "
android:textSize="25sp"
android:textStyle="bold|italic"
app:backgroundTint="#D81B60"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.508"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonstart"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="CHAITANYA M S (1GV18CS010)"
android:textDirection="ltr"
android:textSize="25sp"
android:textStyle="bold|italic"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.524"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtmarquee4"
app:layout_constraintVertical_bias="0.053" />
<TextView
android:id="@+id/txtmarquee4"
android:layout_width="175dp"
android:layout_height="57dp"
android:ellipsize="marquee"
android:fontFamily="@font/keania_one"
android:marqueeRepeatLimit="marquee_forever"
android:padding="10dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="PROJECT BY"
android:textDirection="rtl"
android:textSize="30sp"
android:textStyle="bold"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.523" />
<TextClock
android:id="@+id/textClock"
android:layout_width="122dp"
android:layout_height="66dp"
android:fontFamily="@font/geostar_fill"
android:format12Hour="hh:mm:ss A"
android:textColor="#636363"
android:textSize="20sp"
android:textStyle="bold|italic"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
tools:ignore="MissingConstraints" />
<TextView
android:id="@+id/datetext"
android:layout_width="214dp"
android:layout_height="62dp"
android:text="TextView"
android:textAllCaps="true" android:textColor="#636363"
android:textSize="20sp" android:textStyle="bold|italic"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.025"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
package com.example.pro;
import androidx.appcompat.app.AppCompatActivity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
txtmarq = findViewById(R.id.txtmarquee);
txtmarq2 = findViewById(R.id.txtmarquee2);
txtmarq3 = findViewById(R.id.txtmarquee3);
txtmarq4 = findViewById(R.id.txtmarquee4);
btnstart = findViewById(R.id.buttonstart);
date = findViewById(R.id.datetext);
Calendar calendar = Calendar.getInstance();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("E,
dd-MMM-yyyy ");
dateTime = simpleDateFormat.format(calendar.getTime());
date.setText(dateTime);
btnstart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ExampleAsyncTask task = new ExampleAsyncTask();
task.execute();
}
});
btnstop = findViewById(R.id.buttonstop);
btnstop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
txtmarq.setSelected(true);
txtmarq.setVisibility(View.INVISIBLE);
txtmarq2.setSelected(true);
txtmarq2.setVisibility(View.INVISIBLE);
txtmarq3.setSelected(true);
txtmarq3.setVisibility(View.INVISIBLE);
txtmarq4.setSelected(true);
txtmarq4.setVisibility(View.INVISIBLE);
}
});
}
@Override
protected void onPostExecute(String s)
{
super.onPostExecute(s);
txtmarq.setVisibility(View.VISIBLE);
txtmarq.setSelected(true);
txtmarq2.setVisibility(View.VISIBLE);
txtmarq2.setSelected(true);
txtmarq3.setVisibility(View.VISIBLE);
txtmarq3.setSelected(true);
txtmarq4.setVisibility(View.VISIBLE);
txtmarq4.setSelected(true);
}
}
}
CHAPTER 5
SNAPSHOTS:
CHAPTER 6
CONCLUSION
The project unit converter in Android was completed successfully. The system has been
developed with much care and free of errors and the same time it is efficient and less time
consuming. The purpose of this project was to develop android application to run Android API
for Asynchronous tasks. This project helped me in graining valuable information and practical
knowledge on several topics like designing android application using xml, JavaScript. The entire
system is secured also the project and software development life cycle. I learnt to test different
features of a project.
The project has given great satisfaction in having designed an application which can be
implemented to various kinds of products by simple modification. This is scope of future
development in our project to a great extent several features can be added in the system in future
providing.
BIBILOGRAPHY
TEXTBOOKS:
WEBSITES:
www.google.co.in
www.w3school.com
www.geeksforgeeks.org
www.developer.android.com
www.tutorialspoint.com