one day workshop on "android application development" organised by department of it, govt....

38
One day Workshop on "Android Application Development" Organised by Department of IT, Govt. of Jharkhand Presenters: Chiranjeet Chakrab Samir Lakra Shrikant Prasad

Upload: thomasina-gilbert

Post on 25-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

One day Workshop on "Android Application Development"

Organised by Department of IT, Govt. of Jharkhand

Presenters:Chiranjeet ChakrabortySamir LakraShrikant Prasad

Composition

PART I – Introduction

PART II – Getting Started

PART III – Build the first app

PART IV – Understanding the project

PART V – Debugging and Deployment

PART I - Introduction

Background

Software platform from Google and the Open Handset Alliance

July 2005, Google acquired Android, Inc. November 2007, Open Handset Alliance formed

to develop open standards for mobile devices October 2008, Android available as open source December 2008, 14 new members joined

Android project

Open Handset Alliance

Open Handset Alliance (OHA) included several companies

What is Android

It is a open source software platform and operating system for mobile devices

Based on the Linux kernel Developed by Google and later the Open Handset Alliance

(OHA) Allows writing managed code in the Java language Android has its own virtual machine i.e. DVM(Dalvik Virtual

Machine),which is used for executing the android application.

Andriod Versions

Cupcake Doughnut Eclair Froyo Gingerbread

Honeycomb IcecreamSandwich

Jellybean Kitkat Lollipop

Why Android

Android, the world's most popular mobile platform 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. Android gives you a world-class platform for creating

apps and games for Android users everywhere, as well as an open marketplace for distributing to them instantly.

Why Android

Global partnerships and large installed base Building on the contributions of the open-source Linux community

and more than 300 hardware, software, and carrier partners, Android has rapidly become the fastest-growing mobile OS

Android’s openness has made it a favorite for consumers and developers alike, driving strong growth in app consumption.

With its partners, Android is continuously pushing the boundaries of hardware and software forward to bring new capabilities to users and developers

For developers, Android innovation lets you build powerful, differentiated applications that use the latest mobile technologies.

Why Android

Powerful development framework Android gives you everything you need to build best-in-

class app experiences. It gives you a single application model that lets you deploy your apps broadly to hundreds of millions of users across a wide range of devices—from phones to tablets and beyond.

The Android Developer Tools offer a full Java IDE with advanced features for developing, debugging, and packaging Android apps.

Open marketplace for distributing your apps (Google Play Store)

Platform Versions

Version Codename API Distribution

2.2 Froyo 8 0.3%

2.3.3 -2.3.7 Gingerbread 10 5.7%

4.0.3 -4.0.4 Ice Cream Sandwich

15 5.3%

4.1.x Jelly Bean 16 15.6%

4.2.x 17 18.1%

4.3 18 5.5%

4.4 KitKat 19 39.8%

5.0 Lollipop 21 9.0%

5.1 22 0.7%

ANDROID ARCHITECTURE

The software stack is split into Four Layers: The application layer The application framework The libraries and runtime The kernel

Linux Kernel

The architecture is based on the Linux 3.4 or 3.10 kernel version

This layer is core of android architecture. It provides service like power management, memory management, security etc.

It helps in software and hardware binding for better communication.

Native Libraries

Android has its own libraries, which is written in C/C++. These libraries cannot be accessed directly. With the help of application framework, we can access these libraries. There are many libraries like web libraries to access web browsers, libraries for android and video formats etc.

Android Runtime

Until version 5.0, Android used Dalvik as a process virtual machine with trace-based just-in-time (JIT) compilation to run Dalvik "dex-code" (Dalvik Executable), which is usually translated from the Java bytecode. Following the trace-based JIT principle, in addition to interpreting the majority of application code, Dalvik performs the compilation and native execution of select frequently executed code segments ("traces") each time an application is launched.

Android 4.4 introduced Android Runtime (ART) as a new runtime environment, which uses ahead-of-time (AOT) compilation to entirely compile the application bytecode into machine code upon the installation of an application. In Android 4.4, ART was an experimental feature and not enabled by default; it became the only runtime option in the next major version of Android, 5.0.

Dalvik VM Specific Libraries

This is a set of libraries used predominantly for interacting directly with an instance of the Dalvik VM and is unlikely to be used by most Android application developers.

Java Interoperability Libraries

The Java Interoperability Libraries are an open source implementation (based on the Apache Harmony project) of a subset of the Standard Java core libraries that have been adapted and transformed for use by applications running within a Dalvik VM.These libraries provide support for tasks such as string handling, networking and file manipulation (to name but a few) and are both familiar to, and widely used by Java developers .

Android Libraries

This category encompasses those Java-based libraries that are specific to Android development. Examples of libraries in this category include the application framework libraries in addition to those that facilitate user interface building, graphics drawing and database access.

Core Libraries

Application Framework

The Application Framework is a set of services that collectively form the environment in which Android applications run and are managed. This framework implements the concept that Android applications are constructed from reusable, interchangeable and replaceable components. This concept is taken a step further in that an application is also able to publish its capabilities along with any corresponding data so that they can be found and reused by other applications.

Application Framework

The Android framework includes the following key services:

Activity Manager – Controls all aspects of the application lifecycle and activity stack.

Content Providers – Allows applications to publish and share data with other applications.

Resource Manager – Provides access to non-code embedded resources such as strings, color settings and user interface layouts.

Notifications Manager – Allows applications to display alerts and notifications to the user.

View System – An extensible set of views used to create application user interfaces.

Package Manager – The system by which applications are able to find out information about other applications currently installed on the device.

Telephony Manager – Provides information to the application about the telephony services available on the device such as status and subscriber information.

Location Manager – Provides access to the location services allowing an application to receive updates about location changes.

Applications

Located at the top of the Android software stack are the applications. These comprise both the native applications provided with the particular Android implementation (for example web browser and email applications) and the third party applications installed by the user after purchasing the device.

Security-Development process

Source code security review-

Source code review can detect a broad range of security issues. Android strongly encourages both manual and automated source code review.

Android Lint should be run on all application code using the Android SDK. Issues that are identified should be corrected.

The Android lint tool is a static code analysis tool that checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization.

Native code should be analyzed using an automated tool that can detect memory management issues such as buffer overflows and off-by-one errors.

Automated testing- Compatibility Test Suite

Signing applications (APKs)

Advantages of Android as a platform

1) Low Investment & High ROI

Android comparatively has a low barrier to entry. Android provides freely its Software Development Kit (SDK) to the developer community which minimizes the development and licensing costs. The development costs can be divided into three stages:

Stage 1 – application development, Stage 2 – testing, and Stage 3 – hardware cost for testing and deploying the

android mobile application.

Advantages of Android as a platform continued..

2) Open Source Get the open source advantage from licensing,

royalty-free, and the best technology framework offered by the Android community. The architecture of the Android SDK is open-source.

This is what makes the Android mobile application development platform very attractive for handset manufacturers & wireless operators, which results in a faster development of Android based phones, and better opportunities for developers to earn more.

Advantages of Android as a platform continued..

3) Easy to Integrate The entire platform is ready for customization. You

can integrate and tweak the mobile app according to your business need. Android is the best mobile platform between the application and processes architecture. Most of the platforms allow background processes helping you to integrate the apps.

Advantages of Android as a platform continued..

4) Multiple Sales Channels Unlike other mobile platforms, Android applications can be

deployed in different ways. You do not have to rely on a single market to distribute your applications. You can use third-party application marketplace (especially in Google Android Market), but you can also form your own distribution and sales channel: applications for vertical markets, to develop new application stores, and also place it on your website.

You build it, you publish it. With your choice of promotional strategy, you can reach your end users through multiple channels.

Advantages of Android as a platform continued..

5) Easy Adoption Android applications are scripted in Java language

with the help of a rich set of libraries. Anyone can build Android applications with the knowledge of Java.

PART II – Getting Started

Tools

Android SDK Android Studio/ Eclipse or any Real Android Device (optional) JDK- http://www.oracle.com PDANET on windows for debugging on real

android devices- http://pdanet.co/

Downloading the Android Studio

SDK Interface

A software development kit that enables developers to create applications for the Android platform.

The Android SDK includes sample projects with source code, development tools, an emulator, and required libraries to build Android applications.

Applications are written using the Java programming language and run on Dalvik, a custom virtual machine designed for embedded use which runs on top of a Linux kernel.

SDK Manager Interface

Running the Android Studio

HANDS ON Sessions

PART III – Build the first app

PART IV – Understanding the Project

PART V – Debugging and Deployment

That is All