78
INTRO ABOUT MOBILITY AND OOPS CONCEPTS

Level 1

Embed Size (px)

Citation preview

INTRO ABOUT MOBILITY AND OOPS CONCEPTS

Starting with simple regular handsets which were used just for making phone calls, mobiles have changed our lives and have become part of it. Now they are not used just for making calls but they have innumerable uses and can be used as a Camera , Music player, Tablet PC, T.V. , Web browser etc . And with the new technologies, new software and operating systems are required.

World is contracting with the growth of mobile phone technology. As the number of users is increasing day by day, facilities are also increasing.

NEED FOR MOBILITY SOLUTIONS

NEED FOR MOBILITY SOLUTIONS

• We are in Mobile Internet Computing.• Technology Reach is in Billions not in Millions. • Customers/Partners/Employees are more on mobility.

ANDROID DOMINATION IN SMARTPHONE OS MARKET

Types of

Mobile Application

GamesWeather Social Networking Maps/Navigation

Music News Banking/ FinanceVideo/Movie Travel

Shopping/RetailDinning/ Restaurant Sports

Productivity HealthEducation / Learning

Personal Care CommunicationEntertainment

Mobile ApplicationDevelopment

Approach

Native Mobile Application

Development

A native app is an app for a

certain mobile device (Android,

iOS,etc.).

A native app can be used only for its specific platform. For e.g., an android app cannot be run on an iPhone and vice versa.

These apps are built using the native programming language

Java is the native programming language for Android and Objective C is for iOS platform

Hybrid Mobile Application

Development

Hybrid apps are the applications that are developed using HTML5, java script and css, but run with in web view container on the devices and so the applications are packaged natively and so has access to native API’s of the OS also.

Mobile Web Application

Development

Mobile Web apps are cross-platform mobile applications that run on multiple devices since they mostly run on browsers. Developers can write complex apps using standard web technologies HTML5, Java Script and CSS.

Native vs Hybrid vs Mobile Web

REFRESHMENTREFRESHMENT

OFOFOOPSOOPS

REFRESHMENT OF OOPS » What is OOPS ?

» Object

» Class

» Abstraction

» Encapsulation

» Inheritance

» Polymorphism(Run Time & Compile Time)

OBJECT ORIENTED PROGRAMMING SYSTEM

Object Oriented Programming is a methodology to design a program using Classes and Objects.

It simplifies the software development and maintenance by providing some concepts:

> Object > Class> Inheritance> Polymorphism> Abstraction> Encapsulation

OBJECTA runtime entity that has state and behavior is known as Object.

Object= data + method ,Object is an instance of a class.

An object has these characteristics:

State: represents the data of an Object.Behavior: represents the behavior of an Object.Identity: object is typically implemented via a unique ID.Real time Example:Pen is an object. Its name is Reynolds, color is White etc,.Known as it state.It is used to write, so Writing is its behavior.

CLASS

A Class is a group of objects that have common property. (or)

Collection of Objects. It is a Template or Blue Print from which objects are created.

Syntax to declare a Class:

Class <class name> { data member; method; }

Example for Class and Object: Class student { String name = “Target Soft Systems”; int phoneno = “9382383393”; public static void main( string[] args) { Student s1 = new student(); // object System.out.println(“Name is:” +s1.name); System.out.println(“Phone No:” +s1.phoneno); }

} Output: Name is: Target Soft Systems Phone No: 9382383393

ABSTRACTIONAbstraction is a process of hiding the implementation details and showing only functionality to the user. (OR)It highlights the essential things to the user and hides the non- essential things.Real Time Example:Sending SMS: you just type the text and send the message you don’t know the internal processing about message delivery. Syntax to declare the abstract class: Abstract class < class- name> {

}

ENCAPSULATION

Encapsulation is a process of wrapping code and Data together into a single unit.

We can calculate a fully encapsulated class by making all the data members of the class private now we can use setter and getter methods to set and get the data in it.

In a encapsulated class we can access only the methods we can’t able to access the data that scenario is called Data Hiding.

INHERITANCEInheritance is a mechanism in which one object acquires and the properties and behaviors of parent class. A new class derived from old class.Syntax for Inheritance:

class subclass name extends super class name{

}extends is a key word is used to inherit one class for another class.On the basis of class, there can be three types of inheritance single, multilevel and Hierarchical. Multiple and Hybrid is supported through interface only. To reduce the complexity and simplify the language, multiple interfaces are not supported in Java.

POLYMORPHISMIn general polymorphism is a particular thing behave differently in a different situation

Two types of Polymorphism: Compile time Polymorphism Run time PolymorphismRun time Polymorphism Example: Method Overloading.Compile time Polymorphism Example: Method Overriding.Real time Example: Mobile Phone: It acts like a phone where you calling to someone. It acts like a camera whiles you taking a snap. It acts like a Music player whiles you hearing song from that.

RUN TIME POLYMORPHISMRUN TIME POLYMORPHISMMethod overloading:Method having same name but difference in the number of arguments and its data type.

Example:Sum( int a, int b)Sum( int a, int b, int c)Sum( float a, float b)Sum( float a, float b, float c)

For example the entire method names are same but the main difference in the number of arguments and its data type.

COMPILE TIME POLYMORPHISM

Method Overriding:

Method having same name, same number of arguments and its data type.

overriding method MUST have the same argument list (if not, it might be a case of overloading)

overriding method MUST have the same return type; the exception is covariant return (used as of Java 5) which returns a type that is a subclass of what is returned by the over riden method

INTRO ABOUT ANDROID AND ITS COMPONENTS

What is Android ?What is Android ?

Android is a Operating System based on Linux Kernel

If any Operating System based on Linux Kernel then no need to install any hardware drivers and all its automatically recognize hardware

In previous days people said like android is a mobile operating system because that time android was working as a operating system only for mobile but now android is working as a Operating system for Smartphone, Tablet ,TVs ,Cameras ,Smart Glasses ,Wristwatches ,Headphones etc…

Operating System

Operating System

Based on Linux Kernel

Based on Linux Kernel

Android Inc. was Started in 2003 by Andy Rubin

Android Inc. was Started in 2003 by Andy Rubin

Google purchased Android Inc. in 2005

Google purchased Android Inc. in 2005

ANDROID ANDROID

DEVICESDEVICES

MobilesMobiles TabletsTablets

GlassGlassWearable'sWearable's

WatchWatch

TelevisionTelevision Set-Up BoxSet-Up Box

ANDROID HISTORY

•Android Inc was founded in Palo Alto of California, U.S. by Andy Rubin, Rich miner, Nick sears and Chris White in 2003. Later Android Inc. was acquired by Google in 2005.

•In 2005 Google purchased Android and took over its development work and also the development team.

•Google wanted Android to be open and free then most of the Android code was released under open source.

VERSIONS OF ANDROIDPre-commercial release versions (2007–2008)

Android alpha

There were at least two internal releases inside Google and the OHAreleases code-named “Astra Boy", “Bender"

Android beta

The Android beta was released on 5 November 2007

The Software Developement Kit (SDK) was released on 12th November 2007.

The 5th November date is popularly celebrated as “Android's Birthday”

VERSIONS OF ANDROID

 Android has seen numerous Updates which have incrementally improved the operating system, adding new features and fixing bugs in previous releases.

Each major release is named in alphabetical order after a dessert or sugary treat

For example

Version 1.5 Cupcake was followed by 1.6 Donut.

The latest released version is 4.4 Kit Kat

CUPCAKE 1.5CUPCAKE 1.5

On 30 April 2009, the Android 1.5 update was released.

This was the first release to officially use a codename based on a dessert item ("Cupcake")

»Added auto-rotation option.

»Copy and Paste feature added in the web browser.

»Increased speed and performance but not up to required level.

VERSIONS OF ANDROID

DONUT 1.6DONUT 1.6

On 15 September 2009, the Android 1.6 SDK - Donut was released

»Voice search

»Search box

»Faster OS boot times

»Fast web browsing experience.

»Typing is quite slower.

VERSIONS OF ANDROID

ECLAIR 2.0ECLAIR 2.0On 26 October 2009, the Android 2.0 SDK codenamed Eclair was released.

»Bluetooth 2.1 support.» Improved typing speed on virtual keyboard with smarter dictionary.» no Adobe flash media support.

 on 3 December 2009 Android 2.0.1 Éclair was released.

on 12 January 2010 Android 2.1 Éclair was released.

VERSIONS OF ANDROID

FROYO 2.2FROYO 2.2

On 20 May 2010, the SDK for Android 2.2 was released

»Support for Adobe Flash 10.1

» Improved Application launcher

with better browser

» No internet calling.

VERSIONS OF ANDROID

GINGERBREAD 2.3GINGERBREAD 2.3

On 6 December 2010, the Android 2.3 (Gingerbread) SDK was

released

»Updated User Interface with high 

»efficiency and speed

» Internet calling

» One touch word selection and copy/paste.

» New keyboard for faster word input.»on 9 February 2011 Android 2.3.3 Gingerbread was released.on 28 April 2011 Android 2.3.4 Gingerbread was released.

VERSIONS OF ANDROID

HONEYCOMB 3.0HONEYCOMB 3.0On 22 February 2011, the Android 3.0 (Honeycomb) SDK was released

»Support for multi-core processors

» Ability to encrypt all user data.

» This version of android is only available for tablets.

on 10 May 2011 Android 3.1 Honeycomb was released.

on 15 July 2011 Android 3.2 Honeycomb was released.

VERSIONS OF ANDROID

ICE CREAM SANDWICH 4.0ICE CREAM SANDWICH 4.0On 19 October 2011, the Android 4.0 (Ice Cream Sandwich) SDK was released

»Virtual button in the UI.

» A new typeface family for the UI.

» Ability to shut down apps that are using data in the background

on 16 December 2011 4.0.3 Ice Cream Sandwich was released.

on 29 March 2012 4.0.4 Ice Cream Sandwich was released.

VERSIONS OF ANDROID

JELLY BEAN 4.1JELLY BEAN 4.1

On 27 June 2012, the Android 4.1 (Jelly Bean) SDK was released

»User – Installable Keyboard Maps

» Multichannel Audio.

» Bluetooth Data Transfer with Android Beam.

on 29 October 2012 4.2 Jelly Bean was released.

on 24 July 2013 4.3 Jelly Bean was released.

VERSIONS OF ANDROID

KIT KAT 4.4KIT KAT 4.4

On 3 September 2013, the Android 4.4 (Kit Kat) SDK was released

»New Framework for UI Transitions.

» Built-In Screen Recording.

»Wireless printing Capability

VERSIONS OF ANDROID

LOLLIPOP ANDROID 5.0• on June 25, 2014, the

android LolliPop 5.0 was released.

• Redesigned user interface built around a design language known as "Material design".

• Improvements to the notifications, which can be accessed from the lock screen and displayed within applications as top-of-the-screen banners.

ANDROID FEATURESANDROID FEATURES»STRORAGE

SQLite, a lightweight relational database.

»CONNECTIVITYSupports GSM, CDMA, Bluetooth, Wi-Fi, WiMAX.

»MESSAGING Supports both SMS and MMS.

»MEDIA SUPPORTSupports following media files: MP3,3GP,MP4,JPEG,PNG,GIF,BMP,AMR,MIDI,...etc.

»HARDWARE SUPPORTAccelerometer sensor, Camera, GPS, Digital compass.

»MULTI TASKINGsupports multi –tasking applications.

Android ArchitectureAndroid Architecture

Android Architecture having Four Main Layer and One Sub Android Architecture having Four Main Layer and One Sub

LayerLayer

»Applications - Main Layer

»Application Framework - Main Layer

»Libraries - Main Layer

»Android Runtime - Sub Layer

»Linux kernel - Main Layer

Android Architecture

Linux Kernel

» Relying on Linux Kernel 2.6 for core system services» Memory and Process Management» Network Stack» Driver Model» Security

» Providing an abstraction layer between the H/W and the rest of the S/W stack

Android Runtime

Core LibrariesProviding most of the functionality available in the core libraries of the Java language

Dalvik Virtual MachineProviding environment on which every Android application runs

LibrariesLibraries

» Including a set of C/C++ libraries used by components of the

Android system

» Exposed to developers through the Android application

framework

Application Framework LayerApplication Framework Layer

Feature RoleView

SystemUsed to build an application, including lists, grids, textboxes, buttons, and embedded web browser

Content Provider

Enabling applications to access data from other applications or to share their own data

Resource Manager

Providing access to non-code resources (localized strings, graphics, and layout files)

Notification Manager

Enabling all applications to display customer alerts in the status bar

Activity Manager

Managing the lifecycle of applications and providing a common navigation backstack

Application LayerApplication Layer

Android provides a set of core applications:

» Email Client

» SMS Program

» Calendar

» Maps

» Browser

» Contacts

Android ArchitectureAndroid Architecture

Function Of DVMFunction Of DVM

*.java *.class *.dex

*.apk

Javac dex

aapk

ANDROID ANDROID

ENVIRONMENTENVIRONMENT

SETUPSETUP

Software Requirement

Software Requirement

JAVA JDK 1.6 or later

JAVA JDK 1.6 or later

&&

ADTADT

(Android Developer Tools)

(Android Developer Tools)

OS RequirementOS Requirement

Windows XP (32-bit)

Windows 7 (32- or 64-bit)

Mac OS X 10.5.8 or later (x86 only)

Ubuntu version 8.04 or later

How to set up Android How to set up Android EnvironmentEnvironment

Before you are going to download ADT (Android Developer Tools)You have to download and install JAVA JDK from the below link

http://www.oracle.com/technetwork/java/javase/downloads/index.html

After finishing the JAVA installation you have to download ADT form the below link

http://developer.android.com/sdk/index.html

» Unpack the ZIP file (named adt-bundle-<os_platform>.zip) and

save it to an appropriate location, such as a "Development“

directory in your home directory.

» Open the adt-bundle-<os_platform>/eclipse/ directory and

launch eclipse.exe

Android SDKThe Android SDK, which is mandatory in order to create any

Android application, is the kit where all the tools required to

develop any Android project are available.

The following are some among the tools contained by the Android

SDK.

Android Emulator

DDMS (Dalvik Debug Monitor Service)

adb (Android Debug Bridge)

SQLite3

ADT (Android Development Tools) Plug-in

ADT is a plug-in for Eclipse IDE provided by Android.

This extends the capabilities of the Eclipse IDE & makes it a place where we can develop, run & debug Android projects.

Developing Android projects in Eclipse with the help of ADT plug-in is said to be the highly recommended way.

The ADT is not needed if you choose to work in an IDE other than Eclipse.

1. Click New   in the toolbar.

2. In the window that appears, open the Android folder, select Android Application Project, and click Next.

3. Fill in the form that appears:

• Application Name is the app name that appears to users. For this project, use "My First App.“

• Project Name is the name of your project directory and the name visible in Eclipse.

How To Create a New Android Project

4. On the next screen to configure the project, leave the default selections and click Next.

5. The next screen can help you create a launcher icon for your app. You can customize an icon in several ways and the tool generates an icon for all screen densities. Before you publish your app, you should be sure your icon meets the specifications defined in the Iconography design guide.Click Next.6. Now you can select an activity template from which to begin building your app.For this project, select Blank Activity and click Next.

7. Leave all the details for the activity in their default state and click Finish.

Android Application Project Structure

Whether you're using Eclipse or the command line, to run your app on the emulator you need to first create an Android Virtual Device (AVD). An AVD is a device configuration for the Android emulator that allows you to model different devices.

How To Create a New AVD(Android Virtual Device)

To create an AVD:1. Launch the Android Virtual Device Manager:

a. In Eclipse, click Android Virtual Device Manager from the toolbar.

2. In the Android Virtual Device Manager panel, click New.

3. Fill in the details for the AVD. Give it a name, a platform target, an SD card size, and a skin (HVGA is default).

4. Click Create AVD.

5. Select the new AVD from the Android Virtual Device Manager and click Start.

6. After the emulator boots up, unlock the emulator screen.

ANDROID ANDROID

COMPONENTSCOMPONENTS

ActivityActivity

ServicesServices

BroadcastBroadcast

ReceiverReceiver

ContentContent

ProviderProvider

Activities

Visual user interface focused on a single thing a user can do

Services

`No visual interface – they run in the background

Broadcast Receivers

Receive and react to broadcast announcements

Content Providers Allow data exchange between applications

THANK YOU

THANK YOU