Report On Android Application Development
Report On Android Application Development
Report On Android Application Development
Application Development
- Prepared By Arnold Vaz
System Requirements
Before downloading and installing Android Studio, the following
requirements are essential.
Step 1
To download the Android Studio, visit the official Android Studio website in
Wer web browser.
Step 2
Step 3
Step 4
"Android Studio Setup" will appear on the screen and click "Next" to
proceed.
Step 5
Select the components that We want to install and click on the "Next"
button.
Step 6
Now, browse the location where We want to install the Android Studio and
click "Next" to proceed.
Choose a start menu folder for the "Android Studio" shortcut and click the
"Install" button to proceed.
Step 8
Step 9
Step 10
"Android Studio Setup Wizard" will appear on the screen with the welcome
wizard. Click on the "Next" button.
Step 11
Select (check) the "Standard" option if We are a beginner and do not have
any idea about Android Studio. It will install the most common settings and
options for We. Click "Next" to proceed.
Step 12
Now, select the user interface theme as We want. (I prefer Dark theme
(Dracula) that is most liked by the coders). Then, click on the "Next" button.
Step 13
Now, click on the "Finish" button to download all the SDK components.
Step 14
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
@Override
super.onCreate(savedInstanceState);
setContentView(R.laWet.activity_main);
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.arnoldvaz.myapplication">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
</intent-filter>
</activity>
</application>
</manifest>
<string name="app_name">HelloWorld</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
</resources>
xmlns:tools="http://schemas.android.com/tools"
android:laWet_width="match_parent"
android:laWet_height="match_parent" >
<TextView
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:laWet_centerHorizontal="true"
android:laWet_centerVertical="true"
android:padding="@dimen/padding_medium"
android:text="@string/hello_world"
tools:context=".MainActivity" />
</RelativeLaWet>
Virtual Device -
An Android Virtual Device (AVD) is a configuration that defines the
characteristics of an Android phone, tablet, Wear OS, Android TV, or
Automotive OS device that We want to simulate in the Android Emulator.
The AVD Manager is an interface We can launch from Android Studio that
helps We create and manage AVDs.
Click Create Virtual Device, at the bottom of the AVD Manager dialog.
The Select Hardware page appears.
The Recommended tab lists recommended system images. The other tabs
include a more complete list. The right pane describes the selected
system image. x86 images run the fastest in the emulator.
The API level of the target device is important, because Wer app won't be
able to run on a system image with an API level that's less than that
required by Wer app, as specified in the minSdkVersion attribute of the
app manifest file. For more information about the relationship between
system API level and minSdkVersion, see Versioning Wer Apps.
If Wer app declares a <uses-library> element in the manifest file, the app
requires a system image in which that external library is present. If We
want to run Wer app on an emulator, create an AVD that includes the
required library. To do so, We might need to use an add-on component for
The new AVD appears in the Wer Virtual Devices page or the Select
Deployment Target dialog.
Diagram 1 -
Within the lifecycle callback methods, We can declare how Wer activity
behaves when the user leaves and re-enters the activity. For example, if
We're building a streaming video player, We might pause the video and
terminate the network connection when the user switches to another app.
When the user returns, We can reconnect to the network and allow the
user to resume the video from the same spot. In other words, each
callback allows We to perform specific work that's appropriate to a given
change of state. Doing the right work at the right time and handling
transitions properly make Wer app more robust and perform ant. For
example, good implementation of the lifecycle callbacks can help ensure
that Wer app avoids:
OnStart() Method –
When the activity enters the Started state, the system invokes this
callback. The onStart() call makes the activity visible to the user, as the app
prepares for the activity to enter the foreground and become interactive.
For example, this method is where the app initializes the code that
maintains the UI.
The onStart() method completes very quickly and, as with the Created
state, the activity does not stay resident in the Started state. Once this
callback finishes, the activity enters the Resumed state, and the system
invokes the onResume() method.
When the activity enters the Resumed state, it comes to the foreground,
and then the system invokes the onResume() callback. This is the state in
which the app interacts with the user. The app stays in this state until
something happens to take focus away from the app. Such an event might
be, for instance, receiving a phone call, the user’s navigating to another
activity, or the device screen’s turning off.
When an interruptive event occurs, the activity enters the Paused state,
and the system invokes the onPause() callback.
If the activity returns to the Resumed state from the Paused state, the
system once again calls onResume() method. For this reason, We should
implement onResume() to initialize components that We release
during onPause(), and perform any other initializations that must occur
each time the activity enters the Resumed state.
OnPause() Method –
The system calls this method as the first indication that the user is leaving
Wer activity (though it does not always mean the activity is being
destroyed); it indicates that the activity is no longer in the foreground
(though it may still be visible if the user is in multi-window mode). Use
the onPause() method to pause or adjust operations that should not
continue (or should continue in moderation) while the Activity is in the
Paused state, and that We expect to resume shortly. There are several
reasons why an activity may enter this state. When the activity moves to
the paused state, any lifecycle-aware component tied to the activity's
lifecycle will receive the ON_PAUSE event. This is where the lifecycle
OnStop() Method –
In the onStop() method, the app should release or adjust resources that are
not needed while the app is not visible to the user. For example, Wer app
might pause animations or switch from fine-grained to coarse-grained
location updates. Using onStop() instead of onPause() ensures that UI-
related work continues, even when the user is viewing Wer activity in
multi-window mode.
onDestroy() is called before the activity is destroyed. The system invokes this
callback either because:
the activity is finishing (due to the user completely dismissing the activity or due
to finish() being called on the activity), or
the system is temporarily destroying the activity due to a configuration change
(such as device rotation or multi-window mode)
When the activity moves to the destroyed state, any lifecycle-aware component
tied to the activity's lifecycle will receive the ON_DESTROY event. This is where
the lifecycle components can clean up anything it needs to before the Activity is
destroyed.
We can distinguish between these two scenarios with the isFinishing() method.
If the activity is finishing, onDestroy() is the final lifecycle callback the activity
receives. If onDestroy() is called as the result of a configuration change, the
system immediately creates a new activity instance and then calls onCreate() on
that new instance in the new configuration.
The onDestroy() callback should release all resources that have not yet been
released by earlier callbacks such as onStop().
Code –
<Button
android:id="@+id/button_id"
android:laWet_height="wrap_content"
android:laWet_width="wrap_content"
android:text="@string/self_destruct" />
To specify an action when the button is pressed, set a click listener on the
button object in the corresponding activity code:
setContentView(R.laWet.content_laWet_id);
Every button is styled using the system's default button background, which is
often different from one version of the platform to another. If We are not
satisfied with the default button style, We can customize it. For more details and
code samples, see the Styling Wer Button guide.
CheckBox –
Android CheckBox is a type of two state button either checked or unchecked.
Code -
<android.support.constraint.ConstraintLaWet
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:laWet_width="match_parent"
android:laWet_height="match_parent"
tools:context="com.arnoldvaz.checkbox.MainActivity">
<CheckBox
android:id="@+id/checkBox"
android:laWet_height="wrap_content"
android:laWet_marginLeft="144dp"
android:laWet_marginTop="68dp"
android:text="Pizza"
app:laWet_constraintStart_toStartOf="parent"
app:laWet_constraintTop_toTopOf="parent" />
<CheckBox
android:id="@+id/checkBox2"
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:laWet_marginLeft="144dp"
android:laWet_marginTop="28dp"
android:text="Coffee"
app:laWet_constraintStart_toStartOf="parent"
app:laWet_constraintTop_toBottomOf="@+id/checkBox" />
<CheckBox
android:id="@+id/checkBox3"
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:laWet_marginTop="28dp"
android:text="Burger"
app:laWet_constraintStart_toStartOf="parent"
app:laWet_constraintTop_toBottomOf="@+id/checkBox2" />
<Button
android:id="@+id/button"
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:laWet_marginLeft="144dp"
android:laWet_marginTop="184dp"
android:text="Order"
app:laWet_constraintStart_toStartOf="parent"
app:laWet_constraintTop_toBottomOf="@+id/checkBox3" />
</android.support.constraint.ConstraintLaWet>
package com.arnoldvaz.checkbox;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.Toast;
CheckBox pizza,coffe,burger;
Button buttonOrder;
@Override
super.onCreate(savedInstanceState);
setContentView(R.laWet.activity_main);
addListenerOnButtonClick();
pizza=(CheckBox)findViewById(R.id.checkBox);
burger=(CheckBox)findViewById(R.id.checkBox3);
buttonOrder=(Button)findViewById(R.id.button);
buttonOrder.setOnClickListener(new View.OnClickListener(){
@Override
int totalamount=0;
result.append("Selected Items:");
if(pizza.isChecked()){
result.append("\nPizza 100Rs");
totalamount+=100;
if(coffe.isChecked()){
result.append("\nCoffe 50Rs");
totalamount+=50;
if(burger.isChecked()){
result.append("\nBurger 120Rs");
result.append("\nTotal: "+totalamount+"Rs");
Toast.makeText(getApplicationContext(), result.toString(),
Toast.LENGTH_LONG).show();
});
Included in the event listener interfaces are the following callback methods:
onLongClick()
From View.OnLongClickListener. This is called when the user either touches and
holds the item (when in touch mode), or focuses upon the item with the
navigation-keys or trackball and presses and holds the suitable "enter" key or
presses and holds down on the trackball (for one second).
onFocusChange()
From View.OnFocusChangeListener. This is called when the user navigates onto or
away from the item, using the navigation-keys or trackball.
onKey()
From View.OnKeyListener. This is called when the user is focused on the item and
presses or releases a hardware key on the device.
onTouch()
From View.OnTouchListener. This is called when the user performs an action
qualified as a touch event, including a press, a release, or any movement
gesture on the screen (within the bounds of the item).
onCreateContextMenu()
From View.OnCreateContextMenuListener. This is called when a Context Menu is
being built (as the result of a sustained "long click"). See the discussion on
context menus in the Menus developer guide.
These methods are the sole inhabitants of their respective interface. To define
one of these methods and handle Wer events, implement the nested interface in
Wer Activity or define it as an anonymous class. Then, pass an instance of Wer
implementation to the respective View.set...Listener() method. (E.g.,
call setOnClickListener() and pass it Wer implementation of the OnClickListener.)
Report on Android Application Development - Prepared By Arnold Vaz Page 28
Notice that the onClick() callback in the above example has no return value, but
some other event listener methods must return a boolean. The reason depends
on the event. For the few that do, here's why:
Remember that hardware key events are always delivered to the View currently
in focus. They are dispatched starting from the top of the View hierarchy, and
then down, until they reach the appropriate destination. If Wer View (or a child
of Wer View) currently has focus, then We can see the event travel through
the dispatchKeyEvent() method. As an alternative to capturing key events through
Wer View, We can also receive all of the events inside Wer Activity
with onKeyDown() and onKeyUp().
Also, when thinking about text input for Wer application, remember that many
devices only have software input methods. Such methods are not required to be
key-based; some may use voice input, handwriting, and so on. Even if an input
method presents a keyboard-like interface, it will generally not trigger
the onKeyDown() family of events. We should never build a UI that requires
specific key presses to be controlled unless We want to limit Wer application to
devices with a hardware keyboard. In particular, do not rely on these methods
to validate input when the user presses the return key; instead, use actions
like IME_ACTION_DONE to signal the input method how Wer application expects
Android Gestures –
Android provides special types of touch screen events such as pinch , double
tap, scrolls , long presses and flinch. These are all known as gestures. Android
provides special types of touch screen events such as pinch , double tap,
scrolls , long presses and flinch. These are all known as gestures.
Android provides GestureDetector class to receive motion events and tell us
that these events correspond to gestures or not. To use it , We need to create
an object of GestureDetector and then extend another class
with GestureDetector.SimpleOnGestureListener to act as a listener and
override some methods.
Code -
GestureDetector myG;
float velocityY) {
ScaleGestureDetector SGD;
SGD.onTouchEvent(ev);
return true;
@Override
return true;
Main Activity –
package com.arnoldvaz.myapplication;
import android.app.Activity;
import android.graphics.Matrix;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.widget.ImageView;
@Override
super.onCreate(savedInstanceState);
setContentView(R.laWet.activity_main);
iv=(ImageView)findViewById(R.id.imageView);
SGD.onTouchEvent(ev);
return true;
SimpleOnScaleGestureListener {
@Override
scale *= detector.getScaleFactor();
matrix.setScale(scale, scale);
iv.setImageMatrix(matrix);
return true;
Layout Xml –
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:laWet_width="match_parent"
android:laWet_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView android:text="Gestures
Example" android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:id="@+id/textview"
android:textSize="35dp"
android:laWet_alignParentTop="true"
android:laWet_centerHorizontal="true" />
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:text="Tutorials point"
android:id="@+id/textView"
android:laWet_below="@+id/textview"
android:laWet_centerHorizontal="true"
android:textColor="#ff7aff24"
android:textSize="35dp" />
<ImageView
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:id="@+id/imageView"
android:src="@drawable/abc"
android:scaleType="matrix"
android:laWet_below="@+id/textView"
android:laWet_alignParentLeft="true"
android:laWet_alignParentStart="true"
android:laWet_alignParentBottom="true"
android:laWet_alignParentRight="true"
android:laWet_alignParentEnd="true" />
String File -
<resources>
</resources>
Manifest file -
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.arnoldvaz.myapplication" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.sairamkrishna.myapplicationMainActivity"
android:label="@string/app_name" >
<intent-filter>
</intent-filter>
</activity>
</application>
</manifest>
Android Fragments –
A Fragment represents a reusable portion of Wer app's UI. A fragment defines
and manages its own laWet, has its own lifecycle, and can handle its own input
events. Fragments cannot live on their own--they must be hosted by an activity
or another fragment. Fragment is a combination of an XML laWet file and a java
class much like an Activity . Using the support library, fragments are supported
back to all relevant Android versions. Fragments encapsulate views and logic
so that it is easier to reuse within activities.
Consider an app that responds to various screen sizes. On larger screens, the
app should display a static navigation drawer and a list in a grid laWet. On
smaller screens, the app should display a bottom navigation bar and a list in a
linear laWet. Managing all of these variations in the activity can be unwieldy.
Separating the navigation elements from the content can make this process
more manageable. The activity is then responsible for displaying the correct
navigation UI while the fragment displays the list with the proper laWet.
The Fragment library also provides more specialized fragment base classes:
DialogFragment
PreferenceFragmentCompat
Code –
public ExampleActivity() {
super(R.laWet.example_activity);
@Override
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.setReorderingAllowed(true)
.commit();
<androidx.fragment.app.FragmentContainerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container_view"
android:laWet_width="match_parent"
android:laWet_height="match_parent" />
<androidx.fragment.app.FragmentContainerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container_view"
android:laWet_width="match_parent"
android:laWet_height="match_parent"
android:name="com.example.ExampleFragment" />
public ExampleFragment() {
super(R.laWet.example_fragment);
5) dependencies {
implementation "androidx.fragment:fragment:$fragment_version"
// Kotlin
implementation "androidx.fragment:fragment-ktx:$fragment_version"
6) buildscript {
...
repositories {
google()
...
allprojects {
repositories {
google()
...
public ExampleActivity() {
super(R.laWet.example_activity);
@Override
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
bundle.putInt("some_int", 0);
getSupportFragmentManager().beginTransaction()
.setReorderingAllowed(true)
.commit();
public ExampleFragment() {
super(R.laWet.example_fragment);
1. In Android Studio, select Wer app from the run/debug configurations drop-down
menu in the toolbar.
2. In the toolbar, select the device that We want to run Wer app on from the target
device drop-down menu.
Intents in Android –
Report on Android Application Development - Prepared By Arnold Vaz Page 47
An intent is to perform an action on the screen. It is mostly used to start activity,
send broadcast receiver,start services and send message between two
activities. There are two intents available in android as Implicit Intents and
Explicit Intents. Android Intent is the message that is passed between
components such as activities, content providers, broadcast receivers, services
etc.
Code -
<android.support.constraint.ConstraintLaWet
android:laWet_height = "match_parent">
<LinearLaWet
android:laWet_width = "match_parent"
android:laWet_height = "match_parent"
android:orientation = "vertical">
<Button
android:laWet_width = "wrap_content"
android:laWet_height = "wrap_content"
android:id = "@+id/send"/>
</LinearLaWet>
</android.support.constraint.ConstraintLaWet>
<android.support.constraint.ConstraintLaWet xmlns:android =
"http://schemas.android.com/apk/res/android"
xmlns:app = "http://schemas.android.com/apk/res-auto"
xmlns:tools = "http://schemas.android.com/tools"
android:laWet_width = "match_parent"
android:laWet_height = "match_parent"
android:laWet_centerInParent = "true"
android:laWet_centerHorizontal = "true"
tools:context = ".SecondActivity">
<TextView
android:id = "@+id/data"
android:textSize = "20sp"
</android.support.constraint.ConstraintLaWet>
3) import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
@Override
super.onCreate(savedInstanceState);
setContentView(R.laWet.activity_main);
send.setOnClickListener(new View.OnClickListener() {
@Override
startActivity(send);
});
startActivity(send);
5) package com.arnoldvaz.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
@Override
super.onCreate(savedInstanceState);
setContentView(R.laWet.activity_second);
TextView data=findViewById(R.id.data);
package = "com.example.andy.myapplication">
<application
android:allowBackup = "true"
android:label = "@string/app_name"
android:roundIcon = "@mipmap/ic_launcher_round"
android:supportsRtl = "true"
android:theme = "@style/AppTheme">
<intent-filter>
</intent-filter>
</activity>
</application>
</manifest>
Threads in Android –
Threads with higher priority are executed in preference to threads with lower
priority. A Thread is a concurrent unit of execution. It has its own call stack for
methods being invoked, their arguments and local variables. Each virtual
Android has four basic types of threads. We'll see other documentation talk
about even more, but we're going to focus on Thread , Handler , AsyncTask , and
something called HandlerThread. Use Thread. currentThread(). isAlive() to see if
the thread is alive[output should be true] which means thread is still running the
code inside the run() method or use Thread. When an application is launched in
Android, it creates the primary thread of execution, referred to as the “main”
thread. Most thread is liable for dispatching events to the acceptable interface
widgets also as communicating with components from the Android UI toolkit.
Services in Android –
1. Started
2. Bound
2) Bound Service
A service is bound when another component (e.g. client) calls bind Service()
method. The client can unbind the service by calling the unbindService() method.
The service cannot be stopped until all clients unbind the service.
Code –
<RelativeLaWet xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:laWet_width="match_parent"
android:laWet_height="match_parent"
tools:context="arnoldvaz.com.androidservice.MainActivity">
<Button
android:id="@+id/buttonStart"
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:laWet_alignParentTop="true"
android:laWet_marginTop="74dp"
<Button
android:id="@+id/buttonStop"
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:laWet_centerHorizontal="true"
android:laWet_centerVertical="true"
<Button
android:id="@+id/buttonNext"
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:laWet_alignParentBottom="true"
android:laWet_centerHorizontal="true"
android:laWet_marginBottom="63dp"
</RelativeLaWet>
<android.support.constraint.ConstraintLaWet
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:laWet_width="match_parent"
android:laWet_height="match_parent"
tools:context="com.arnoldvaz.androidservice.NextPage">
<TextView
android:id="@+id/textView"
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:laWet_marginEnd="8dp"
android:laWet_marginStart="8dp"
android:laWet_marginTop="200dp"
android:text="Next Page"
app:laWet_constraintEnd_toEndOf="parent"
app:laWet_constraintStart_toStartOf="parent"
app:laWet_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLaWet>
Service class
Now create the service implemenation class by inheriting the Service class and
overridding its callback methods.
package com.arnoldvaz.androidservice;
import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.widget.Toast;
MediaPlayer myPlayer;
@Nullable
@Override
return null;
@Override
@Override
myPlayer.start();
@Override
myPlayer.stop();
3) package com.arnoldvaz.androidservice;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@Override
super.onCreate(savedInstanceState);
setContentView(R.laWet.activity_main);
buttonStart = findViewById(R.id.buttonStart);
buttonStop = findViewById(R.id.buttonStop);
buttonNext = findViewById(R.id.buttonNext);
buttonStart.setOnClickListener(this);
buttonStop.setOnClickListener(this);
buttonNext.setOnClickListener(this);
switch (src.getId()) {
case R.id.buttonStart:
break;
case R.id.buttonStop:
break;
case R.id.buttonNext:
startActivity(intent);
break;
4) package com.arnoldvaz.androidservice;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
@Override
super.onCreate(savedInstanceState);
setContentView(R.laWet.activity_next);
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.arnoldvaz.androidservice">
<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/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
</intent-filter>
</activity>
<activity android:name=".NextPage"></activity>
<service
android:name=".MyService"
android:enabled="true" />
</application>
There are four different types of Android services: Bound Service – A bound
service is a service that has some other component (typically an Activity) bound
to it. A bound service provides an interface that allows the bound component
and the service to interact with each other. A service is started when an
application component, such as an activity, starts it by calling startService().
Once started, a service can run in the background indefinitely, even if the
component that started it is destroyed. 2. Bound. A service is bound when an
application component binds to it by calling bindService.
Service class uses the application's main thread, while IntentService creates a
worker thread and uses that thread to run the service. IntentService creates a
queue that passes one intent at a time to onHandleIntent(). Thus, implementing a
multi-thread should be made by extending Service class directly. Android
service is a component that is used to perform operations on the background
such as playing music, handle network transactions, interacting content
providers etc. It doesn't has any UI (user interface). The service runs in the
background indefinitely even if application is destroyed.
Menus is Android -
In android, Menu is a part of the user interface (UI) component which is used to handle some
common functionality around the application. By using Menus in our applications, we can
provide better and consistent user experience throughout the application.
There are three types of menus in Android: Popup, Contextual and Options. Each one
has a specific use case and code that goes along with it.
A context menu (also called contextual, shortcut, and pop up or pop-up menu) is a
menu in a graphical user interface (GUI) that appears upon user interaction, such as a
right-click mouse operation. Android Popup Menu: Android Popup Menu displays a list
of items in a vertical list which presents to the view that invoked the menu and useful
to provide an overflow of actions that related to specific content. The android overflow
menu also known as Option Menu is used to show a list of vertical menus with icons
inside it. Overflow menu is place above on android application screen at the top right
side of it. User can itself customize the over flow menu icons.
The animations are basically of three types as follows: Property Animation. View
Animation. Drawable Animation.
Code –
package com.arnoldvaz.myapplication;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.Toast;
@Override
super.onCreate(savedInstanceState);
setContentView(R.laWet.activity_main);
R.anim.myanimation);
image.startAnimation(animation);
R.anim.clockwise);
image.startAnimation(animation1);
Animation animation1 =
AnimationUtils.loadAnimation(getApplicationContext(),
R.anim.fade);
image.startAnimation(animation1);
Animation animation1 =
AnimationUtils.loadAnimation(getApplicationContext(),
R.anim.blink);
image.startAnimation(animation1);
Animation animation1 =
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.move);
image.startAnimation(animation1);
Animation animation1 =
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.slide);
image.startAnimation(animation1);
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:laWet_width="match_parent"
android:laWet_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<TextView
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:text="Alert Dialog"
android:id="@+id/textView"
android:textSize="35dp"
android:laWet_alignParentTop="true"
android:laWet_centerHorizontal="true" />
<TextView
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:id="@+id/textView2"
android:textColor="#ff3eff0f"
android:textSize="35dp"
android:laWet_below="@+id/textView"
android:laWet_centerHorizontal="true" />
<ImageView
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:id="@+id/imageView"
android:src="@drawable/abc"
android:laWet_below="@+id/textView2"
android:laWet_alignRight="@+id/textView2"
android:laWet_alignEnd="@+id/textView2"
android:laWet_alignLeft="@+id/textView"
android:laWet_alignStart="@+id/textView"/>
<Button
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:text="zoom"
android:id="@+id/button"
android:laWet_alignParentLeft="true"
android:laWet_alignParentStart="true"
android:laWet_marginTop="40dp"
android:onClick="clockwise"/>
<Button
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:text="clockwise"
android:id="@+id/button2"
android:laWet_alignTop="@+id/button"
android:laWet_centerHorizontal="true"
android:onClick="zoom"/>
<Button
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:text="fade"
android:id="@+id/button3"
android:laWet_alignTop="@+id/button2"
android:laWet_alignParentRight="true"
android:laWet_alignParentEnd="true"
<Button
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:text="blink"
android:onClick="blink"
android:id="@+id/button4"
android:laWet_below="@+id/button"
android:laWet_alignParentLeft="true"
android:laWet_alignParentStart="true" />
<Button
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:text="move"
android:onClick="move"
android:id="@+id/button5"
android:laWet_below="@+id/button2"
android:laWet_alignRight="@+id/button2"
android:laWet_alignEnd="@+id/button2"
android:laWet_alignLeft="@+id/button2"
android:laWet_alignStart="@+id/button2" />
android:laWet_width="wrap_content"
android:laWet_height="wrap_content"
android:text="slide"
android:onClick="slide"
android:id="@+id/button6"
android:laWet_below="@+id/button3"
android:laWet_toRightOf="@+id/textView"
android:laWet_toEndOf="@+id/textView" />
</RelativeLaWet>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXScale="0.5"
android:toXScale="3.0"
android:fromYScale="0.5"
android:toYScale="3.0"
android:duration="5000"
android:pivotX="50%"
android:pivotY="50%" >
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:startOffset="5000"
android:fromXScale="3.0"
android:toXScale="0.5"
android:fromYScale="3.0"
android:toYScale="0.5"
android:duration="5000"
android:pivotX="50%"
android:pivotY="50%" >
</scale>
</set>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:duration="5000" >
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:startOffset="5000"
android:fromDegrees="360"
android:toDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:duration="5000" >
</rotate>
</set>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator" >
<alpha
android:fromAlpha="0"
android:toAlpha="1"
android:duration="2000" >
</alpha>
android:startOffset="2000"
android:fromAlpha="1"
android:toAlpha="0"
android:duration="2000" >
</alpha>
</set>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="0.0"
android:toAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="600"
android:repeatMode="reverse"
android:repeatCount="infinite"/>
</set>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fillAfter="true">
android:fromXDelta="0%p"
android:toXDelta="75%p"
android:duration="800" />
</set>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<scale
android:duration="500"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:interpolator="@android:anim/linear_interpolator"
android:toXScale="1.0"
android:toYScale="0.0" />
</set>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.arnoldvaz.myapplication" >
<application
android:allowBackup="true"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.animation.MainActivity"
android:label="@string/app_name" >
<intent-filter>
</intent-filter>
</activity>
</application>
</manifest>
10) <resources>
</resources>
Advertisements. Android ListView is a view which groups several items and display
them in vertical scrollable list. The list items are automatically inserted to the list
using an Adapter that pulls content from a source such as an array or database.
Android ListView is a ViewGroup that is used to display the list of items in multiple
rows and contains an adapter that automatically inserts the items into the list. The
main purpose of the adapter is to fetch data from an array or database and insert each
item that placed into the list for the desired result.
A list view is an adapter view that does not know the details, such as type and
contents, of the views it contains. Instead list view requests views on demand from a
ListAdapter as needed, such as to display new views as the user scrolls up or down. In
order to display items in the list, call setAdapter.
SQLite is very good for testing. We don't need to set up any API or install any library to
access data from SQLite. SQLite is cross-platform which means that it can be used on
Android application built on Java, and as well as cross-platform application built on
React Native.
SQLiteDatabase has methods to create, delete, execute SQL commands, and perform
other common database management tasks.
See the Notepad sample application in the SDK for an example of creating and
managing a database.
SQLite is a opensource SQL database that stores data to a text file on a device.
Android comes in with built in SQLite database implementation.
SQLite supports all the relational database features. In order to access this database,
you don't need to establish any kind of connections for it like JDBC,ODBC e.t.c
Code -
1) package com.arnoldvaz.myapplication;
import android.content.Context;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import java.util.List;
DBHelper mydb;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ArrayAdapter arrayAdapter=new
ArrayAdapter(this,android.R.layout.simple_list_item_1, array_list);
obj = (ListView)findViewById(R.id.listView1);
obj.setAdapter(arrayAdapter);
obj.setOnItemClickListener(new OnItemClickListener(){
@Override
dataBundle.putInt("id", id_To_Search);
intent.putExtras(dataBundle);
startActivity(intent);
});
@Override
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
@Override
switch(item.getItemId()) {
dataBundle.putInt("id", 0);
intent.putExtras(dataBundle);
startActivity(intent);
return true;
default:
return super.onOptionsItemSelected(item);
if (keycode == KeyEvent.KEYCODE_BACK) {
moveTaskToBack(true);
import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
int from_Where_I_Am_Coming = 0;
TextView name ;
TextView email;
TextView street;
TextView place;
int id_To_Update = 0;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_display_contact);
if(extras !=null) {
if(Value>0){
Cursor rs = mydb.getData(Value);
id_To_Update = Value;
rs.moveToFirst();
String nam =
rs.getString(rs.getColumnIndex(DBHelper.CONTACTS_COLUMN_NAME));
String phon =
rs.getString(rs.getColumnIndex(DBHelper.CONTACTS_COLUMN_PHONE));
String emai =
rs.getString(rs.getColumnIndex(DBHelper.CONTACTS_COLUMN_EMAIL));
String stree =
rs.getString(rs.getColumnIndex(DBHelper.CONTACTS_COLUMN_STREET));
String plac =
rs.getString(rs.getColumnIndex(DBHelper.CONTACTS_COLUMN_CITY));
if (!rs.isClosed()) {
rs.close();
Button b = (Button)findViewById(R.id.button1);
b.setVisibility(View.INVISIBLE);
name.setText((CharSequence)nam);
name.setFocusable(false);
name.setClickable(false);
phone.setFocusable(false);
phone.setClickable(false);
email.setText((CharSequence)emai);
email.setFocusable(false);
email.setClickable(false);
street.setText((CharSequence)stree);
street.setFocusable(false);
street.setClickable(false);
place.setText((CharSequence)plac);
place.setFocusable(false);
place.setClickable(false);
@Override
// Inflate the menu; this adds items to the action bar if it is present.
if(extras !=null) {
if(Value>0){
getMenuInflater().inflate(R.menu.display_contact, menu);
} else{
getMenuInflater().inflate(R.menu.menu_main menu);
return true;
super.onOptionsItemSelected(item);
switch(item.getItemId()) {
case R.id.Edit_Contact:
Button b = (Button)findViewById(R.id.button1);
b.setVisibility(View.VISIBLE);
name.setEnabled(true);
name.setFocusableInTouchMode(true);
name.setClickable(true);
phone.setFocusableInTouchMode(true);
phone.setClickable(true);
email.setEnabled(true);
email.setFocusableInTouchMode(true);
email.setClickable(true);
street.setEnabled(true);
street.setFocusableInTouchMode(true);
street.setClickable(true);
place.setEnabled(true);
place.setFocusableInTouchMode(true);
place.setClickable(true);
return true;
case R.id.Delete_Contact:
builder.setMessage(R.string.deleteContact)
Toast.LENGTH_SHORT).show();
startActivity(intent);
})
});
AlertDialog d = builder.create();
d.show();
return true;
default:
return super.onOptionsItemSelected(item);
if(extras !=null) {
if(Value>0){
if(mydb.updateContact(id_To_Update,name.getText().toString(),
phone.getText().toString(), email.getText().toString(),
street.getText().toString(), place.getText().toString())){
Toast.makeText(getApplicationContext(), "Updated",
Toast.LENGTH_SHORT).show();
startActivity(intent);
} else{
} else{
if(mydb.insertContact(name.getText().toString(), phone.getText().toString(),
email.getText().toString(), street.getText().toString(),
place.getText().toString())){
Toast.makeText(getApplicationContext(), "done",
Toast.LENGTH_SHORT).show();
} else{
Toast.LENGTH_SHORT).show();
startActivity(intent);
3) package com.arnoldvaz.myapplication;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase;
@Override
db.execSQL(
"(id integer primary key, name text,phone text,email text, street text,place text)"
);
onCreate(db);
public boolean insertContact (String name, String phone, String email, String
street,String place) {
SQLiteDatabase db = this.getWritableDatabase();
contentValues.put("name", name);
contentValues.put("phone", phone);
contentValues.put("email", email);
contentValues.put("street", street);
contentValues.put("place", place);
return true;
SQLiteDatabase db = this.getReadableDatabase();
SQLiteDatabase db = this.getReadableDatabase();
return numRows;
public boolean updateContact (Integer id, String name, String phone, String email,
String street,String place) {
SQLiteDatabase db = this.getWritableDatabase();
contentValues.put("name", name);
contentValues.put("phone", phone);
contentValues.put("email", email);
contentValues.put("street", street);
contentValues.put("place", place);
return true;
return db.delete("contacts",
"id = ? ",
SQLiteDatabase db = this.getReadableDatabase();
res.moveToFirst();
while(res.isAfterLast() == false){
array_list.add(res.getString(res.getColumnIndex(CONTACTS_COLUMN_NAME)));
res.moveToNext();
return array_list;
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textSize="30dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tutorials Point"
android:id="@+id/textView2"
android:layout_below="@+id/textView"
android:textSize="35dp"
android:textColor="#ff16ff01" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:layout_below="@+id/textView2"
android:layout_centerHorizontal="true"
android:src="@drawable/logo"/>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/scrollView"
android:layout_below="@+id/imageView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true">
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" >
</ListView>
</ScrollView>
</RelativeLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context=".DisplayContact" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="370dp"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<EditText
android:id="@+id/editTextName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="5dp"
android:layout_marginLeft="82dp"
android:ems="10"
android:inputType="text" >
</EditText>
<EditText
android:id="@+id/editTextEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editTextStreet"
android:layout_below="@+id/editTextStreet"
android:layout_marginTop="22dp"
android:ems="10"
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/editTextName"
android:layout_alignParentLeft="true"
android:text="@string/name"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editTextCity"
android:layout_alignParentBottom="true"
android:layout_marginBottom="28dp"
android:onClick="run"
android:text="@string/save" />
<TextView
android:id="@+id/textView2"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/editTextEmail"
android:layout_alignLeft="@+id/textView1"
android:text="@string/email"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/editTextPhone"
android:layout_alignLeft="@+id/textView1"
android:text="@string/phone"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/editTextEmail"
android:layout_alignLeft="@+id/textView5"
android:text="@string/street"
<EditText
android:id="@+id/editTextCity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/editTextName"
android:layout_below="@+id/editTextEmail"
android:layout_marginTop="30dp"
android:ems="10"
android:inputType="text" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/editTextCity"
android:layout_alignBottom="@+id/editTextCity"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/editTextEmail"
android:text="@string/country"
android:textAppearance="?android:attr/textAppearanceMedium" />
android:id="@+id/editTextStreet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editTextName"
android:layout_below="@+id/editTextPhone"
android:ems="10"
android:inputType="text" >
<requestFocus />
</EditText>
<EditText
android:id="@+id/editTextPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editTextStreet"
android:layout_below="@+id/editTextName"
android:ems="10"
android:inputType="phone|text" />
</RelativeLayout>
</ScrollView>
<resources>
<string name="action_settings">Settings</string>
<string name="title_activity_display_contact">DisplayContact</string>
<string name="name">Name</string>
<string name="phone">Phone</string>
<string name="email">Email</string>
<string name="street">Street</string>
<string name="country">City/State/Zip</string>
<string name="yes">Yes</string>
<string name="no">No</string>
</resources>
<item android:id="@+id/item1"
android:title="@string/Add_New" >
</item>
</menu>
<item
android:id="@+id/Edit_Contact"
android:orderInCategory="100"
android:title="@string/edit"/>
<item
android:id="@+id/Delete_Contact"
android:orderInCategory="100"
android:title="@string/delete"/>
</menu>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.arnoldvaz.myapplication" >
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
</intent-filter>
</activity>
<activity android:name=".DisplayContact"/>
</application>
</manifest>
android.widget.Toast. A toast is a view containing a quick little message for the user.
The toast class helps you create and show those. When the view is shown to the user,
appears as a floating view over the application. It will never receive focus.
A Toast is a feedback message. It takes a very little space for displaying while
overall activity is interactive and visible to the user. It disappears after a few
seconds. It disappears automatically. If user wants permanent visible
message, Notification can be used.
Another type of Toast is custom Toast, in which images can be used instead of
a simple message.
SharedPreferences in Android –
Android provides many ways of storing data of an application. One of this way is called
Shared Preferences. Shared Preferences allow you to save and retrieve data in the
form of key,value pair.
In order to use shared preferences, you have to call a method getSharedPreferences()
that returns a SharedPreference instance pointing to the file that contains the values
of preferences.
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
EditText ed1,ed2,ed3;
Button b1;
SharedPreferences sharedpreferences;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ed2=(EditText)findViewById(R.id.editText2);
ed3=(EditText)findViewById(R.id.editText3);
b1=(Button)findViewById(R.id.button);
sharedpreferences = getSharedPreferences(MyPREFERENCES,
Context.MODE_PRIVATE);
b1.setOnClickListener(new View.OnClickListener() {
@Override
String n = ed1.getText().toString();
String ph = ed2.getText().toString();
String e = ed3.getText().toString();
editor.putString(Name, n);
editor.putString(Phone, ph);
editor.putString(Email, e);
editor.commit();
Toast.makeText(MainActivity.this,"Thanks",Toast.LENGTH_LONG).show();
});
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textSize="35dp" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tutorials Point"
android:id="@+id/textView2"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:textSize="35dp"
android:textColor="#ff16ff01" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editText"
android:layout_below="@+id/textView2"
android:layout_marginTop="67dp"
android:hint="Name"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<EditText
android:layout_height="wrap_content"
android:id="@+id/editText2"
android:layout_below="@+id/editText"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:hint="Pass" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editText3"
android:layout_below="@+id/editText2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:hint="Email" />
<Button
android:layout_width="wrap_content"
android:text="Save"
android:id="@+id/button"
android:layout_below="@+id/editText3"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp" />
</RelativeLayout>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.arnoldvaz.myapplication" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
</intent-filter>
</activity>
</application>
</manifest>