Monday, August 1, 2016

CHP1_Android Overview


  • Android base on Linux , Open source platform
  • Google support
  • Java  + XML 
  • apply on varies of  phone pad .....
============================================================================================================================================
  • What is it look like ?
    • App GUI
      • Layout
        • XML
          • buttons , labels, text .... GUI elements
  • How does it works ?
    • Working content
      • Activity
        • Java class 
          • (which layout connect to ?)
          • (how does the app response?)
  • Extra sources
    • graphics ,audios , application data


All of what we talking is  a bunch of specific  menu's files => package when we build

============================================================================================================================================
  • Android platform
    • Android core applications (Java)
      • Contacts ,Calendar,Maps,Browser
    • Applications framework (Java)
      • These are called "API" which can be read and save to control the application's "looking " & "behavior"
        • Activity Manager
        • Window Manager
        • Content Providers
        • View System
        • Package Manager
        • Telephony Manager
        • Resource Manager
        • Location Manager
        • Notification Manager
    • Libraries (C++ /C)
      • Surface Manager
      • OpenGL |ES
      • SGL
      • SSL
      • Free Type
      • WebKit
      • libc
      • SQLite
      • Media Framework
    • Android Runtime (Jave build : core libraries)
    • Linux Kernel
      • driver , safety protect , memory management ....
        • Display Driver
        • Camera Driver
        • WiFi Driver
        • Keypad Driver
        • Flash Memory Driver
        • Audio Drivers
        • Binder(LPC) Driver
        • Power Management
============================================================================================================================================

IDE _Android Studio (Java format  to Android format)

  • No .class  & .jar = >Yes Android Unique format in order to acc and save the power
  • special edition of "IntelliJ IDEA"
    • compiler
    • read and save Android SDK's tools and libraries
    • templetes
    • package and execute the app
  • Grandle (build tool)
    • command line
    • text editor
  • Android Studio  = Gandle + other tools  +  GUI
Android SDK
  • Android Software Development Kit (Libraries and tools) for each edition of Android
    • SDK platform
    • SDK tool (Debug  and Testing ...)
    • App Examples
    • Google Play Billing
    • Desciption File (API file)
    • Android support
JDK
  • Java Development Kit
JRE
  • Java Runtime Environment

============================================================================================================================================

Start to build your first App

  1. create your new project
  2. projext configure
    1. Application name => the name in Google Play
    2. Company domain
    3. Package name => combine with application name and company domain
      1. to identify your app by Android device
      2. manage different edition's app
      3. always the same after build
  3. API level
    1. Minimum SDK 
      1. Android Edition
        1. version number
        2. codename (may include few editions)
  4. create Activity and Layout
  5. activity configure
    1. Activity name (Java)
    2. Layout name (XML)
    3. Title
    4. menu resource name




  • Activity => What is the action ?
    • def one thing that user can do 
  • Layout => What does the GUI look like ?
    • how does the GUI elements arrange
============================================================================================================================================
  1. Start App
  2. create Activity
  3. Activity point to Layout
  4. Activity tell Android to display layout on the screen
  5. user act with layout 
  6. activity response to this act by code
  7. activity refresh the screen
============================================================================================================================================

Table of Content

  • explorer
    • java & XML (activity & layout)
    • Android  .java files
    • res
      • icon
      • style
    • Android libraries
      • app compatibility
      • minimize SDK
    • config
  • grandle
    • compile and arrange your app
    • app
      • build
        • R.java
      • src
        • main
          • java
            • MainActivity.java
          • res
            • layout
              • activity_main.xml
            • values
              • strings.xml
            • AndroidManifest.xml

============================================================================================================================================


Carry out

  • Entity device
  • Android SDK , Emulator 
    • one or more Android virtual device
      • QEMU
        • similar as VirtualBox  or VMWare
    • steps
      • open AVD Manager
      • create a virtual device
      • select hardware
      • select system image
        • Android edition
        • CPU (ARM , x86)
        • API level
      • verify configuration
    • Run app
      • launch emulator
        • java original code 
          • compile to bytecode
            • build up APK (include java.file  + libraries + res)
              • APK upload to AVD and be installed
                • AVD active app's activities
                  • start from "MainnActivity.java"
                    • activity point to "activity_main.xml"
                      • activity let screen show the layout
                        • monitor by console
APK
  • Android application package
  • aka . Android application 's JAR or ZIP files


Java => bytecode => APK

Android is not operating on "Java VM "
but on "ART " or the older version "Dalvik"

  1. you wrote the java code
  2. compile to .class file
  3. assemble the .class files to DEX format single file (smaller and more efficiency bytecode)
  4. ART execute DEX code
ART
  • translte the DEX bytecode to more suitable code on Android device
    • faster and less power consumption
JVM
  • waste lots of memory resources
    • each app run its own process

============================================================================================================================================

Modify App


  • Activity tell app what to do ? how to response the user ? MainActivity.java
  • Layout show how the app look like , appearance?  activity_main.xml
    • app/src/main/res/layout
      • code editor (Text)
        • =>elements...more later on 
          • <RelativeLayout>
            • relative position show the arrangement
          • <TextView>
            • show the text
            • string.xml
              • @android : text = "@string/hello_world"
      • design editor (Design)
string.xml
  • save the string name / value resource file
    • layout and activity can use name to inquire the correspond string  
  • for international concern
    • varies of different languages
  • app/src/main/res/values/strings.xml
    • <resources>
    • include , simple values , color , string
  • app/src/main/res/values_fr

<string name = "string_name">string_value</string>
"@string/string_name"

============================================================================================================================================

Quick Recap

  • Android Edition 
    • version number + API level + version code
  • Android Studio
    • special edition IntelliJ IDEA + Android SDK + grandle
  • Android app
    • activity + layout + res
  • layout
    • RelativeLayout
    • TextView
  • activity
  • strings.xml
  • AndroidManifest.xml
  • AVD
  • APK
    • Android app .JVR include app's ( bytecode + libraries + res )
  • ART
    • Android runtime
      • independent process

No comments:

Post a Comment