SlideShare a Scribd company logo
Android Programming
Overview

What is Android?

Why teach Android?

What do you need in order to teach Android?

Hello, Android
Links for android beginners: https://www.udacity.com/courses/android
Andriod Basics: (1) User Interface, (2) Multicscreen Apps, (3) User Input, (4) Data
Storage, (5) Networking
What is Android?
Android

Includes a Java API for developing applications

It is not a device or product
The Android Open Source Project
(AOSP)
 An open source Linux-based operating system intended for
mobile computing platforms
 An initiative led by Google
– Makes the source code of the Android OS available for all
Read, review, and modify the code to your liking
 The main goals of the AOSP
– Provide a set of compatibility guidelines—for OEMs (Original
Equipment Manufacturers) and device manufacturers—for
porting Android to custom devices
– Build accessories that comply with Android’s open accessory
standard Allows OEMs and manufacturers to deliver a
standard experience
 Making radical changes to that experience introduces
fragmentation in the marketplace and in competing Android
distributions.
The Open Handset Alliance
 Android, Inc
Created by Andy Rubin, Acquired by Google in 2005.
 Open Handset Alliance (OHA)
– Formed in November 2007
– Business alliance composed of mobile players
• Chip makers
• Handset manufacturers
• Software developers
• Service providers
 OHA began developing open standards based on Android,
Inc. technologies. The result is the Android project.
 Google provided the initial code, online documentation, tools,
forums, and SDK.
Manufacturers: Designing Android
Devices
 Samsung
 Motorola
 Dell
 Sony Ericsson
 HTC
 LG
 Amazon
 Intel
 Texas Instruments
 ARM
 NVIDIA
 Qualcomm
android Programming with detail slide an
Why teach Android?
Engaging Students with Android

Android has a lot of “buzz” now
– Newness
– Coolness
– Googleness

UI and graphics made simple(r)

Advanced Java skills
What Skills Will Students Learn?

Reinforce the basics: OOP, decomposition, etc.

Separation of UI design and functionality

XML and resource files

Events and Listeners

Callback methods

Threads
Android vs. iPhone

Java vs. Objective-C

Direct install vs. Marketplace vs. App Store

Open source?
What do you need in order
to teach Android?
What Should Students Already Know?

Java!
– inheritance, method overriding
– interfaces, casting
– exceptions
– debugging
– reading API documentation

Eclipse
– easy to pick up quickly, though
Do I Need Phones?

The emulator that is part of the Android toolset for
Eclipse is quite good (though a bit slow)

You may be able to get free “developer phones”
from Google
Online Resources

developer.android.com

code.google.com/p/apps-for-android/

stackoverflow.com

videos from Google I/O conferences
“Hello, Android”
Creating Your First(?) Android App
1. Set up your development environment
2. Create a new Android project in Eclipse
3. Run it in the emulator
4. Hilarity ensues
1. Set Up Your Android Environment

http://developer.android.com/sdk
Install Android Studio with Android SDK
(Android libraries)

Install JDK if it is not in your computer

Create AVD (Android virtual device)
2. Create an Android Project

File → New → Project

Select “Android Project”

Fill in Project details...
Name that appears
on device
Directory
name
Class to
automatically
create
Java package
Android
version
Source
code
Auto-generated
code
UI
layout
String
constants
Configuration
3. Run the Android Application

Run → Run (or click the “Run” button)

Select “Android Application”

The emulator may take a few minutes to start, so
be patient!

You don't need to restart the emulator when you
have a new version of your application
android Programming with detail slide an
1 public class HelloAndroid extends Activity {
2 /** Called when the activity is first created. */
3 @Override
4 public void onCreate(Bundle savedInstanceState)
5 {
6 super.onCreate(savedInstanceState);
7 setContentView(R.layout.main);
8 }
9 }
HelloAndroid.java
1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 android:orientation="vertical"
5 android:layout_width="fill_parent"
6 android:layout_height="fill_parent"
7 >
8 <TextView
9 android:layout_width="fill_parent"
10 android:layout_height="wrap_content"
11 android:text="@string/hello "
12 />
13 </LinearLayout>
main.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <resources>
3 <string name="hello">Hello World, HelloAndroid!
4 </string>
5 <string name="app_name">Hello, Android</string>
6 </resources>
strings.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 package="edu.upenn.cis542"
5 android:versionCode="1"
6 android:versionName="1.0">
7 <application android:icon="@drawable/icon"
8 android:label="@string/app_name">
9 <activity android:name=".HelloAndroid"
10 android:label="@string/app_name">
11 <intent-filter>
12 <action
13 android:name="android.intent.action.MAIN" />
14 <category
15 android:name="android.intent.category.LAUNCHER"/>
16 </intent-filter>
17 </activity>
18 </application>
19 </manifest>
AndroidManifest.xml

More Related Content

PPT
androidPramming.ppt
PPT
Android - Getting started with Android
PPT
Cs4hs android-01hello
PPT
Synapseindia android apps application
PPTX
Introduction To Android For Beginners.
PPT
Android
PPTX
Getting started with android development
PDF
Getting started as an android developer
androidPramming.ppt
Android - Getting started with Android
Cs4hs android-01hello
Synapseindia android apps application
Introduction To Android For Beginners.
Android
Getting started with android development
Getting started as an android developer

Similar to android Programming with detail slide an (20)

PPTX
Android app development ppt
PDF
Android outline
PDF
[Android] Introduction to Android Programming
PDF
Homework seriesandroidworkshop JUly 12th
PDF
android-developer-fundamentals-course-concepts-en.pdf
PPT
Android Training
PPTX
Introduction & App Structure
PPTX
Seminar on android app development
PPTX
Android presentation
PPT
Android Application Development (2).ppt
PPT
Android Application Development.ppt
PPT
Android Application Development.ppt
PPT
Android Application Development.ppt
PPT
Android Application Development.ppt
PPT
Android Application Development.ppt
PPT
Android Application Development.ppt
PPT
Android application development
PPT
Android application development
PDF
Android tutorial
PDF
What is-android? PDF Document
Android app development ppt
Android outline
[Android] Introduction to Android Programming
Homework seriesandroidworkshop JUly 12th
android-developer-fundamentals-course-concepts-en.pdf
Android Training
Introduction & App Structure
Seminar on android app development
Android presentation
Android Application Development (2).ppt
Android Application Development.ppt
Android Application Development.ppt
Android Application Development.ppt
Android Application Development.ppt
Android Application Development.ppt
Android Application Development.ppt
Android application development
Android application development
Android tutorial
What is-android? PDF Document
Ad

Recently uploaded (6)

DOC
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
PDF
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
DOC
证书学历UoA毕业证,澳大利亚中汇学院毕业证国外大学毕业证
PPTX
ASMS Telecommunication company Profile
PDF
heheheueueyeyeyegehehehhehshMedia-Literacy.pdf
PDF
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
证书学历UoA毕业证,澳大利亚中汇学院毕业证国外大学毕业证
ASMS Telecommunication company Profile
heheheueueyeyeyegehehehhehshMedia-Literacy.pdf
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
Ad

android Programming with detail slide an

  • 2. Overview  What is Android?  Why teach Android?  What do you need in order to teach Android?  Hello, Android Links for android beginners: https://www.udacity.com/courses/android Andriod Basics: (1) User Interface, (2) Multicscreen Apps, (3) User Input, (4) Data Storage, (5) Networking
  • 4. Android  Includes a Java API for developing applications  It is not a device or product
  • 5. The Android Open Source Project (AOSP)  An open source Linux-based operating system intended for mobile computing platforms  An initiative led by Google – Makes the source code of the Android OS available for all Read, review, and modify the code to your liking  The main goals of the AOSP – Provide a set of compatibility guidelines—for OEMs (Original Equipment Manufacturers) and device manufacturers—for porting Android to custom devices – Build accessories that comply with Android’s open accessory standard Allows OEMs and manufacturers to deliver a standard experience  Making radical changes to that experience introduces fragmentation in the marketplace and in competing Android distributions.
  • 6. The Open Handset Alliance  Android, Inc Created by Andy Rubin, Acquired by Google in 2005.  Open Handset Alliance (OHA) – Formed in November 2007 – Business alliance composed of mobile players • Chip makers • Handset manufacturers • Software developers • Service providers  OHA began developing open standards based on Android, Inc. technologies. The result is the Android project.  Google provided the initial code, online documentation, tools, forums, and SDK.
  • 7. Manufacturers: Designing Android Devices  Samsung  Motorola  Dell  Sony Ericsson  HTC  LG  Amazon  Intel  Texas Instruments  ARM  NVIDIA  Qualcomm
  • 10. Engaging Students with Android  Android has a lot of “buzz” now – Newness – Coolness – Googleness  UI and graphics made simple(r)  Advanced Java skills
  • 11. What Skills Will Students Learn?  Reinforce the basics: OOP, decomposition, etc.  Separation of UI design and functionality  XML and resource files  Events and Listeners  Callback methods  Threads
  • 12. Android vs. iPhone  Java vs. Objective-C  Direct install vs. Marketplace vs. App Store  Open source?
  • 13. What do you need in order to teach Android?
  • 14. What Should Students Already Know?  Java! – inheritance, method overriding – interfaces, casting – exceptions – debugging – reading API documentation  Eclipse – easy to pick up quickly, though
  • 15. Do I Need Phones?  The emulator that is part of the Android toolset for Eclipse is quite good (though a bit slow)  You may be able to get free “developer phones” from Google
  • 18. Creating Your First(?) Android App 1. Set up your development environment 2. Create a new Android project in Eclipse 3. Run it in the emulator 4. Hilarity ensues
  • 19. 1. Set Up Your Android Environment  http://developer.android.com/sdk Install Android Studio with Android SDK (Android libraries)  Install JDK if it is not in your computer  Create AVD (Android virtual device)
  • 20. 2. Create an Android Project  File → New → Project  Select “Android Project”  Fill in Project details...
  • 21. Name that appears on device Directory name Class to automatically create Java package Android version
  • 23. 3. Run the Android Application  Run → Run (or click the “Run” button)  Select “Android Application”  The emulator may take a few minutes to start, so be patient!  You don't need to restart the emulator when you have a new version of your application
  • 25. 1 public class HelloAndroid extends Activity { 2 /** Called when the activity is first created. */ 3 @Override 4 public void onCreate(Bundle savedInstanceState) 5 { 6 super.onCreate(savedInstanceState); 7 setContentView(R.layout.main); 8 } 9 } HelloAndroid.java
  • 26. 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout 3 xmlns:android="http://schemas.android.com/apk/res/android" 4 android:orientation="vertical" 5 android:layout_width="fill_parent" 6 android:layout_height="fill_parent" 7 > 8 <TextView 9 android:layout_width="fill_parent" 10 android:layout_height="wrap_content" 11 android:text="@string/hello " 12 /> 13 </LinearLayout> main.xml
  • 27. 1 <?xml version="1.0" encoding="utf-8"?> 2 <resources> 3 <string name="hello">Hello World, HelloAndroid! 4 </string> 5 <string name="app_name">Hello, Android</string> 6 </resources> strings.xml
  • 28. 1 <?xml version="1.0" encoding="utf-8"?> 2 <manifest 3 xmlns:android="http://schemas.android.com/apk/res/android" 4 package="edu.upenn.cis542" 5 android:versionCode="1" 6 android:versionName="1.0"> 7 <application android:icon="@drawable/icon" 8 android:label="@string/app_name"> 9 <activity android:name=".HelloAndroid" 10 android:label="@string/app_name"> 11 <intent-filter> 12 <action 13 android:name="android.intent.action.MAIN" /> 14 <category 15 android:name="android.intent.category.LAUNCHER"/> 16 </intent-filter> 17 </activity> 18 </application> 19 </manifest> AndroidManifest.xml

Editor's Notes

  • #7: Here is just a partial list of manufacturers of Android devices.