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

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Último (20)

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

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>