JFDP - Android App Developement Using Java PPT1
JFDP - Android App Developement Using Java PPT1
What is Android?
It is Linux Based O.S
It is Developed by Open Handset Alliance
Andy Rubin is the founder of Android
HTC launched the first product of Android
G1 was first product
All programs written in Android are basically the core java code.
So for starting the android the pre requisite is to learn the concept of java.
Since java is a pure object oriented(Yes it is coz multiple inheritance can be
achieved)
Now core java works on three main concepts.
Polymorphism,Inheritance,Encapsulation
What is Android??
And its Need??
Android is mobile operating System based on Linux.
A simple and powerful SDK.
No licensing,distribution,or development fees but it is an
open source O.S as it is developed on Linux which is an
open source.
Android first version is 1.1 released in 9th feb 2009
Then cup cake(1.5) in 30 april’09
Now currently KitKat(4.2).
Features include-Storage,connectivity,messaging,Media
players,MultiTasking,MultiTouch capability etc.
Concepts or pre-requisite for Android..
• So What Polymorphism is?
• One name many forms(method overloading static and method
overriding runtime polymorphism)
• What Encapsulation is?
• Encapsulation(wrapping of data –Abstract class)
• Inheritance (Reusability of code)
• Keywords like static(directly call by class name),final(to avoid
overriding).
• Interface-no definition or no constructor their as objects are not
initialized in it.
• Apart These Basics concepts Threading comes into picture but we will
see it later.
Architecture to Understand Android..
startActivity(new Intent(this,SecondActivity.class));
Button Clicking Event in XML..
<Button
android:onClick=“onClick”/>
public void onClick(View v)
{
Toast.makeText(getApplicationContext(),”hello”,To
ast.LENGTH_SHORT).show();
}
What is Activity??
Eg:CallLog
Methods of Activity Life Cycle..
• On Create()-called when Activity is first Created.Use to create and
instantiate the object that u will be using in app.
• onStart()-called when activity become visible.
onResume()-use to start any services or code that needs to run while
your activity is in foreground.(called when interacting the activity.)
onPause()-use to stop any services or code that doesn’t need to run when
your activity is not in foreground. If an activity has lost focus but is still
visible (that is, a new non-full-sized or transparent activity has focus on
top of your activity), it is paused. A paused activity is completely alive (it
maintains all state and member information and remains attached to the
window manager).
onStop()-called when activity is no longer visible to user.
onDestroy()-use to free up resources before your activity is destroyed.
onRestart()-called when to start again the previous activity.
What are Sevices??
Services-Background Application such as Music
Player and all.
Entry in the Manifest file for services.
<service
android:enabled=“true”
android:name=“.serviceBack”/>
</application>
What are Intents??
Types of intents..
Explicit Intent: Full name of the class is used to start that Activity.It
Requires class name.
Intent i=new Intent(class1.this,secondActivity.class);
startActivity(i);
or can write..
startActivity(new Intent(“package.SecondActivity”));//for different
project