Training
Training
Submitted to
ACKNOWLEDGEMENT
We take the opportunity to express our cordial gratitude and deep sense of
indebtedness to our teachers for her valuable guidance and inspiration throughout the
training duration. We feel thankful to him/her for innovative ideas given by his/her
which lead to successful completion of this training . We feel proud and fortunate to
work under such as an outstanding mentor in the field of Android. He/She has always
welcomed our problems and helped us to clear our doubt. We will always be grateful
to him/her for providing us moral support and sufficient time.
We owe sincere thanks to Dr. B.V. Tiwari, Principal, Swami Vivekanand institute of
Technology, Sagar for rendering me all possible facilities during our training work in
the Department.
At the same time, we would like to thank all other faculty member and non teaching
staff in CS/IT department for their valuable co-operation.
Last but not the least I must express thanks to my parents, brothers & sisters without
their moral support it was impossible for me to complete this work.
Sonu Rajwant
VII Semester
B.E.(CSE)
Company profile
Wide Vision Technologies is one of the India’s leading web design and web
application development.
We take pride in to and feel privileged in getting them to experience it. At the
outset, we would like to introduce ourselves as since 8th January 2008; with
its head office based at Indbased at Monroe Township, NJ 08831, USA. Wide
Vision Technologies works primarily with offshore customers.
INTRODUCTION
Android is an open source and Linux-based Operating System for mobile
devices such as smartphones and tablet computers. Android was developed by
the Open Handset Alliance, led by Google, and other companies.
The first beta version of the Android Software Development Kit (SDK) was released
by Google in 2007 where as the first commercial version, Android 1.0, was released
in September 2008.
On June 27, 2012, at the Google I/O conference, Google announced the next Android
version, 4.1 Jelly Bean. Jelly Bean is an incremental update, with the primary aim of
improving the user interface, both in terms of functionality and performance.
Features of Android
Android is a powerful operating system competing with Apple 4GS and supports great
features. Few of them are listed below:
Feature Description
Android OS basic screen provides a beautiful and intuitive user
Beautiful UI
interface.
GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi,
Connectivity
LTE, NFC and WiMAX.
SQLite, a lightweight relational database, is used for data storage
Storage
purposes.
H.263, H.264, MPEG-4 SP, AMR, AMR-WB, AAC, HE-AAC, AAC
Media support
5.1, MP3, MIDI, Ogg Vorbis, WAV, JPEG, PNG, GIF, and BMP
Messaging SMS and MMS
Based on the open-source WebKit layout engine, coupled with
Web browser
Chrome's V8 JavaScript engine supporting HTML5 and CSS3.
Android has native support for multi-touch which was initially made
Multi-touch
available in handsets such as the HTC Hero.
User can jump from one task to another and same time various
Multi-tasking
application can run simultaneously.
Resizable Widgets are resizable, so users can expand them to show more
widgets content or shrink them to save space
Multi-Language Supports single direction and bi-directional text.
When you write a desktop application, you are “master of your own domain.” You
launch your main window and any child windows like dialog boxes that are needed.
From your standpoint, you are your own world, leveraging features supported by the
operating system, but largely ignorant of any other program that may be running on
thecomputer at the same time. If you do interact with other programs, it is typically
through an application programming interface (API), such as Java Database
Connectivity (JDBC),or frameworks atop it, to communicate with MySQL or another
database.
Android Applications
Android applications are usually developed in the Java language using the Android
Software Development Kit.
Once developed, Android applications can be packaged easily and sold out either
through a store such as Google Play or the Amazon Appstore.
Android powers hundreds of millions of mobile devices in more than 190 countries
around the world. It's the largest installed base of any mobile platform and growing
fast. Every day more than 1 million new Android devices are activated worldwide.
This tutorial has been written with an aim to teach you how to develop and package
Android application. We will start from environment setup for Android application
programming and then drill down to look into various aspects of Android
applications.
Eclipse
Eclipse is an extremely popular integrated development environment (IDE),
particularly for Java development. It is also designed to be extensible via an add-in
system. To top it off, Eclipse is open source, thanks to the beneficence of IBM many
years back in its decision to release Eclipse to the wide world. That combination made
it an ideal choice of IDE for the core Android developer team.
Specifically, to go alongside the Android SDK, Google has published some add-ins
for the Eclipse environment. Primary among these is the Android Developer Tools
(ADT) add-in, which gives Eclipse it core awareness of Android.
The ability to run an Android project just like you might run a regular
Java application—via the green Run button in the toolbar—despite the
fact that this really involves pushing the Android application over to an
emulator or device, possibly even starting up the emulator if it is not
running
Tooltip support for Android classes and methods
HOW TO INSTALL ADT BOUNDLE
Step 1 - Setup Java Development Kit JDK
You can download the latest version of Java JDK from Oracle's Java site: Java SE
Downloads. You will find instructions for installing JDK in downloaded files, follow
the given instructions to install and configure the setup. Finally set PATH and
JAVA_HOME environment variables to refer to the directory that contains java and
javac, typically java_install_dir/bin and java_install_dir respectively.
If you are running Windows and installed the JDK in C:\jdk1.6.0_15, you would have
to put the following line in your C:\autoexec.bat file.
Next, follow the instructions provided and keep all other entries as default till the final
step. Once your project is created successfully, you will have following project
screen:
Anatomy of Android Application
Before you run your app, you should be aware of a
few directories and files in the Android project:
Folder, File & Description
1. src
This contains the .java source files for your project. By default, it
includes an MainActivity.java source file having an activity class that runs
when your app is launched using the app icon.
2. gen
This contains the .R file, a compiler-generated file that references all the
resources found in your project. You should not modify this file.
3. bin
This folder contains the Android package files .apk built by the ADT
during the build process and everything else needed to run an Android
application.
4. res/drawable-hdpi
This is a directory for drawable objects that are designed for high-density
screens.
5. res/layout
This is a directory for files that define your app's user interface.
6. res/values
This is a directory for other various XML files that contain a collection of
resources, such as strings and colors definitions.
AndroidManifest.xml
7. This is the manifest file which describes the fundamental characteristics of the
app and defines each of its components.
Following section will give a brief overview few of the important application files.
package com.example.helloworld;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloworld"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
The <activity> tag is used to specify an activity and android:name attribute specifies
the fully qualified class name of the Activity subclass and the android:label attributes
specifies a string to use as the label for the activity. You can specify multiple activities
using <activity> tags.
The action for the intent filter is named android.intent.action.MAIN to indicate that
this activity serves as the entry point for the application. The category for the intent-
filter is named android.intent.category.LAUNCHER to indicate that the application
can be launched from the device's launcher icon.
The @string refers to the strings.xml file explained below. Hence, @string/app_name
refers to the app_name string defined in the strings.xml fi le, which is "HelloWorld".
Similar way, other strings get populated in the application.
Following is the list of tags which you will use in your manifest file to specify
different Android application components:
<resources>
<string name="app_name">HelloWorld</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
</resources>
The R File
The gen/com.example.helloworld/R.java file is the glue between the activity Java
files like MainActivity.java and the resources like strings.xml. It is an automatically
generated file and you should not modify the content of the R.java file. Following is a
sample of R.java file:
package com.example.helloworld;
<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" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:padding="@dimen/padding_medium"
android:text="@string/hello_world"
tools:context=".MainActivity" />
</RelativeLayout>
Congratulations!!! you have developed your first Android Application and now just
keep following rest of the tutorial step by step to become a great Android Developer.
All the very best.
Layouts
A layout defines the visual structure for a user interface, such as the UI for an activity
or app widget. You can declare a layout in two ways:
Layout Parameters
XML layout attributes named layout_something define layout parameters for the View
that are appropriate for the ViewGroup in which it resides.
Common Layouts
Each subclass of the ViewGroup class provides a unique way to display the views you
nest within it. Below are some of the more common layout types that are built into the
Android platform.
Linear Layout
A layout that organizes its children into a single horizontal or vertical row. It creates a
scrollbar if the length of the window exceeds the length of the screen.
Relative Layout
Enables you to specify the location of child objects relative to each other (child A to
the left of child B) or to the parent (aligned to the top of the parent).
Web View
When the content for your layout is dynamic or not pre-determined, you can use a
layout that subclasses AdapterView to populate the layout with views at runtime. A
subclass of the AdapterView class uses an Adapter to bind data to its layout. The
Adapter behaves as a middleman between the data source and the AdapterView layout
—the Adapter retrieves the data (from a source such as an array or a database query)
and converts each entry into a view that can be added into the AdapterView layout.
List View
Grid View
State Description
Started 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.
Bound A service is bound when an application component binds to it by
calling bindService(). A bound service offers a client-server interface
that allows components to interact with the service, send requests,
get results, and even do so across processes with interprocess
communication (IPC).
LIFE CYCLE :
. Intent filter
An Android Intent is an object carrying an intent ie. message from one component to
another component with-in the application or outside the application. The intents can
communicate messages among any of the three core components of an application -
activities, services, and broadcast receivers.
The intent itself, an Intent object, is a passive data structure holding an abstract
description of an operation to be performed.
For example, let's assume that you have an Activity that needs to launch an email
client and sends an email using your Android device. For this purpose, your Activity
would send an ACTION_SEND along with appropriate chooser, to the Android Intent
Resolver. The specified chooser gives the proper interface for the user to pick how to
send your email data.
Storage
Android provides many kinds of storage for applications to store their data. Thes
storage places are :
shared preferences .
Internal and external storage.
SQLite storage .
Storage via network connection.
Sqlite
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 datbase 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
Database - Package
The main package is android.database.sqlite that contains the classes to manage your
own databases
Database - Creation
In order to create a database you just need to call this method openOrCreateDatabase
with your database name and mode as a parameter. It returns an instance of SQLite
database which you have to recieve in your own object.Its syntax is given below
Google provides this facility using google play services library which you have to
download externally. After downloading , you have to integrate it with your project.In
the end you have to integrate your application with google via google console. This is
completely discussed in the example.
Google provides GoogleMap and MapFragment api to integrate map in your android
application. In order to use GoogleMap , you have to create an object of GoogleMap
and get the reference of map from the xml layout file.Its syntax is given below:
GoogleMap googleMap;
googleMap = ((MapFragment)
getFragmentManager().findFragmentById(R.id.map)).getMap();
ACTIVITY
An activity represents a single screen with a user interface. For example, an email
application might have one activity that shows a list of new emails, another activity to
compose an email, and another activity for reading emails. If an application has more
than one activity, then one of them should be marked as the activity that is presented
when the application is launched.
SharedPreferences sharedpreferences =
getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
The first parameter is the key and the second parameter is the MODE. Apart from
private there are other modes availaible that are listed below:
Live Chat
Message Notifications/Alerts
Photo Sharing and Uploading
Profile Viewing and Commenting
GPS and Geolocation Features
Social Sharing
We also build tailored apps that make it easy for you to maintain and enhance your
presence on various social networking sites. By integrating fascinating Social-
Network Applications For Android, you can fulfill your personal or professional
objectives. You can then entice visitors to visit your site, and ultimately buy your
product or services.
SUMMARY
This is the android based application containing many concept of android4. With the
help of this any person can easily done their task. With the help of this game any
person can improve your vocabulary. In emag draw we can choose the option which
type of spellings you want to appear and at blank place you can put the word chosen
from the given words. If you choose a correct alphabet then it increase your scores
.you can save your scores and create a record. It is very funny to play. You can try this
with hand word puzzle game and see how you are actually learning words and
become addictive playing.
Technology
o Introduction
o Application/Usage
Modules of Training
Daily Diary
Summary
Instruction:-