SlideShare ist ein Scribd-Unternehmen logo
1 von 60
Android Workshop
  Android application development &
       connectivity to Arduino
About Myself
My Hobby Projects




      just2us.com
My Full Time




  developer.hoiio.com
Hoiio API
Hoiio API




Mr Brown Podcast Over The Phone!!

     Call 6602 8104
Android Apps: txeet
Android Apps: txeet




                       ~250,000
                      downloads
Android Apps: SG 4D
Android Apps: Hoiio Phone
Android Apps: Hoiio Chat
Workshop Topics




1. Introduction to Android
2. Hello World!
3. Application Fundamentals
4. User Interfaces
5. Bluetooth
1. Introduction to Android
Introduction



• Linux Kernel
• Application Framework
• Dalvik Virtual Machine
• App distributed as an .apk
• Ten billion apps downloaded
Introduction: Development Process
Introduction: Resources




• http://developer.android.com
• http://stackoverflow.com/
• http://www.google.com/
2. Hello World
Hello World: Installing SDK




1. Install Eclipse - the IDE
  http://www.eclipse.org/downloads/packages/eclipse-classic-371/indigosr1


2. Install Android SDK
  http://developer.android.com/sdk/index.html




    Guide from http://developer.android.com/sdk/installing.html
Hello World: Installing SDK



3. Install Android ADT Plugin for Eclipse
  http://developer.android.com/sdk/eclipse-adt.html#installing


  a. Eclipse > Help > Install new software

  b. Add repository https://dl-ssl.google.com/android/eclipse/

  c. Select “Developer Tools”

  d. Next, next, next and finish!




    Guide from http://developer.android.com/sdk/installing.html
Hello World: Installing SDK




4. Setup ADT Plugin
 a. Ecplise > Preferences > Android

 b. Point to your Android ADK Location (from step 2)




   Guide from http://developer.android.com/sdk/installing.html
Hello World: Create




• File > New > Android Project
Hello World: Run




• Run > Run as > Android Application
• If running on actual device, do this first:
  Settings > Applications > Development and turn on USB debugging
Now you see “Hello World”, let’s look at the code..
3. Application Fundamentals
Fundamentals




• 4 components
 1. Activity
 2. Service
 3. ContentProvider
 4. BroadcastReceiver
Fundamentals: Activity


• Launch an Activity by calling
  startActivity(intent)

  Launch a known Activity
  Intent intent = new Intent(this, SignInActivity.class);
  startActivity(intent);


  Initiate a system launch
  Intent intent = new Intent(Intent.ACTION_SEND);
  intent.putExtra(Intent.EXTRA_EMAIL, recipientArray);
  startActivity(intent);
Fundamentals: Activity




• Activities form a stack
• Functions to handle events:
  onCreate, onResume, onPause, etc
Fundamentals: Activity




•   Activity must be declared in AndroidManifest.xml


    <manifest ... >
      <application ... >
          <activity android:name=".ExampleActivity" />
          ...
      </application ... >
      ...
    </manifest >
Fundamentals: Service




•   Service or Thread ?

•   Service runs in the background, even when user is not
    interacting with your app.

•   To start, call startService()

•   Similar to Activity, has its lifecycle and various event
    callbacks.
Fundamentals: ContentProvider

• A way to share data across applications,
   including apps such as phonebook,
   calendar, etc.
• In other words, you can access the
   phonebook using a ContentProvider
• Have query, insert, delete methods (SQLite)
ContentResolver cr = getContentResolver();
cr.query(“content://android.provider.Contacts.Phones.CONTACT_URI”,
         projection,
         selection, selectionArg,
         sortOrder)
Fundamentals: ContentProvider




    Let’s look at a sample code
4. User Interfaces
User Interfaces




• 2 ways to construct UI
 1. XML
 2. Code
User Interfaces: XML
                         /res/layout/main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/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"
        android:text="@string/hello"
        />
</LinearLayout>




    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
    }
User Interfaces: Code

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. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       TextView tv = new TextView(this);
       tv.setText("Hello, Android");
       setContentView(tv);
   }
}
UI Layouts




LinearLayout
UI Layouts




TableLayout
UI Layouts




RelativeLayout
View Hierarchy




ViewGroup: Layout or container view
View: Android UI component, view or widgets
View Hierarchy
UI Views




• Look at “Hello View” tutorial
    •   http://developer.android.com/resources/tutorials/views/index.html

•   Also look at “Api Demo” sample code
User Interfaces




• Common UI Patterns
  http://www.androidpatterns.com/
Change view on a set of data
Select multiple items
dashboard
5. Bluetooth
Bluetooth


•   Bluetooth Modem, aka BlueSMiRF Gold, aka Firefly

•   http://www.sparkfun.com/products/582

• Specifications
 • Extremely small
 • Operating Voltage: 3.3V-6V
 • Serial communications: 2400-115200bps
Bluetooth: The Pins


• Pins from left to right
 • GND
 • CTS-1
 • VCC
 • TX-0
 • RX-1
 • RTS-0
Bluetooth: Connect to Android



• A guide from instructables.com
    http://www.instructables.com/id/Android-talks-to-Arduino/?ALLSTEPS




•   !!! NOTE: Arduino version 1.0 does not work with
    the libraries. Download version 0023 instead
    http://arduino.cc/en/Main/Software
Bluetooth: Connect to Android


1. Connect from Bluetooth modem to Arduino
 •   VCC to +3.3V
 •   GND to GND
 •   TX-0 to PIN-2 (RX)
 •   RX-1 to PIN-3 (TX)



 If works, you will see a red LED blinking
Bluetooth: Connect to Android
Bluetooth: Connect to Android


 2. Import NewSoftSerial library to Arduino
   •   Provides an interrupt architecture (vs SoftwareSerial)

   •   Copy /Library/NewSoftSerial to:

       •   Mac: ~/Documents/Arduino/libraries/

       •   Windows: My DocumentsArduinolibraries

   •   Instructions on how to use at http://arduiniana.org/libraries/
       newsoftserial/




You will see NewSoftSerial in Sketch > Import Library >
Bluetooth: Connect to Android




3. Upload sketch to Arduino
 • /Sample Code/bluetooth/bluetooth.pde
Bluetooth: Connect to Android


4. Open BluetoothChat, an Android sample app
 •   File > New > Android Project

 •   Select target Android 2.3.3

 •   Create project from existing sample > BluetoothChat > Finish

 •   In BluetoothChatService, change the UUID to
     "00001101-0000-1000-8000-00805F9B34FB"

 •   Build and deploy to phone
Bluetooth: Connect to Android




5. To send a message
 •   Pair up: Settings > Wireless & network > Bluetooth > Select FireFly-xxxx.
     Password is 1234.

 •   Connect: Open BluetoothChat app. Press Menu > Connect > FireFly-xxxx

 •   When connected, Bluetooth modem will have green light

 •   Type a message and send. If success, PIN 13 will light up for 5 sec.
Bluetooth: Connect to Android




6. Change baud rate to 57,000
 •   Refer to http://www.instructables.com/id/Change-BAUD-rate-on-BlueSMiRF-
     Gold/

 •   Need FTDI Basic chip..
USB Host Shield




A guide from circuitathome

Weitere ähnliche Inhalte

Was ist angesagt?

Being Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentBeing Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentReto Meier
 
Android application development the basics (2)
Android application development the basics (2)Android application development the basics (2)
Android application development the basics (2)Aliyu Olalekan
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Javaamaankhan
 
Apple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical OverviewApple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical OverviewSammy Sunny
 
Android Development Slides
Android Development SlidesAndroid Development Slides
Android Development SlidesVictor Miclovich
 
Anatomy of android application
Anatomy of android applicationAnatomy of android application
Anatomy of android applicationNikunj Dhameliya
 
Android Studio Overview
Android Studio OverviewAndroid Studio Overview
Android Studio OverviewSalim Hosen
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basicsAnton Narusberg
 
Anroid Tutorial Beginner level By SAMRAT TAYADE
Anroid Tutorial Beginner level By SAMRAT TAYADE Anroid Tutorial Beginner level By SAMRAT TAYADE
Anroid Tutorial Beginner level By SAMRAT TAYADE Samrat Tayade
 
Android development basics
Android development basicsAndroid development basics
Android development basicsPramesh Gautam
 
Android - From Zero to Hero @ DEVit 2017
Android - From Zero to Hero @ DEVit 2017Android - From Zero to Hero @ DEVit 2017
Android - From Zero to Hero @ DEVit 2017Ivo Neskovic
 
Android 6.0 Marshmallow - Everything you need to know !
Android 6.0 Marshmallow - Everything you need to know !Android 6.0 Marshmallow - Everything you need to know !
Android 6.0 Marshmallow - Everything you need to know !Edureka!
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming BasicsEueung Mulyana
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App DevelopmentMike Kvintus
 
Gradle for Android Developers
Gradle for Android DevelopersGradle for Android Developers
Gradle for Android DevelopersJosiah Renaudin
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application DevelopmentBenny Skogberg
 

Was ist angesagt? (20)

Being Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentBeing Epic: Best Practices for Android Development
Being Epic: Best Practices for Android Development
 
Android application development the basics (2)
Android application development the basics (2)Android application development the basics (2)
Android application development the basics (2)
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 
Google Android
Google AndroidGoogle Android
Google Android
 
Apple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical OverviewApple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical Overview
 
Android Development Slides
Android Development SlidesAndroid Development Slides
Android Development Slides
 
Anatomy of android application
Anatomy of android applicationAnatomy of android application
Anatomy of android application
 
Android Studio Overview
Android Studio OverviewAndroid Studio Overview
Android Studio Overview
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
 
Anroid Tutorial Beginner level By SAMRAT TAYADE
Anroid Tutorial Beginner level By SAMRAT TAYADE Anroid Tutorial Beginner level By SAMRAT TAYADE
Anroid Tutorial Beginner level By SAMRAT TAYADE
 
Android development basics
Android development basicsAndroid development basics
Android development basics
 
Android - From Zero to Hero @ DEVit 2017
Android - From Zero to Hero @ DEVit 2017Android - From Zero to Hero @ DEVit 2017
Android - From Zero to Hero @ DEVit 2017
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android overview
Android overviewAndroid overview
Android overview
 
Android 6.0 Marshmallow - Everything you need to know !
Android 6.0 Marshmallow - Everything you need to know !Android 6.0 Marshmallow - Everything you need to know !
Android 6.0 Marshmallow - Everything you need to know !
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
 
Gradle for Android Developers
Gradle for Android DevelopersGradle for Android Developers
Gradle for Android Developers
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
 
Fire up your mobile app!
Fire up your mobile app!Fire up your mobile app!
Fire up your mobile app!
 

Ähnlich wie Android Workshop

Android Workshop
Android WorkshopAndroid Workshop
Android WorkshopJunda Ong
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_authlzongren
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game developmentWomen In Digital
 
Android Scripting
Android ScriptingAndroid Scripting
Android ScriptingJuan Gomez
 
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideAndroid Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideSergii Zhuk
 
Engineering and Industrial Mobile Application (APP) Development
Engineering and Industrial Mobile Application (APP) DevelopmentEngineering and Industrial Mobile Application (APP) Development
Engineering and Industrial Mobile Application (APP) DevelopmentLiving Online
 
Mobile Software Engineering Crash Course - C03 Android
Mobile Software Engineering Crash Course - C03 AndroidMobile Software Engineering Crash Course - C03 Android
Mobile Software Engineering Crash Course - C03 AndroidMohammad Shaker
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspectiveGunjan Kumar
 
Android studio
Android studioAndroid studio
Android studioAndri Yabu
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 
Basics of Android
Basics of Android Basics of Android
Basics of Android sabi_123
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applicationsTOPS Technologies
 
Android - Open Source Bridge 2011
Android - Open Source Bridge 2011Android - Open Source Bridge 2011
Android - Open Source Bridge 2011sullis
 

Ähnlich wie Android Workshop (20)

Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game development
 
Android tutorial1
Android tutorial1Android tutorial1
Android tutorial1
 
Android Scripting
Android ScriptingAndroid Scripting
Android Scripting
 
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideAndroid Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start Guide
 
Engineering and Industrial Mobile Application (APP) Development
Engineering and Industrial Mobile Application (APP) DevelopmentEngineering and Industrial Mobile Application (APP) Development
Engineering and Industrial Mobile Application (APP) Development
 
Mobile Software Engineering Crash Course - C03 Android
Mobile Software Engineering Crash Course - C03 AndroidMobile Software Engineering Crash Course - C03 Android
Mobile Software Engineering Crash Course - C03 Android
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Android
AndroidAndroid
Android
 
Android studio
Android studioAndroid studio
Android studio
 
Mobile web development
Mobile web developmentMobile web development
Mobile web development
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Android - Anroid Pproject
Android - Anroid PprojectAndroid - Anroid Pproject
Android - Anroid Pproject
 
Presentation1
Presentation1Presentation1
Presentation1
 
Basics of Android
Basics of Android Basics of Android
Basics of Android
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
Android - Open Source Bridge 2011
Android - Open Source Bridge 2011Android - Open Source Bridge 2011
Android - Open Source Bridge 2011
 
Android class provider in mumbai
Android class provider in mumbaiAndroid class provider in mumbai
Android class provider in mumbai
 

Mehr von Junda Ong

Opportunity with audio
Opportunity with audioOpportunity with audio
Opportunity with audioJunda Ong
 
Enhance offline experience
Enhance offline experienceEnhance offline experience
Enhance offline experienceJunda Ong
 
Disrupt flyer
Disrupt flyerDisrupt flyer
Disrupt flyerJunda Ong
 
Build your product 10x faster
Build your product 10x fasterBuild your product 10x faster
Build your product 10x fasterJunda Ong
 
Build travel apps the easy way
Build travel apps the easy wayBuild travel apps the easy way
Build travel apps the easy wayJunda Ong
 
Hoiio API: An introduction
Hoiio API: An introductionHoiio API: An introduction
Hoiio API: An introductionJunda Ong
 
Build Voice App the Easy Way
Build Voice App the Easy WayBuild Voice App the Easy Way
Build Voice App the Easy WayJunda Ong
 
How mac fonts appear in slideshare?
How mac fonts appear in slideshare?How mac fonts appear in slideshare?
How mac fonts appear in slideshare?Junda Ong
 
Pull Toy Design
Pull Toy DesignPull Toy Design
Pull Toy DesignJunda Ong
 
NYP Talk - Sharing Mobile Development Experience
NYP Talk - Sharing Mobile Development ExperienceNYP Talk - Sharing Mobile Development Experience
NYP Talk - Sharing Mobile Development ExperienceJunda Ong
 
Using AppEngine for Mobile Apps
Using AppEngine for Mobile AppsUsing AppEngine for Mobile Apps
Using AppEngine for Mobile AppsJunda Ong
 

Mehr von Junda Ong (11)

Opportunity with audio
Opportunity with audioOpportunity with audio
Opportunity with audio
 
Enhance offline experience
Enhance offline experienceEnhance offline experience
Enhance offline experience
 
Disrupt flyer
Disrupt flyerDisrupt flyer
Disrupt flyer
 
Build your product 10x faster
Build your product 10x fasterBuild your product 10x faster
Build your product 10x faster
 
Build travel apps the easy way
Build travel apps the easy wayBuild travel apps the easy way
Build travel apps the easy way
 
Hoiio API: An introduction
Hoiio API: An introductionHoiio API: An introduction
Hoiio API: An introduction
 
Build Voice App the Easy Way
Build Voice App the Easy WayBuild Voice App the Easy Way
Build Voice App the Easy Way
 
How mac fonts appear in slideshare?
How mac fonts appear in slideshare?How mac fonts appear in slideshare?
How mac fonts appear in slideshare?
 
Pull Toy Design
Pull Toy DesignPull Toy Design
Pull Toy Design
 
NYP Talk - Sharing Mobile Development Experience
NYP Talk - Sharing Mobile Development ExperienceNYP Talk - Sharing Mobile Development Experience
NYP Talk - Sharing Mobile Development Experience
 
Using AppEngine for Mobile Apps
Using AppEngine for Mobile AppsUsing AppEngine for Mobile Apps
Using AppEngine for Mobile Apps
 

Kürzlich hochgeladen

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
 
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
 
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
 
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
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[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
 
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
 
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
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Kürzlich hochgeladen (20)

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
 
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
 
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
 
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
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[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
 
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
 
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
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

Android Workshop

  • 1. Android Workshop Android application development & connectivity to Arduino
  • 3. My Hobby Projects just2us.com
  • 4. My Full Time developer.hoiio.com
  • 6. Hoiio API Mr Brown Podcast Over The Phone!! Call 6602 8104
  • 8. Android Apps: txeet ~250,000 downloads
  • 12. Workshop Topics 1. Introduction to Android 2. Hello World! 3. Application Fundamentals 4. User Interfaces 5. Bluetooth
  • 14.
  • 15. Introduction • Linux Kernel • Application Framework • Dalvik Virtual Machine • App distributed as an .apk • Ten billion apps downloaded
  • 17. Introduction: Resources • http://developer.android.com • http://stackoverflow.com/ • http://www.google.com/
  • 19. Hello World: Installing SDK 1. Install Eclipse - the IDE http://www.eclipse.org/downloads/packages/eclipse-classic-371/indigosr1 2. Install Android SDK http://developer.android.com/sdk/index.html Guide from http://developer.android.com/sdk/installing.html
  • 20. Hello World: Installing SDK 3. Install Android ADT Plugin for Eclipse http://developer.android.com/sdk/eclipse-adt.html#installing a. Eclipse > Help > Install new software b. Add repository https://dl-ssl.google.com/android/eclipse/ c. Select “Developer Tools” d. Next, next, next and finish! Guide from http://developer.android.com/sdk/installing.html
  • 21. Hello World: Installing SDK 4. Setup ADT Plugin a. Ecplise > Preferences > Android b. Point to your Android ADK Location (from step 2) Guide from http://developer.android.com/sdk/installing.html
  • 22. Hello World: Create • File > New > Android Project
  • 23.
  • 24. Hello World: Run • Run > Run as > Android Application • If running on actual device, do this first: Settings > Applications > Development and turn on USB debugging
  • 25. Now you see “Hello World”, let’s look at the code..
  • 27. Fundamentals • 4 components 1. Activity 2. Service 3. ContentProvider 4. BroadcastReceiver
  • 28. Fundamentals: Activity • Launch an Activity by calling startActivity(intent) Launch a known Activity Intent intent = new Intent(this, SignInActivity.class); startActivity(intent); Initiate a system launch Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_EMAIL, recipientArray); startActivity(intent);
  • 29. Fundamentals: Activity • Activities form a stack • Functions to handle events: onCreate, onResume, onPause, etc
  • 30.
  • 31. Fundamentals: Activity • Activity must be declared in AndroidManifest.xml <manifest ... >   <application ... >       <activity android:name=".ExampleActivity" />       ...   </application ... >   ... </manifest >
  • 32. Fundamentals: Service • Service or Thread ? • Service runs in the background, even when user is not interacting with your app. • To start, call startService() • Similar to Activity, has its lifecycle and various event callbacks.
  • 33. Fundamentals: ContentProvider • A way to share data across applications, including apps such as phonebook, calendar, etc. • In other words, you can access the phonebook using a ContentProvider • Have query, insert, delete methods (SQLite) ContentResolver cr = getContentResolver(); cr.query(“content://android.provider.Contacts.Phones.CONTACT_URI”, projection, selection, selectionArg, sortOrder)
  • 34. Fundamentals: ContentProvider Let’s look at a sample code
  • 36. User Interfaces • 2 ways to construct UI 1. XML 2. Code
  • 37. User Interfaces: XML /res/layout/main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/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" android:text="@string/hello" /> </LinearLayout> @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); }
  • 38. User Interfaces: Code 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. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        TextView tv = new TextView(this);        tv.setText("Hello, Android");        setContentView(tv);    } }
  • 42. View Hierarchy ViewGroup: Layout or container view View: Android UI component, view or widgets
  • 44. UI Views • Look at “Hello View” tutorial • http://developer.android.com/resources/tutorials/views/index.html • Also look at “Api Demo” sample code
  • 45. User Interfaces • Common UI Patterns http://www.androidpatterns.com/
  • 46. Change view on a set of data
  • 50. Bluetooth • Bluetooth Modem, aka BlueSMiRF Gold, aka Firefly • http://www.sparkfun.com/products/582 • Specifications • Extremely small • Operating Voltage: 3.3V-6V • Serial communications: 2400-115200bps
  • 51. Bluetooth: The Pins • Pins from left to right • GND • CTS-1 • VCC • TX-0 • RX-1 • RTS-0
  • 52. Bluetooth: Connect to Android • A guide from instructables.com http://www.instructables.com/id/Android-talks-to-Arduino/?ALLSTEPS • !!! NOTE: Arduino version 1.0 does not work with the libraries. Download version 0023 instead http://arduino.cc/en/Main/Software
  • 53. Bluetooth: Connect to Android 1. Connect from Bluetooth modem to Arduino • VCC to +3.3V • GND to GND • TX-0 to PIN-2 (RX) • RX-1 to PIN-3 (TX) If works, you will see a red LED blinking
  • 55. Bluetooth: Connect to Android 2. Import NewSoftSerial library to Arduino • Provides an interrupt architecture (vs SoftwareSerial) • Copy /Library/NewSoftSerial to: • Mac: ~/Documents/Arduino/libraries/ • Windows: My DocumentsArduinolibraries • Instructions on how to use at http://arduiniana.org/libraries/ newsoftserial/ You will see NewSoftSerial in Sketch > Import Library >
  • 56. Bluetooth: Connect to Android 3. Upload sketch to Arduino • /Sample Code/bluetooth/bluetooth.pde
  • 57. Bluetooth: Connect to Android 4. Open BluetoothChat, an Android sample app • File > New > Android Project • Select target Android 2.3.3 • Create project from existing sample > BluetoothChat > Finish • In BluetoothChatService, change the UUID to "00001101-0000-1000-8000-00805F9B34FB" • Build and deploy to phone
  • 58. Bluetooth: Connect to Android 5. To send a message • Pair up: Settings > Wireless & network > Bluetooth > Select FireFly-xxxx. Password is 1234. • Connect: Open BluetoothChat app. Press Menu > Connect > FireFly-xxxx • When connected, Bluetooth modem will have green light • Type a message and send. If success, PIN 13 will light up for 5 sec.
  • 59. Bluetooth: Connect to Android 6. Change baud rate to 57,000 • Refer to http://www.instructables.com/id/Change-BAUD-rate-on-BlueSMiRF- Gold/ • Need FTDI Basic chip..
  • 60. USB Host Shield A guide from circuitathome

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. http://developer.android.com/guide/basics/what-is-android.html\n\nhttp://kschang.hubpages.com/slide/Cupcake-Donut-Eclair-Froyo-Gingerbread-Honeycomb-Android-OS-Version-Codenames-and-Why/4609964\n
  14. http://www.android.com/about\n
  15. Android != Linux\nUsed Linux security, mem mgmt, threading, etc\nEach app, 1 VM instance\nOptimized for mobile\nAndroid Package. A zip. Like Jar.\n\n
  16. http://developer.android.com/guide/developing/index.html\n
  17. http://developer.android.com/guide/basics/what-is-android.html\n
  18. \n
  19. \n
  20. \n
  21. \n
  22. http://developer.android.com/resources/tutorials/hello-world.html\n
  23. http://developer.android.com/resources/tutorials/hello-world.html\n
  24. http://developer.android.com/resources/tutorials/hello-world.html\n
  25. \n
  26. http://developer.android.com/guide/topics/fundamentals.html\n
  27. http://developer.android.com/guide/topics/fundamentals.html\nActivity - A single screen (UI)\nService - background activity eg. play music globally\nContentProvider - Even share data across apps. SQLite. eg. contacts. ContentResolver\nBroadcastReceiver - Responds to system wide broadcast announcements. Usually from the system eg. Send Message, Picture captured\n
  28. \n
  29. \n
  30. Activity lifecycle\n
  31. \n
  32. http://developer.android.com/guide/topics/fundamentals/services.html\n
  33. http://developer.android.com/guide/topics/providers/content-providers.html\nhttp://developer.android.com/reference/android/provider/package-summary.html\n
  34. http://developer.android.com/guide/topics/providers/content-providers.html\nhttp://developer.android.com/reference/android/provider/package-summary.html\n
  35. http://developer.android.com/guide/topics/fundamentals.html\n
  36. \n
  37. \n
  38. \n
  39. http://developer.android.com/guide/topics/ui/layout-objects.html \n
  40. http://developer.android.com/guide/topics/ui/layout-objects.html \n
  41. http://developer.android.com/guide/topics/ui/layout-objects.html \n
  42. \n
  43. \n
  44. http://developer.android.com/reference/android/widget/package-summary.html\n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. http://www.arduino.cc/en/Hacking/Libraries\n
  56. \n
  57. \n
  58. \n
  59. http://www.sparkfun.com/products/9716\n
  60. http://www.circuitsathome.com/mcu/exchanging-data-between-usb-devices-and-android-phone-using-arduino-and-usb-host-shield\n\nhttps://github.com/felis/USB_Host_Shield_2.0\n\n