Anatomy of an Android Application

Slides:



Advertisements
Similar presentations
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Scienze dellInformazione Università di Bologna.
Advertisements

Ando-it-yourself droid Praveen Kumar Pendyala. Outline Brief intro to the Droid developement Setting up the Life saviors - Development tools Hello Droid.
Application Fundamentals Android Development. Announcements Posting in D2L Tutorials.
David Angulo Rubio ANDROID OS Open Software Platform for Mobile Devices.
Programming Mobile Applications with Android
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Android Life Cycle CS328 Dick Steflik. Life Cycle The steps that an application goes through from starting to finishing Slightly different than normal.
Android and Project Structure. Android Android OS – Built on Linux Kernel – Phones – Netbooks – Readers – Other???
Basic, Basic, Basic Android. What are Packages? Page 346 in text Package statement goes before any import statements Indicates that the class declared.
Android Programming Beomjoo Seo Sep., 12 CS5248 Fall 2012.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
Chien-Chung Shen Manifest and Activity Chien-Chung Shen
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Chapter 3 Navigating a Project Goals & Objectives 1.Get familiar with the navigation of the project. How is everything structured? What settings can you.
Android: versions Note that: Honeycomb (Android v3.0) A tablet-only release Jelly Bean (Android v4.1) Released on July 09, 2012.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Chapter 2: Simplify! The Android User Interface
1 Programming in Android. 2 Outline 3 What you get from Android An Android Application is a Loosely-Coupled Software System The Project Structure The.
Basic Android Tutorial USF’s Association for Computing Machinery.
CE Applied Communications Technology Android lecture 2 - Structures Android File structure Resources Drawables Layout Values R Class Manifest Running.
Android for Java Developers Denver Java Users Group Jan 11, Mike
Presented By: Muhammad Tariq Software Engineer Android Training course.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
Android Boot Camp for Developers Using Java, 3E
Configuring Android Development Environment Nilesh Singh.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
Android 3: Exploring Apps and the Development Environment Kirk Scott 1.
First Venture into the Android World Chapter 1 Part 2.
Introduction to Android
ANDROID APPLICATION DEVELOPMENT. ANDROID DEVELOPMENT DEVELOPER.ANDROID.COM/INDEX.HTML THE OFFICIAL SITE FOR ANDROID DEVELOPERS. PROVIDES THE ANDROID SDK.
Resources & Android Manifest Калин Кадиев Astea Solutions AD.
INTRODUCTION TO ANDROID. Slide 2 Introduction I take a top-down approach to describing an application’s anatomy.
Android apps development - Eclipse, Android SDK, and ADT plugin Introduction of.
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
CHAPTER 1 part 1 Introduction. Chapter objectives: Understand Android Learn the differences between Java and Android Java Examine the Android project.
Introduction to Android Programming
Introduction to Android Chapter 1 1. Objectives Understand what Android is Learn the differences between Java and Android Java Examine the Android project.
Chapter 2: Simplify! The Android User Interface
Mobile Applications (Android Programming)
Lab7 – Appendix.
Android 3: Exploring Apps and the Development Environment
Android Application Development
Introduction to android
Mobile Applications (Android Programming)
Android Mobile Application Development
Android Introduction Hello World
Android 01: Fundamentals
Obtaining the Required Tools
Mobile Application Development Chapter 3 [Using Eclipse Android Studio for Android Development] IT448-Fall 2017 IT448- Fall2017.
Android.
MAD.
Activities and Intents
Mobile Device Development
CS5103 Software Engineering
Adding Functionality to the App Tip Calculator App Activity and the Activity Lifecycle onCreate is called by the system when an Activity.
CMPE419 Mobile Application Development
Android Application Development
Emerging Platform#3 Android & Programming an App
Mobile Programming Dr. Mohsin Ali Memon.
Introduction to Android
CMPE419 Mobile Application Development
Presentation transcript:

Anatomy of an Android Application IN Lecture - 4 Krishnaveni S,Assistant Professor,Department Of Software Engineering

Anatomy of an Android Application We have created your first Hello World Android application, it is time to dissect the innards of the Android project and examine all the parts that make everything work First, note the various files that make up an Android project in the Package Explorer in Eclipse The various folders and their files are as follows: src gen Android 4.0 library assets bin res AndroidManifest.xml Krishnaveni S,Assistant Professor,Department Of Software Engineering

Krishnaveni S,Assistant Professor,Department Of Software Engineering src folder: Contains the .java source files for your project. In this example, there is one file, HelloWorldActivity.java. The HelloWorldActivity.java file is the source file for your activity. You write the code for your application in this file. The Java file is listed under the package name for your project, which in this case is net .learn2develop.HelloWorld. INTRODUCTION TO ANDROID PROGRAMMING Krishnaveni S,Assistant Professor,Department Of Software Engineering

Krishnaveni S,Assistant Professor,Department Of Software Engineering gen folder: Contains the R.java file, a compiler-generated file that references all the resources found in your project. You should not modify this file. All the resources in your project are automatically compiled into this class so that you can refer to them using the class. Android 4.0 library: This item contains one file, android.jar, which contains all the class libraries needed for an Android application. Krishnaveni S,Assistant Professor,Department Of Software Engineering

Krishnaveni S,Assistant Professor,Department Of Software Engineering Assets: This folder contains all the assets used by your application, such as HTML, text files, databases, etc. bin : This folder contains the files built by the ADT during the build process. In particular, it generates the .apk file (Android Package). An .apk file is the application binary of an Android application . It contains everything needed to run an Android application res : This folder contains all the resources used in your application. It also contains a few other subfolders: drawable-, layout, and values. you can support devices with different screen resolutions and densities. INTRODUCTION TO ANDROID PROGRAMMING Krishnaveni S,Assistant Professor,Department Of Software Engineering

Krishnaveni S,Assistant Professor,Department Of Software Engineering AndroidManifest.xml : This is the manifest file for your Android application. Here you specify the permissions needed by your application, as well as other features (such as intent-filters, receivers, etc.). The main.xml file defines the user interface for your activity, Observe the following in bold: The @string in this case refers to the strings.xml file located in the res/values folder. Hence, @string/hello refers to the hello string defined in the strings.xml file, which is “Hello World, HelloWorldActivity!” Krishnaveni S,Assistant Professor,Department Of Software Engineering

Krishnaveni S,Assistant Professor,Department Of Software Engineering

The next important file in an Android project is the manifest file The next important file in an Android project is the manifest file. Note the content of the AndroidManifest.xml file: INTRODUCTION TO ANDROID PROGRAMMING

The AndroidManifest.xml file contains detailed information about the application: It defines the package name of the application as net.learn2develop.HelloWorld. The version code of the application is 1 (set via the android:versionCode attribute). This value is used to identify the version number of your application. It can be used to programmatically determine whether an application needs to be upgraded. The version name of the application is 1.0 (set via the android:versionName attribute). This string value is mainly used for display to the user. You should use the format <major>.<minor>.<point> for this value. The android:minSdkVersion attribute of the <uses-sdk> element specifies the minimum version of the OS on which the application will run. The application uses the image named ic_launcher.png located in the drawable folders. The name of this application is the string named appname defined in the strings.xml file. There is one activity in the application represented by the HelloWorldActivity.java file. The label displayed for this activity is the same as the application name.

Within the definition for this activity, there is an element named <intent-filter> 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. As you add more files and folders to your project, Eclipse will automatically generate the content of R.java, which currently contains the following:

Finally, the code that connects the activity to the UI (main Finally, the code that connects the activity to the UI (main.xml) is the setContentView() method, which is in the HelloWorldActivity.java file: Here, R.layout.main refers to the main.xml file located in the res/layout folder. As you add additional XML files to the res/layout folder, the filenames will automatically be generated in the R.java file. The onCreate() method is one of many methods that are fi red when an activity is loaded.

Krishnaveni S,Assistant Professor,Department Of Software Engineering INTRODUCTION TO ANDROID PROGRAMMING Krishnaveni S,Assistant Professor,Department Of Software Engineering

Krishnaveni S,Assistant Professor,Department Of Software Engineering INTRODUCTION TO ANDROID PROGRAMMING Krishnaveni S,Assistant Professor,Department Of Software Engineering