際際滷

際際滷Share a Scribd company logo
Programming




Christopher League
30 November 2011
Links for later

    eclipse.org/
    Integrated Development Environment for Java

    developer.android.com/
    Complete developers guide and reference

    slidesha.re/soQgoZ
    These slides

    github.com/league/android2011/
    Source code for my sample apps
Teach Yourself Java in 21 seconds

    All code is in the context of a class

    Class can contain fields, methods, inner classes

    Static pertains to class itself, not every object

    All objects are references, and can be null

    Inherit and override methods from base classes

    Import classes from library packages

    The rest is mostly the same as C/C++/C#

    Beginners should use an IDE, such as Eclipse
Eclipse
Eclipse toolbar




Run 損 Run        Android SDK   Android Virtual
(Ctrl+F11)       Manager       Device Manager
AVD, AVD, wherefore art thee?
Programming Android
Importing an Eclipse project

    Download: http://bit.ly/liu-android-zip

    Eclipse menu: File 損 Import

    Import source: General 損 Existing Projects
Importing an Eclipse project

    Select archive file: browse to downloaded
    league-liu-android-blahblah.zip

    Select all; Finish
open FloodPuz 損 FloodPuzActivity
Run, select device
Check progress in console
Check progress in console
Activities

    Roughly:
    each UI screen
    in your app
    is an activity
Activities

    Multiple activities sequenced using back stack
Layouts, views, & widgets
Layouts, views, & widgets
Event-based programming

:
:
Starting a new project

    File 損 New 損 Project

    Android 損 Android Project (Next)

    Project name: MyApp (Next)

    Target: Android 4.0 (Next)

    Package name: net.liucs (Next)

    Finish
Initial files
XML Layout editor
XML Layout editor

    Drag a button onto the layout

    Right-click hello text, edit ID
Access widgets in Java code



          Source 損 Organize Imports
          (Ctrl+Shift+O) to fix
Access widgets in Java code




Or, get this code at
https://gist.github.com/1410641
Next steps

    Try to extend my projects, especially SketchBot

    Additional colors

    Draw shapes instead of just lines

    Save drawing across application switch
Docs are your friends

More Related Content

Viewers also liked (7)

Benefits of using digital media for training
Benefits of using digital media for trainingBenefits of using digital media for training
Benefits of using digital media for training
Zak Mensah
using digital media @ Leicester college
using digital media @ Leicester collegeusing digital media @ Leicester college
using digital media @ Leicester college
Zak Mensah
Establishing the digital City limits
Establishing the digital City limitsEstablishing the digital City limits
Establishing the digital City limits
Zak Mensah
Modular Module Systems
Modular Module SystemsModular Module Systems
Modular Module Systems
league
Merits of good design - Plymouth e-learning conference
Merits of good design - Plymouth e-learning conference Merits of good design - Plymouth e-learning conference
Merits of good design - Plymouth e-learning conference
Zak Mensah
Becta next generation conference 2010
Becta next generation conference 2010Becta next generation conference 2010
Becta next generation conference 2010
Zak Mensah
Futzing with actors (etc.)
Futzing with actors (etc.)Futzing with actors (etc.)
Futzing with actors (etc.)
league
Benefits of using digital media for training
Benefits of using digital media for trainingBenefits of using digital media for training
Benefits of using digital media for training
Zak Mensah
using digital media @ Leicester college
using digital media @ Leicester collegeusing digital media @ Leicester college
using digital media @ Leicester college
Zak Mensah
Establishing the digital City limits
Establishing the digital City limitsEstablishing the digital City limits
Establishing the digital City limits
Zak Mensah
Modular Module Systems
Modular Module SystemsModular Module Systems
Modular Module Systems
league
Merits of good design - Plymouth e-learning conference
Merits of good design - Plymouth e-learning conference Merits of good design - Plymouth e-learning conference
Merits of good design - Plymouth e-learning conference
Zak Mensah
Becta next generation conference 2010
Becta next generation conference 2010Becta next generation conference 2010
Becta next generation conference 2010
Zak Mensah
Futzing with actors (etc.)
Futzing with actors (etc.)Futzing with actors (etc.)
Futzing with actors (etc.)
league

Similar to Programming Android (20)

Clojure.tokyo.descjop
Clojure.tokyo.descjopClojure.tokyo.descjop
Clojure.tokyo.descjop
Kazuhiro Hara
Android session 1
Android session 1Android session 1
Android session 1
Ahesanali Suthar
Code-Hub
Code-HubCode-Hub
Code-Hub
Curran Kelleher
Android studio
Android studioAndroid studio
Android studio
貼eljko Plesac
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering LabVoxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
Ron Munitz
Android App development I
Android App development IAndroid App development I
Android App development I
Thenraja Vettivelraj
Akashdeepsinghjandu13
Akashdeepsinghjandu13Akashdeepsinghjandu13
Akashdeepsinghjandu13
Akashdeep Singh Jandu
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
Opersys inc.
Electron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologiesElectron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologies
Bethmi Gunasekara
NDK Introduction
NDK IntroductionNDK Introduction
NDK Introduction
RAHUL TRIPATHI
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
amaankhan
Android application development
Android application developmentAndroid application development
Android application development
slidesuren
Android ndk - Introduction
Android ndk  - IntroductionAndroid ndk  - Introduction
Android ndk - Introduction
Rakesh Jha
Android NDK
Android NDKAndroid NDK
Android NDK
Sentinel Solutions Ltd
React native: building native iOS apps with javascript
React native: building native iOS apps with javascriptReact native: building native iOS apps with javascript
React native: building native iOS apps with javascript
Polidea
Android
AndroidAndroid
Android
Hariharan Thiagarajan
Android - Android Application Configuration
Android - Android Application ConfigurationAndroid - Android Application Configuration
Android - Android Application Configuration
Vibrant Technologies & Computers
Android ndk
Android ndkAndroid ndk
Android ndk
Sentinel Solutions Ltd
Eclipse introduction IDE PRESENTATION
Eclipse introduction IDE PRESENTATIONEclipse introduction IDE PRESENTATION
Eclipse introduction IDE PRESENTATION
AYESHA JAVED
AndEngine
AndEngineAndEngine
AndEngine
TheBeege
Clojure.tokyo.descjop
Clojure.tokyo.descjopClojure.tokyo.descjop
Clojure.tokyo.descjop
Kazuhiro Hara
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering LabVoxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
Ron Munitz
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
Opersys inc.
Electron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologiesElectron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologies
Bethmi Gunasekara
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
amaankhan
Android application development
Android application developmentAndroid application development
Android application development
slidesuren
Android ndk - Introduction
Android ndk  - IntroductionAndroid ndk  - Introduction
Android ndk - Introduction
Rakesh Jha
React native: building native iOS apps with javascript
React native: building native iOS apps with javascriptReact native: building native iOS apps with javascript
React native: building native iOS apps with javascript
Polidea
Eclipse introduction IDE PRESENTATION
Eclipse introduction IDE PRESENTATIONEclipse introduction IDE PRESENTATION
Eclipse introduction IDE PRESENTATION
AYESHA JAVED
AndEngine
AndEngineAndEngine
AndEngine
TheBeege

Recently uploaded (20)

Don't just talk to AI, do more with AI: how to improve productivity with AI a...
Don't just talk to AI, do more with AI: how to improve productivity with AI a...Don't just talk to AI, do more with AI: how to improve productivity with AI a...
Don't just talk to AI, do more with AI: how to improve productivity with AI a...
All Things Open
DeepSeek vs ChatGPT vs Gemini Which AI Best Fits Your Needs.
DeepSeek vs ChatGPT vs Gemini Which AI Best Fits Your Needs.DeepSeek vs ChatGPT vs Gemini Which AI Best Fits Your Needs.
DeepSeek vs ChatGPT vs Gemini Which AI Best Fits Your Needs.
davissmith22
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
All Things Open
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
All Things Open
Digital Nepal Framework 2.0: A Step Towards a Digitally Empowered Nepal
Digital Nepal Framework 2.0: A Step Towards a Digitally Empowered NepalDigital Nepal Framework 2.0: A Step Towards a Digitally Empowered Nepal
Digital Nepal Framework 2.0: A Step Towards a Digitally Empowered Nepal
ICT Frame Magazine Pvt. Ltd.
Presentation Session 2 -Context Grounding.pdf
Presentation Session 2 -Context Grounding.pdfPresentation Session 2 -Context Grounding.pdf
Presentation Session 2 -Context Grounding.pdf
Mukesh Kala
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
All Things Open
Comparative Analysis of Reasoning Techniques
Comparative Analysis of Reasoning TechniquesComparative Analysis of Reasoning Techniques
Comparative Analysis of Reasoning Techniques
HoussemEddineDEGHA
From native code gems to Java treasures with jextract
From native code gems to Java treasures with jextractFrom native code gems to Java treasures with jextract
From native code gems to Java treasures with jextract
Ana-Maria Mihalceanu
Packaging your App for AppExchange Managed Vs Unmanaged.pptx
Packaging your App for AppExchange  Managed Vs Unmanaged.pptxPackaging your App for AppExchange  Managed Vs Unmanaged.pptx
Packaging your App for AppExchange Managed Vs Unmanaged.pptx
mohayyudin7826
Mastering NIST CSF 2.0 - The New Govern Function.pdf
Mastering NIST CSF 2.0 - The New Govern Function.pdfMastering NIST CSF 2.0 - The New Govern Function.pdf
Mastering NIST CSF 2.0 - The New Govern Function.pdf
Bachir Benyammi
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
Let's Create a GitHub Copilot Extension! - Nick Taylor, PomeriumLet's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
All Things Open
Scalable Multi-Agent AI with AutoGen by Udai
Scalable Multi-Agent AI with AutoGen by UdaiScalable Multi-Agent AI with AutoGen by Udai
Scalable Multi-Agent AI with AutoGen by Udai
Udaiappa Ramachandran
The Best of Both Worlds: Hybrid Clustering with Delta Lake
The Best of Both Worlds: Hybrid Clustering with Delta LakeThe Best of Both Worlds: Hybrid Clustering with Delta Lake
The Best of Both Worlds: Hybrid Clustering with Delta Lake
carlyakerly1
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
All Things Open
UiPath Automation Developer Associate Training Series 2025 - Session 8
UiPath Automation Developer Associate Training Series 2025 - Session 8UiPath Automation Developer Associate Training Series 2025 - Session 8
UiPath Automation Developer Associate Training Series 2025 - Session 8
DianaGray10
UiPath Agentic automation with Autopilot for everyone + new features/releases
UiPath Agentic  automation with Autopilot for everyone + new features/releasesUiPath Agentic  automation with Autopilot for everyone + new features/releases
UiPath Agentic automation with Autopilot for everyone + new features/releases
DianaGray10
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
All Things Open
DONT PANIC: AI IS COMING The Hitchhikers Guide to AI - Mark Hinkle, Perip...
DONT PANIC: AI IS COMING  The Hitchhikers Guide to AI - Mark Hinkle, Perip...DONT PANIC: AI IS COMING  The Hitchhikers Guide to AI - Mark Hinkle, Perip...
DONT PANIC: AI IS COMING The Hitchhikers Guide to AI - Mark Hinkle, Perip...
All Things Open
Safers Picks: The 6 FME Transformers You Didnt Know You Needed
Safers Picks: The 6 FME Transformers You Didnt Know You NeededSafers Picks: The 6 FME Transformers You Didnt Know You Needed
Safers Picks: The 6 FME Transformers You Didnt Know You Needed
Safe Software
Don't just talk to AI, do more with AI: how to improve productivity with AI a...
Don't just talk to AI, do more with AI: how to improve productivity with AI a...Don't just talk to AI, do more with AI: how to improve productivity with AI a...
Don't just talk to AI, do more with AI: how to improve productivity with AI a...
All Things Open
DeepSeek vs ChatGPT vs Gemini Which AI Best Fits Your Needs.
DeepSeek vs ChatGPT vs Gemini Which AI Best Fits Your Needs.DeepSeek vs ChatGPT vs Gemini Which AI Best Fits Your Needs.
DeepSeek vs ChatGPT vs Gemini Which AI Best Fits Your Needs.
davissmith22
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
All Things Open
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
All Things Open
Digital Nepal Framework 2.0: A Step Towards a Digitally Empowered Nepal
Digital Nepal Framework 2.0: A Step Towards a Digitally Empowered NepalDigital Nepal Framework 2.0: A Step Towards a Digitally Empowered Nepal
Digital Nepal Framework 2.0: A Step Towards a Digitally Empowered Nepal
ICT Frame Magazine Pvt. Ltd.
Presentation Session 2 -Context Grounding.pdf
Presentation Session 2 -Context Grounding.pdfPresentation Session 2 -Context Grounding.pdf
Presentation Session 2 -Context Grounding.pdf
Mukesh Kala
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
All Things Open
Comparative Analysis of Reasoning Techniques
Comparative Analysis of Reasoning TechniquesComparative Analysis of Reasoning Techniques
Comparative Analysis of Reasoning Techniques
HoussemEddineDEGHA
From native code gems to Java treasures with jextract
From native code gems to Java treasures with jextractFrom native code gems to Java treasures with jextract
From native code gems to Java treasures with jextract
Ana-Maria Mihalceanu
Packaging your App for AppExchange Managed Vs Unmanaged.pptx
Packaging your App for AppExchange  Managed Vs Unmanaged.pptxPackaging your App for AppExchange  Managed Vs Unmanaged.pptx
Packaging your App for AppExchange Managed Vs Unmanaged.pptx
mohayyudin7826
Mastering NIST CSF 2.0 - The New Govern Function.pdf
Mastering NIST CSF 2.0 - The New Govern Function.pdfMastering NIST CSF 2.0 - The New Govern Function.pdf
Mastering NIST CSF 2.0 - The New Govern Function.pdf
Bachir Benyammi
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
Let's Create a GitHub Copilot Extension! - Nick Taylor, PomeriumLet's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
All Things Open
Scalable Multi-Agent AI with AutoGen by Udai
Scalable Multi-Agent AI with AutoGen by UdaiScalable Multi-Agent AI with AutoGen by Udai
Scalable Multi-Agent AI with AutoGen by Udai
Udaiappa Ramachandran
The Best of Both Worlds: Hybrid Clustering with Delta Lake
The Best of Both Worlds: Hybrid Clustering with Delta LakeThe Best of Both Worlds: Hybrid Clustering with Delta Lake
The Best of Both Worlds: Hybrid Clustering with Delta Lake
carlyakerly1
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
All Things Open
UiPath Automation Developer Associate Training Series 2025 - Session 8
UiPath Automation Developer Associate Training Series 2025 - Session 8UiPath Automation Developer Associate Training Series 2025 - Session 8
UiPath Automation Developer Associate Training Series 2025 - Session 8
DianaGray10
UiPath Agentic automation with Autopilot for everyone + new features/releases
UiPath Agentic  automation with Autopilot for everyone + new features/releasesUiPath Agentic  automation with Autopilot for everyone + new features/releases
UiPath Agentic automation with Autopilot for everyone + new features/releases
DianaGray10
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
All Things Open
DONT PANIC: AI IS COMING The Hitchhikers Guide to AI - Mark Hinkle, Perip...
DONT PANIC: AI IS COMING  The Hitchhikers Guide to AI - Mark Hinkle, Perip...DONT PANIC: AI IS COMING  The Hitchhikers Guide to AI - Mark Hinkle, Perip...
DONT PANIC: AI IS COMING The Hitchhikers Guide to AI - Mark Hinkle, Perip...
All Things Open
Safers Picks: The 6 FME Transformers You Didnt Know You Needed
Safers Picks: The 6 FME Transformers You Didnt Know You NeededSafers Picks: The 6 FME Transformers You Didnt Know You Needed
Safers Picks: The 6 FME Transformers You Didnt Know You Needed
Safe Software

Programming Android