@2011 Mihail L. Sichitiu1 Android Introduction Hello World.

Slides:



Advertisements
Similar presentations
Android Development Tutorial Yi Huang. Contents 2  What’s Android  Android architecture  Android software development  ‘Hello World’ on Android 
Advertisements

Android architecture overview
App Development for Android
Android Aims to bring Internet-style innovation and openness to mobile phones.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
The Android Development Environment.  Getting started on the Android Platform  Installing required libraries  Programming Android using the Eclipse.
Who Am I And Why Am I Here I’m professor Stephen Fickas in CIS – you can call me Steve. I have a research group that works with mobile devices (since 1995!)
User Interface Android Applications. Activities An activity presents a visual user interface. Each activity is given a default window to draw in. The.
Client / Server Programming in Android Eclipse IDE Android Development Tools (ADT) Android SDK
Basic, Basic, Basic Android. What are Packages? Page 346 in text Package statement goes before any import statements Indicates that the class declared.
Android GUI Project John Hurley CS 454. Android 1. Android Basics 2. Android Development 3. Android UI 4. Hello, World 5. My Project.
App Development for Android Prabhaker Mateti. Development Tools (Android) Java – Java is the same. But, not all libs are included. – Unused: Swing, AWT,
Android Application Development with Java UPenn CS4HS 2011 Chris Murphy
Layout and Control in UI The user interface (UI) is the graphical interface user can see and interact with your app comprising UI controls like textbox,
@2011 Mihail L. Sichitiu1 Android Introduction Hello Views Part 1.
© Frank Mueller & Seokyong Hong (TA) North Carolina State University Center for Efficient, Secure and Reliable Computing Android Installation Guide (2)
Android Application Development Tutorial. Topics Lecture 5 Overview Overview of Networking Programming Tutorial 2: Downloading from the Internet.
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
1 Mobile Software Development Framework: Android Activity, View/ViewGroup, External Resources, Listener 10/9/2012 Y. Richard Yang.
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Wireless Mobility with Android 1 Presented by: Ung Yean MS. Computer Science American University, Washington DC, USA.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Android Activities 1. What are Android Activities? Activities are like windows in an Android application An application can have any number of activities.
ANDROID – INTERFACE AND LAYOUT L. Grewe. Interfaces: Two Alternatives Code or XML  You have two ways you can create the interface(s) of your Application.
Social Media Apps Programming Min-Yuh Day, Ph.D. Assistant Professor Department of Information Management Tamkang University
1 Announcements Homework #2 due Feb 7 at 1:30pm Submit the entire Eclipse project in Blackboard Please fill out the when2meets when your Project Manager.
CE Applied Communications Technology Android lecture 2 - Structures Android File structure Resources Drawables Layout Values R Class Manifest Running.
Eclipse Tutorial Barrett Summer Scholars 2011 Sustainable Engineering: Learning to Engineer Truly Green Products.
Android - Broadcast Receivers
Configuring Android Development Environment Nilesh Singh.
1 Introducing Activity and Intent. 2 Memory LinearLayout, weight=2 LinearLayout, weight=1 TextView ListView.
ANDROID – DRAWING IMAGES – SIMPLE EXAMPLE IN INTERFACE AND EVENT HANDLING L. Grewe.
Announcements Homework #2 will be posted after class due Thursday Feb 7, 1:30pm you may work with one other person No office hours tonight (sorry!) I will.
Android Boot Camp Demo Application – Part 1. Development Environment Set Up Download and install Java Development Kit (JDK) Download and unzip Android.
Android App Basics Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5.
ANDROID – A FIRST PROGRAM L. Grewe Using AndroidStudio –basic Android  Lets do a “Hello World Project”  Start up AndroidStudio (assume you have installed.
Copyright© Jeffrey Jongko, Ateneo de Manila University Deconstructing HelloWorld.
Android and s Ken Nguyen Clayton state University 2012.
Mobile Computing Lecture#12 Graphics & Animation.
Android 基本 I/O. 基本 I/O 介面元件 在此節中主要介紹常見的 I/O 使用者介 面元件 – Button, TextView, 以及 EditText , 學習者可以學會: – Android 的視窗表單設計 res/layout/main.xml – Android SDK –
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Android Programming.
Lab7 – Appendix.
Android Application Development
Android Programming - Features
Lecture 3 Zablon Ochomo Android Layouts Lecture 3 Zablon Ochomo
Android Introduction Hello World
Android Application Development 1 6 May 2018
Android N Amanquah.
GUI Programming Fundamentals
Android Introduction Hello World.
Android External Resources
XML Mihail L. Sichitiu.
Android Introduction Hello Views Part 1.
ITEC535 – Mobile Programming
Android Introduction Camera.
תכנות ב android אליהו חלסצ'י.
Android GUI Project John Hurley CS 454.
CIS 470 Mobile App Development
MultiUni Trần Vũ Tất Bình
Many thanks to Jun Bum Lim for his help with this tutorial.
Android GUI Project John Hurley CS 454.
CMPE419 Mobile Application Development
BMI Android Application will take weight and height from the users to calculate Body Mass Index (BMI) with the information, whether user is underweight,
CIS 470 Mobile App Development
Android Notifications
CMPE419 Mobile Application Development
Android Sensor Programming
Presentation transcript:

@2011 Mihail L. Sichitiu1 Android Introduction Hello World

@2011 Mihail L. Sichitiu2 Goal  Create a very simple application  Run it on a real device  Run it on the emulator  Examine its structure

@2011 Mihail L. Sichitiu3 Google Tutorial  We will follow the tutorial at: orials/hello-world.html  Start Eclipse (Start -> All Programs -> Eclipse)  Create an Android Virtual Device (AVD)  Create a New Android Project

@2011 Mihail L. Sichitiu4 Package Content Java code for our activityAll source code here Generated Java code Helps link resources to Java code Layout of the activity Strings used in the program All non-code resources Android Manifest Images

@2011 Mihail L. Sichitiu5 Android Manifest   <manifest xmlns:android="  package="com.example.helloandroid"  android:versionCode="1"  android:versionName="1.0">   <activity android:name=".HelloAndroid"  

@2011 Mihail L. Sichitiu6 Activity  An Android activity is focused on a single thing a user can do.  Most applications have multiple activities

@2011 Mihail L. Sichitiu7 Activities start each other

@2011 Mihail L. Sichitiu8 Revised HelloAndroid.java package com.example.helloandroid; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class HelloAndroid extends Activity { /** Called when the activity is first created. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); tv.setText("Hello, Android – by hand"); setContentView(tv); } } Set the view “by hand” – from the program Inherit from the Activity Class

@2011 Mihail L. Sichitiu9 Run it!

@2011 Mihail L. Sichitiu10 /res/layout/main.xml <LinearLayout xmlns:android=" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" /> Further redirection to /res/values/strings.xml

@2011 Mihail L. Sichitiu11 /res/values/strings.xml Hello World, HelloAndroid – by resources! Hello, Android

@2011 Mihail L. Sichitiu12 HelloAndroid.java package com.example.helloandroid; import android.app.Activity; import android.os.Bundle; public class HelloAndroid extends Activity { /** Called when the activity is first created. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } Set the layout of the view as described in the main.xml layout

@2011 Mihail L. Sichitiu13 /gen/R.java package com.example.helloandroid; public final class R { public static final class attr { } public static final class drawable { public static final int icon=0x7f020000; } public static final class id { public static final int textview=0x7f050000; } public static final class layout { public static final int main=0x7f030000; } public static final class string { public static final int app_name=0x7f040001; public static final int hello=0x7f040000; } }

@2011 Mihail L. Sichitiu14 Run it!

@2011 Mihail L. Sichitiu15 Introduce a bug package com.example.helloandroid; import android.app.Activity; import android.os.Bundle; public class HelloAndroid extends Activity { /** Called when the activity is first created. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Object o = null; o.toString(); setContentView(R.layout.main); } }

@2011 Mihail L. Sichitiu16 Run it!