SD Module- Android Programming

Similar documents
Android App Development. Ahmad Tayeb

Introduction To Android

Android App Development. Muhammad Sharjeel COMSATS Institute of Information Technology, Lahore

UNIT:2 Introduction to Android

Introduction to Android

Ahmed Ali Big fan of Android

Android. Lesson 1. Introduction. Android Developer Fundamentals. Android Developer Fundamentals. to Android 1

Android App Development

CS260 Intro to Java & Android 04.Android Intro

Android OS. Operating System based on Linux [ ] [Jonas Teuscher, Alex Cuordileone, Cédric Glaus]

Android Development Tutorial. Yi Huang

Minds-on: Android. Session 1

Programming with Android: System Architecture. Dipartimento di Scienze dell Informazione Università di Bologna

Android. (XKE Mars 2009) Erwan Alliaume.

IJRDTM Kailash ISBN No Vol.17 Issue

Android Overview. Most of the material in this section comes from

Android Development Tools = Eclipse + ADT + SDK

Programming with Android: System Architecture. Dipartimento di Scienze dell Informazione Università di Bologna

Android Studio Setup Procedure

BCA 6. Question Bank

Choose OS and click on it

Introduction to Android Android Smartphone Programming. Outline University of Freiburg. What is Android? Background University of Freiburg.

Programming with Android: System Architecture. Luca Bedogni. Dipartimento di Scienze dell Informazione Università di Bologna

Android Overview. Francesco Mercaldo, PhD

An Introduction to Android. Jason Chen Developer Advocate Google I/O 2008

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

Lecture 1 Introduction to Android. App Development for Mobile Devices. App Development for Mobile Devices. Announcement.

SHWETANK KUMAR GUPTA Only For Education Purpose

Mobile Programming Lecture 1. Getting Started

Mobile and Ubiquitous Computing: Android Programming (part 1)

Android In Industrial Applications. A Field Report

ANDROID SYLLABUS. Advanced Android

Introduction to Android Application Development. Mike Kvintus Principal Engineer JDSU

Android App Development

Why Android? Why Android? Android Overview. Why Mobile App Development? 20-Nov-18

SD Module-1 Advanced JAVA

Lecture 1 - Introduction to Android

Mobile Computing LECTURE # 2

Android. Operating System and Architecture. Android. Screens. Main features

Another difference is that the kernel includes only the suspend to memory mechanism, and not the suspend to hard disk, which is used on PCs.

Android SDK under Linux

Chapter 1 Hello, Android

Android Sdk Setup For Windows 7 32 Bit Full Version

Mobile OS. Symbian. BlackBerry. ios. Window mobile. Android

Introduction to Android

ECOM 5341 Mobile Computing(Android) Eng.Ruba A. Salamah

Installing and configuring an Android device emulator. EntwicklerCamp 2012

Introduction to Android

ANDRIOD APPLICATION: FOR MONITORING AVAILABILITY OF FACULTY

Mobile and Wireless Systems Programming

International Journal of Multidisciplinary Consortium Volume 2 Issue

Android Programming in Bluetooth Cochlea Group

Analysis of Android Applications & Missed Call Alerts to Registered Address

Tutorial on Basic Android Setup

Mobile development initiation

Android Online Training

Mobile Computing. Introduction to Android

Android Software Development Kit (Part I)

CS 4518 Mobile and Ubiquitous Computing Lecture 2: Introduction to Android. Emmanuel Agu

Mobile Application Development

Android App Development Workshop

DROID. By S.Gokulakrishnan AP/CSE SCSVMV

HOW TO DEVELOP FOR GLASS ENTERPRISE

Abstract. 1. Introduction

Praktikum Mobile und Verteilte Systeme. Android-Basics. Prof. Dr. Claudia Linnhoff-Popien André Ebert, Sebastian Feld

Software Development & Education Center ANDROID. Application Development

Programmazione di sistemi mobili e tablet

What is Android? Mobile Device Application Development COMPSCI 345

Android Ecosystem and. Revised v4presenter. What s New

Course Syllabus. Course Title. Who should attend? Course Description. Android ( Level 1 )

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on

Introduction. Lecture 1. Operating Systems Practical. 5 October 2016

CS 528 Mobile and Ubiquitous Computing Lecture 1b: Introduction to Android. Emmanuel Agu

IJREAT International Journal of Research in Engineering & Advanced Technology, Volume 1, Issue 5, Oct-Nov, 2013 ISSN:

Android-Basics. Praktikum Mobile und Verteilte Systeme. Prof. Dr. Claudia Linnhoff-Popien André Ebert, Sebastian Feld

Installation Instructions

Getting Started with Eclipse/Java

Developer s overview of the Android platform

PAPER ON ANDROID ESWAR COLLEGE OF ENGINEERING SUBMITTED BY:

Introduction to Android development

Android Sdk Tutorial For Windows 7 64 Bit Full Version

GUJARAT TECHNOLOGICAL UNIVERSITY

CSCU9YH Development with Android

Research on Improving performance and Battery Backup of Android Mobile with help of Cyanogen Mod, and latest kernel

Chapter 2. Operating-System Structures

Android Studio is google's official IDE(Integrated Development Environment) for Android Developers.

3- Windows Operating System

Pemrograman Mobile. Lesson 1. Introduction to Android. Create Your First Android App. Nizar Rabbi Radliya

Open Mobile Platforms. EE 392I, Lecture-6 May 4 th, 2010

Android-Basics. Praktikum Mobile und Verteilte Systeme

Android. Training.

Developing Applications for ios

Android - open source mobile platform

INDEX. CHAPTER Android Introduction

Programming Concepts and Skills. Creating an Android Project

Ferenc Peták Department of Medical Physics and Informatics 2018

A STUDY OF ANDROID OPERATING SYSTEM WITH RESPECT WITH USERS SATISFACTION

Manual Flash Install Android Adobe Tablet >>>CLICK HERE<<<

Android ATC Android Security Essentials Course Code: AND-402 version 5 Hands on Guide to Android Security Principles

IJMIE Volume 2, Issue 4 ISSN:

Transcription:

Assignment No. 1 SD Module- Android Programming R (2) C (4) V (2) T (2) Total (10) Dated Sign Title: Download Install and Configure Android Studio on Linux /windows platform. Problem Definition: Install and Configure Android Studio on Linux. 1.1 Prerequisite: Basic concepts of Installation and Configuration of Android Studio on Linux. Concepts of Android Platform Architecture and component of Android. 1.2 Software Requirements: Android Studio 1.3 Tools/Framework/Language Used: Android Studio 1.4 Hardware Requirement: PIV, 4GB RAM, 500 GB HDD, Lenovo A13-4089 Model 1.5 Learning Objectives: Install and Configure Android Studio on Linux. 1.6 Outcomes: After completion of this assignment student are able to Understand How to Install and Configure Android Studio on Linux and Android Platform Architecture. 1.7 Theory Concepts: Android is a complete set of software for mobile devices such as tablet computers, notebooks, smartphones, electronic book readers, set-top boxes etc. It contains a linux-based Operating System, middleware and key mobile applications. It can be thought of as a mobile operating system. But it is not limited to mobile only. It is currently used in various devices such as mobiles, tablets, televisions etc. History of Android The history and versions of android are interesting to know. The code names of android ranges from A to J currently, such as Aestro, Blender, Cupcake, Donut, Eclair, Froyo,Gingerbread, Honeycomb, Ice Cream Sandwitch, Jelly Bean, KitKat and Lollipop. Let's understand the android history in a sequence. 1) Initially, Andy Rubin founded Android Incorporation in Palo Alto, California, United States in October, 2003. SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 1

2) In 17th August 2005, Google acquired android Incorporation. Since then, it is in the subsidiary of Google Incorporation. 3) The key employees of Android Incorporation are Andy Rubin, Rich Miner, Chris White andnick Sears. 4) Originally intended for camera but shifted to smart phones later because of low market for camera only. 5) Android is the nick name of Andy Rubin given by coworkers because of his love to robots. 6) In 2007, Google announces the development of android OS. 7) In 2008, HTC launched the first android mobile. Android Architecture android architecture or Android software stack is categorized into five parts: 1. linux kernel 2. native libraries (middleware), 3. Android Runtime 4. Application Framework 5. Applications Let's see the android architecture first. SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 2

1) Linux kernel It is the heart of android architecture that exists at the root of android architecture. Linux kernel is responsible for device drivers, power management, memory management, device management and resource access. 2) Native Libraries On the top of linux kernel, their are Native libraries such as WebKit, OpenGL, FreeType, SQLite, Media, C runtime library (libc) etc. The WebKit library is responsible for browser support, SQLite is for database, FreeType for font support, Media for playing and recording audio and video formats. 3) Android Runtime In android runtime, there are core libraries and DVM (Dalvik Virtual Machine) which is responsible to run android application. DVM is like JVM but it is optimized for mobile devices. It consumes less memory and provides fast performance. 4) Android Framework On the top of Native libraries and android runtime, there is android framework. Android framework includes Android API's such as UI (User Interface), telephony, resources, locations, Content Providers (data) and package managers. It provides a lot of classes and interfaces for android application development. 5) Applications On the top of android framework, there are applications. All applications such as home, contact, settings, games, browsers are using android framework that uses android runtime and libraries. Android runtime and native libraries are using linux kernal. An Android component is simply a piece of code that has a well defined life cycle e.g. Activity, Receiver, Service etc. The core building blocks or fundamental components of android are activities, views, intents, services, content providers, fragments and AndroidManifest.xml. Activity An activity is a class that represents a single screen. It is like a Frame in AWT. View A view is the UI element such as button, label, text field etc. Anything that you see is a view. Intent Intent is used to invoke components. It is mainly used to: o Start the service o Launch an activity o Display a web page o Display a list of contacts o Broadcast a message SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 3

o Dial a phone call etc. For example, you may write the following code to view the webpage. 1. Intent intent=new Intent(Intent.ACTION_VIEW); 2. intent.setdata(uri.parse("http://www.javatpoint.com")); 3. startactivity(intent); Service Service is a background process that can run for a long time. There are two types of services local and remote. Local service is accessed from within the application whereas remote service is accessed remotely from other applications running on the same device. Content Provider Content Providers are used to share data between the applications. Fragment Fragments are like parts of activity. An activity can display one or more fragments on the screen at the same time. AndroidManifest.xml It contains informations about activities, content providers, permissions etc. It is like the web.xml file in Java EE. Android Virtual Device (AVD) It is used to test the android application without the need for mobile or tablet etc. It can be created in different configurations to emulate different types of real devices. Android Emulator is used to run, debug and test the android application. If you don't have the real device, it can be the best way to run, debug and test the application. It uses an open source processor emulator technology called QEMU. The emulator tool enables you to start the emulator from the command line. You need to write: emulator -avd <AVD NAME> In case of Eclipse IDE, you can create AVD by Window menu > AVD Manager > New. In the given image, you can see the android emulator, it displays the output of the hello android example. Dalvik Virtual Machine DVM As we know the modern JVM is high performance and provides excellent memory management. But it needs to be optimized for low-powered handheld devices as well. The Dalvik Virtual Machine (DVM) is an android virtual machine optimized for mobile devices. It optimizes the virtual machine for memory, battery life and performance. Dalvik is a name of a town in Iceland. The Dalvik VM was written by Dan Bornstein. The Dex compiler converts the class files into the.dex file that run on the Dalvik VM. Multiple class files are converted into one dex file. Let's see the compiling and packaging process from the source file: SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 4

he javac tool compiles the java source file into the class file. The dx tool takes all the class files of your application and generates a single.dex file. It is a platformspecific tool. The Android Assets Packaging Tool (aapt) handles the packaging process. internal details or working of hello android example. SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 5

Android Studio is the premier tool produced by Google for creating Android apps and it more than matches that other IDE used by Microsoft developers for creating Windows phone apps. Step-1 Download And Install Android Studio The first tool you need to download is of course Android Studio. You can download Android Studio from the following website: https://developer.android.com/studio/index.html A green download button will appear and it will automatically detect that you are using Linux. A terms and conditions window will appear and you need to accept the agreement. The file will now start to download. When the file has completely downloaded open a terminal window. Now type the following command to get the name of the file that was downloaded: ls ~/Downloads A file should appear with a name which looks something like this: android-studio-ide-143.2915827-linux.zip Extract the zip file by running the following command: sudo unzip android-studio-ide-143.2915827-linux.zip -d /opt Replace the android filename with the one listed by the ls command. Step-2 SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 6

Download The Oracle JDK The Oracle Java Development Kit (JDK) may be available in your Linux distribution's package manager. If it is, install the JDK (must be 1.8 or above) using the package manager (i.e. Software Centre, Synaptic etc). If the JDK isn't available in the package manager to go to the following website: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html As of writing this article, there are downloads available for JDK version 8U91 and 8U92. I recommend choosing the 8U92 version. You will see links for Linux i586 and x64 in tar.gz format and RPM format. The x64 is for 64-bit machines. If you happen to be using a distribution that uses the RPM package formatdownload the RPM format. If you are using any other version download the tar.gz version. To install Java in RPM format run the following command: rpm -ivh jdk-8u92-linux-x64.rpm To install Java from the tar.gz file follow these instructions: cd /usr/local tar xvf ~/Downloads/jdk-8u92-linux-x64.tar.gz Now you need to make sure that this version of Java is the default. Run the following command: sudo update-alternatives --config java A list of Java versions will appear. SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 7

Enter the number for the option that has the words jdk in it. For example: /usr/java/jdk1.8.0_92/jre/bin/java /usr/local/jdk1.8.0_92/jre/bin/java Step-3 Run Android Studio To run Android Studio navigate to the /opt/android-studio/bin folder using the cd command: cd /opt/android-studio/bin Then run the following command: sh studio.sh A screen will appear asking whether you want to import settings. Choose the second option which reads as "I do not have a previous version of Studio or I do not want to import my settings". This will be followed by a Welcome screen. Click "Next" to continue Step-4 Choose An Installation Type Screen will appear with options for choosing standard settings or custom settings. Choose the standard settings option and click "Next". The next screen shows a list of components which will be downloaded. SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 8

The download size is quite large and is over 600 megabytes. Click "Next" to continue. now, click "Finish". Step-5 Creating Your First Project A screen will appear with options for creating a new project and opening existing projects. Choose the start a new project link. A screen will appear with the following fields: Application name Company domain Project location For this example change the application name to "HelloWorld" and leave the rest as the defaults. Click "Next" Step-6 Choose Which Android Devices To Target You can now choose which type of Android device you wish to target. The options are as follows: Phone/Tablet Wear TV Android Auto Glass For each option, you can choose the version of Android to target. If you choose "Phone and Tablet" and then look at the minimum SDK options you will see that for each option you choose it will show you how many devices will be able to run your app. I chose 4.1 Jellybean as it covers over 90% of the market but isn't too far behind. SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 9

Click "Next" Step-7 Choose An Activity A screen will appear asking for you to choose an activity. An activity in its simplest form is a screen and the one you choose here will act as your main activity. Choose "Basic Activity" and click "Next". You can now give the activity a name and a title. For this example leave them as they are and click "Finish". Step-8 How To Run Project SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 1 0

Android Studio will now load and you can run the default project that has been set up by pressing shift and F10. You will be asked to select a deployment target. The first time you run Android Studio there won't be a target. Click the "Create New Emulator" button. Step-9 Choose A Device To Emulate A list of devices will appear and you can choose one to use as a test device. Don't worry you don't need the actual device as the phone or tablet will be emulated by your computer. When you have chosen a device click "Next". SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 1 1

A screen will appear with recommended download options. Click the download link next to one of the options for a version of Android at the same SDK as your project target or higher. This causes a new download to occur. Click "Next". You will now be back at the choose a deployment target screen. Select the phone or tablet you downloaded and click OK. 1.8 Assignment Question? 1. Explain Android ActivityLifecycle? 2. Explain Android Fragment? 3. Explain Android Application Architecture? 4. What are the code names of android? 5. Explain Android Widget? 1.9 Oral Question? 1. What is current version of Android? 2. What is difference between Android and ios? 3. Who is founder of Android? 4. Does android support other language than java? 5. What is Activity? References:- https://www.lifewire.com/install-android-studio-for-linux-4056779 https://www.javatpoint.com/android-internal-storage-example Oral Question:- https://www.javatpoint.com/android-interview-questions SNJB S K.B.J. COLLEGE OF ENGINEERING, CHANDWAD 1 2