SlideShare una empresa de Scribd logo
1 de 26
Android Application
Development with Java
UPenn CS4HS 2011
Chris Murphy
cdmurphy@cis.upenn.edu
Overview


What is Android?



Why teach Android?



What do you need in order to teach Android?



Hello, Android



Basic Android graphics



Lunch



Part 2: More Android!
What is Android?
What is Android?


An open source Linux-based operating system
intended for mobile computing platforms



Includes a Java API for developing applications



It is not a device or product
Why teach Android?
NYC High School Girls Build Android Apps
http://www.pcworld.com/article/223409/move_over_dr_soong_girls_can_build_android_apps_too.html
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!
–
–

interfaces, casting

–

exceptions

–

debugging

–


inheritance, method overriding

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 Eclipse



Install Android SDK (Android libraries)



Install ADT plugin (Android development tools)



Create AVD (Android virtual device)



We’ve already done this for you!!
2. Create an Android Project in Eclipse


File → New → Project



Select “Android Project”



Fill in Project details...
Directory
name

Android
version

Name that appears
on device

Class to
automatically
create

Java package
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
Source
code

Auto-generated
code

String
constants
UI
layout

Configuration
HelloAndroid.java
1
2
3
4
5
6
7
8
9

public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
main.xml
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>
strings.xml
1
2
3
4
5
6

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, HelloAndroid!
</string>
<string name="app_name">Hello, Android</string>
</resources>
AndroidManifest.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>

Más contenido relacionado

La actualidad más candente

Appium Mobile Testing: Nakov at BurgasConf - July 2021
Appium Mobile Testing: Nakov at BurgasConf - July 2021Appium Mobile Testing: Nakov at BurgasConf - July 2021
Appium Mobile Testing: Nakov at BurgasConf - July 2021Svetlin Nakov
 
Android AppDevelopment
Android AppDevelopmentAndroid AppDevelopment
Android AppDevelopmentAshraf Ali
 
Android Training Institute - Dream Tech Labs
Android Training Institute - Dream Tech LabsAndroid Training Institute - Dream Tech Labs
Android Training Institute - Dream Tech LabsDreamtech Labs
 
Android app Development Prepration Tips
Android app Development Prepration TipsAndroid app Development Prepration Tips
Android app Development Prepration TipsYasmeen Sheikh
 
BHAGWANT UNIVERSITY
BHAGWANT UNIVERSITYBHAGWANT UNIVERSITY
BHAGWANT UNIVERSITYSuraj Singh
 
Android Development Slides
Android Development SlidesAndroid Development Slides
Android Development SlidesVictor Miclovich
 
Ppt of tutorial android app
Ppt of tutorial android appPpt of tutorial android app
Ppt of tutorial android appDharmendra Saini
 
Android Study Jams - Induction
Android Study Jams - InductionAndroid Study Jams - Induction
Android Study Jams - InductionGDSCAISSMSIOIT
 
Windows 8 App Development
Windows 8 App DevelopmentWindows 8 App Development
Windows 8 App DevelopmentAmal Dev
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Lars Vogel
 
I Phone Development Presentation
I Phone Development PresentationI Phone Development Presentation
I Phone Development PresentationAessam
 
Android Development Training
Android Development TrainingAndroid Development Training
Android Development Trainingchandutata
 
Android study jams 1
Android study jams 1Android study jams 1
Android study jams 1DSCBVRITH
 
Android App Development Project in College
Android App Development Project in College Android App Development Project in College
Android App Development Project in College Logan Smith
 
Flutter dhaval solanki
Flutter   dhaval solankiFlutter   dhaval solanki
Flutter dhaval solankiDhaval Solanki
 
Gitansh_Gupta_Resume
Gitansh_Gupta_ResumeGitansh_Gupta_Resume
Gitansh_Gupta_ResumeGitansh Gupta
 
Android unittesting
Android unittestingAndroid unittesting
Android unittestingQA Club Kiev
 
Android application project presentation.
Android application project presentation.Android application project presentation.
Android application project presentation.Eyakub Sorkar
 
It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2MNM Jain Engineering College
 

La actualidad más candente (20)

Appium Mobile Testing: Nakov at BurgasConf - July 2021
Appium Mobile Testing: Nakov at BurgasConf - July 2021Appium Mobile Testing: Nakov at BurgasConf - July 2021
Appium Mobile Testing: Nakov at BurgasConf - July 2021
 
Android AppDevelopment
Android AppDevelopmentAndroid AppDevelopment
Android AppDevelopment
 
Android Training Institute - Dream Tech Labs
Android Training Institute - Dream Tech LabsAndroid Training Institute - Dream Tech Labs
Android Training Institute - Dream Tech Labs
 
Android app Development Prepration Tips
Android app Development Prepration TipsAndroid app Development Prepration Tips
Android app Development Prepration Tips
 
BHAGWANT UNIVERSITY
BHAGWANT UNIVERSITYBHAGWANT UNIVERSITY
BHAGWANT UNIVERSITY
 
Android Development Slides
Android Development SlidesAndroid Development Slides
Android Development Slides
 
Ppt of tutorial android app
Ppt of tutorial android appPpt of tutorial android app
Ppt of tutorial android app
 
Android Study Jams - Induction
Android Study Jams - InductionAndroid Study Jams - Induction
Android Study Jams - Induction
 
Windows 8 App Development
Windows 8 App DevelopmentWindows 8 App Development
Windows 8 App Development
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
 
I Phone Development Presentation
I Phone Development PresentationI Phone Development Presentation
I Phone Development Presentation
 
Android Development Training
Android Development TrainingAndroid Development Training
Android Development Training
 
Android study jams 1
Android study jams 1Android study jams 1
Android study jams 1
 
Android App Development Project in College
Android App Development Project in College Android App Development Project in College
Android App Development Project in College
 
Flutter dhaval solanki
Flutter   dhaval solankiFlutter   dhaval solanki
Flutter dhaval solanki
 
Intro to Android Programming
Intro to Android ProgrammingIntro to Android Programming
Intro to Android Programming
 
Gitansh_Gupta_Resume
Gitansh_Gupta_ResumeGitansh_Gupta_Resume
Gitansh_Gupta_Resume
 
Android unittesting
Android unittestingAndroid unittesting
Android unittesting
 
Android application project presentation.
Android application project presentation.Android application project presentation.
Android application project presentation.
 
It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2
 

Destacado (12)

Pcori challenge final
Pcori challenge finalPcori challenge final
Pcori challenge final
 
021113 preliminare
021113 preliminare021113 preliminare
021113 preliminare
 
Ranking de procesadores
Ranking de procesadoresRanking de procesadores
Ranking de procesadores
 
3a planimetrie generali
3a   planimetrie generali3a   planimetrie generali
3a planimetrie generali
 
Florence
FlorenceFlorence
Florence
 
Gandhi
Gandhi  Gandhi
Gandhi
 
Pcori challenge pptfinal
Pcori challenge pptfinalPcori challenge pptfinal
Pcori challenge pptfinal
 
Benefits of using assistive technology
Benefits of using assistive technologyBenefits of using assistive technology
Benefits of using assistive technology
 
WHAT MAKES EARLY START VOLLEYBALL UNIQUE??
WHAT MAKES EARLY START VOLLEYBALL UNIQUE??WHAT MAKES EARLY START VOLLEYBALL UNIQUE??
WHAT MAKES EARLY START VOLLEYBALL UNIQUE??
 
Benefits of using assistive technology
Benefits of using assistive technologyBenefits of using assistive technology
Benefits of using assistive technology
 
164
164164
164
 
Technology & disaster
Technology & disasterTechnology & disaster
Technology & disaster
 

Similar a Cs4hs android-01hello

androidPramming.ppt
androidPramming.pptandroidPramming.ppt
androidPramming.pptBijayKc16
 
How to become an android developer
How to become an android developerHow to become an android developer
How to become an android developerum_adeveloper
 
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...IJCNCJournal
 
report A K Maurya.pdf
report A K Maurya.pdfreport A K Maurya.pdf
report A K Maurya.pdfSonu62614
 
Android deep dive
Android deep diveAndroid deep dive
Android deep diveAnuSahniNCI
 
Introduction to Mobile Development
Introduction to Mobile DevelopmentIntroduction to Mobile Development
Introduction to Mobile DevelopmentPragnesh Vaghela
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentAhsanul Karim
 
Android Study Jam - Introduction
Android Study Jam - IntroductionAndroid Study Jam - Introduction
Android Study Jam - IntroductionHitanshDoshi
 
Android Applications Introduction
Android Applications IntroductionAndroid Applications Introduction
Android Applications IntroductionAnjali Rao
 
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi Mumbai
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi MumbaiIntroduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi Mumbai
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi MumbaiItvedant
 
Android Operating System
Android Operating SystemAndroid Operating System
Android Operating SystemBilal Mirza
 
Ii 1300-java essentials for android
Ii 1300-java essentials for androidIi 1300-java essentials for android
Ii 1300-java essentials for androidAdrian Mikeliunas
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxlancelotlaytan1996
 

Similar a Cs4hs android-01hello (20)

androidPramming.ppt
androidPramming.pptandroidPramming.ppt
androidPramming.ppt
 
How to become an android developer
How to become an android developerHow to become an android developer
How to become an android developer
 
Android
AndroidAndroid
Android
 
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...
 
report A K Maurya.pdf
report A K Maurya.pdfreport A K Maurya.pdf
report A K Maurya.pdf
 
Android deep dive
Android deep diveAndroid deep dive
Android deep dive
 
Introduction to Mobile Development
Introduction to Mobile DevelopmentIntroduction to Mobile Development
Introduction to Mobile Development
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application Development
 
Notes Unit2.pptx
Notes Unit2.pptxNotes Unit2.pptx
Notes Unit2.pptx
 
Android Study Jam - Introduction
Android Study Jam - IntroductionAndroid Study Jam - Introduction
Android Study Jam - Introduction
 
Android Applications Introduction
Android Applications IntroductionAndroid Applications Introduction
Android Applications Introduction
 
Mobile app
Mobile appMobile app
Mobile app
 
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi Mumbai
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi MumbaiIntroduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi Mumbai
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi Mumbai
 
Android Stsucture
Android StsuctureAndroid Stsucture
Android Stsucture
 
Android Operating System
Android Operating SystemAndroid Operating System
Android Operating System
 
Ii 1300-java essentials for android
Ii 1300-java essentials for androidIi 1300-java essentials for android
Ii 1300-java essentials for android
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
 
Internship presentation
Internship presentationInternship presentation
Internship presentation
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Training android
Training androidTraining android
Training android
 

Último

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

Cs4hs android-01hello

  • 1. Android Application Development with Java UPenn CS4HS 2011 Chris Murphy cdmurphy@cis.upenn.edu
  • 2. Overview  What is Android?  Why teach Android?  What do you need in order to teach Android?  Hello, Android  Basic Android graphics  Lunch  Part 2: More Android!
  • 4. What is Android?  An open source Linux-based operating system intended for mobile computing platforms  Includes a Java API for developing applications  It is not a device or product
  • 5.
  • 7. NYC High School Girls Build Android Apps http://www.pcworld.com/article/223409/move_over_dr_soong_girls_can_build_android_apps_too.html
  • 8. Engaging Students with Android  Android has a lot of “buzz” now – Newness – Coolness – Googleness  UI and graphics made simple(r)  Advanced Java skills
  • 9. 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
  • 10. Android vs. iPhone  Java vs. Objective-C  Direct install vs. Marketplace vs. App Store  Open source?
  • 11. What do you need in order to teach Android?
  • 12. What Should Students Already Know?  Java! – – interfaces, casting – exceptions – debugging –  inheritance, method overriding reading API documentation Eclipse – easy to pick up quickly, though
  • 13. 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
  • 16. 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
  • 17. 1. Set Up Your Android Environment  http://developer.android.com/sdk  Install Eclipse  Install Android SDK (Android libraries)  Install ADT plugin (Android development tools)  Create AVD (Android virtual device)  We’ve already done this for you!!
  • 18. 2. Create an Android Project in Eclipse  File → New → Project  Select “Android Project”  Fill in Project details...
  • 19. Directory name Android version Name that appears on device Class to automatically create Java package
  • 20. 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
  • 21.
  • 23. HelloAndroid.java 1 2 3 4 5 6 7 8 9 public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }
  • 24. main.xml 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>
  • 25. strings.xml 1 2 3 4 5 6 <?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">Hello World, HelloAndroid! </string> <string name="app_name">Hello, Android</string> </resources>
  • 26. AndroidManifest.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>