Android Foundation Dry Goods (1): Understand the history of Android

Keywords: Android Java Linux SDK

- Restore content to start

Jinxing

Introduction of 1.1G-4G

  1. G generation
  2. 1G Big Brother can only communicate without sending short messages.
  3. 2G wap.baidu.com supports online MMS service
  4. 3G W www.baidu.com 7.2M/s
  5. 4G lte long time evolution 100M/s
  6. Major difference rates
  7. 5G Huawei Big Companies Sell Standard Small Companies Sell arm: No Processor 10G/s

2. Introduction to Android Operating System

Andy Rubin R&D

3. Introduction to Android History

Android version corresponds to api level 
3.0 ---11
2.3----10
2.2 ---8

4.Android System Architecture (Focus)

   Layer 1: Application Layer
   Layer 2: Application Framework  
   Layer 3: Android underlying class library Libraries, Dalvik virtual machine
   Layer 4: linux kernel Layer linux kernel
  Android is tested on the basis of the Linux kernel.

5. The difference between the two virtual machines (emphasis)

1,Different architectures: JVM Use stack architecture; Dalvik Register is used and data is loaded into CUP It's on the registers of ____________.
2,JVM Loaded.class Documents, Dalvik Loading is.dex File, optimize the allocation of memory.

jvm: sun oracle  
dvm:  Google

6. Use of SDK Manger

It can manage the download and uninstall of SDK version.
sdk  

7. Introduction and Creation of Simulator

  VGA 480* 640
  QVGA 240*320
  HVGA 320*480
  WQVGA 240*400
  FWVGA 480*854
  WVGA 480*800 
  AVD: Android virtual Device

8.DDMS introduction

DDMS: Device Definition Monition Service 

9.SDK directory

add-ons: Files that store API s for advanced applications
 build-tools: build tools
 docs: Development documentation
 extras: Store dependent third-party packages
 platforms: files for each platform
 adb: Android debug brigde Android debugging Bridge 

Source: API source code file
 system-images: the mirror file of the system
 tools: Tool files

10. Create HelloWorld

   The process of deploying apk files:
   IDE judges whether ADB is working, uploads apk files to the simulation with adb, installs apk files in the simulator, and opens the application software. __________?
   

11. Directory structure of Android project

Src / Java source code storage directory
 gen/Auto-Generate Directory
 The gen directory holds all files automatically generated by Android development tools. The most important thing in the directory is the R.java file. This file is automatically generated by Android development tools. Android development tools automatically update and modify R.java files synchronously according to the resources you put into the res directory. Because R.java files are automatically generated by development tools, we should avoid manual modification of R.java. R.java plays a dictionary role in the application. It contains the id of various resources. Through R.java, the application can easily find the corresponding resources. In addition, the compiler also checks whether the resources in the R.java list are used, and the unused resources will not be compiled into the software, which can reduce the space occupied by mobile applications.
res/Resources directory
 In this directory, we can store all kinds of resources used by applications, such as xml interface files, pictures or data.
libs / Support Library Directory
 Some of the three-party jar packages needed for program development can be placed in this directory, and the system will automatically add the jar packages to the environment variables.
assets resource directory
 Android not only provides / res directory to store resource files, but also can store resource files in / assets directory. Moreover, resource files in / assets directory will not automatically generate ID in R.java, so reading files in / assets directory must specify the path of files, such as file://android_asset/xxx.3gp.
AndroidManifest.xml project manifest file
 This file lists the functions provided by the application. The various components you have developed need to be configured in this file. If the application uses the built-in applications of the system (such as telephone service, Internet service, short message service, GPS service, etc.), you also need to declare the use rights in this file.
project.properties project environment information, generally do not need to modify this file

12. The packaging process of Android

   It packages Android applications into a. apk file, which can be installed on a mobile phone or an emulator.
   If the signature is packaged, the file is encrypted in the process of packaging.
   Applications put on the Android market must be signed.

  aapt: Android application package tools packaged apk files 
  Signature: 
  adb :Android debug bridge  

13.ADB command

Common commands:

adb devices list all devices
 The space where adb shell is mounted to linux can execute liux instructions
 If there are multiple devices in adb install xxx. apk, we can specify the device adb install - s emulator - 5554 D:/xxx. apk
 adb shell mounted to linux space
 adb push pushes files into mobile phones  
adb pull pulls files out of mobile phones
 Switching of ctrl + F11 horizontal and vertical screen 

14. Telephone Dialer (Focus)

Steps for developing projects:

1. Understand the requirements and write the code after understanding the requirements.
2. Designing UI interface in Android project;
3. Code realizes business logic;

The code of the telephone dialer:

    //Initialize controls in layout files
    et_phone = (EditText) findViewById(R.id.et_phone);
    Button bt_call  = (Button) findViewById(R.id.bt_call);
    
    
    //Get the data in the EditText control
    
    
    bt_call.setOnClickListener(new OnClickListener() {
        
        @Override
        public void onClick(View v) {
            //Dial the telephone number
            //Get the phone number in the data box
            String phone = et_phone.getText().toString().trim();
            //Create an intention to make a call
            Intent intent = new Intent(); 
            //Setting up the action of dialing telephone number
            intent.setAction(Intent.ACTION_CALL);

            //Set up the phone number you dialed
            intent.setData(Uri.parse("tel://"+phone));

            //Intention to turn on the call
            startActivity(intent);
        }
    });

15. Four Click Events

 (1)Implementing it in the way of internal classes OnClickListener 
 (2)Anonymous Inner Class
 (3)Current class imp OnClickListener 
 (4)onclick


  1,Set the button's click event listener to create an anonymous inner class
    bt_call.setOnClickListener(new OnClickListener() {
        
        @Override
        public void onClick(View v) {
            //Dial the telephone number
            String phone = et_phone.getText().toString().trim();
            Intent intent = new Intent(); 
            
            intent.setAction(Intent.ACTION_CALL);
            System.out.println("phone="+phone);
            intent.setData(Uri.parse("tel://"+phone));
            startActivity(intent);
        }
    });

2,Create an internal class
private class MyOnClickListener implements OnClickListener{

    @Override
    public void onClick(View v) {
        //Dial the telephone number
        String phone = et_phone.getText().toString().trim();
        Intent intent = new Intent(); 
        
        intent.setAction(Intent.ACTION_CALL);
        System.out.println("phone="+phone);
        intent.setData(Uri.parse("tel://"+phone));
        startActivity(intent);          
    }
    
}

//Don't forget to add a click event listener to the button
bt_call.setOnClickListener(new MyOnClickListener());


3,Add a click event response method to the button in the layout file, and then implement this method in the code
(1)Add a click event response method to the button in the layout file
    <Button 
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:text="dial"
   android:id="@+id/bt_call"
   android:onClick="call"
  />

(2)Implementing this method in code
//View represents the button view
public void call(View view){
    //Dial the telephone number
    String phone = et_phone.getText().toString().trim();
    Intent intent = new Intent(); 
    
    intent.setAction(Intent.ACTION_CALL);
    System.out.println("phone="+phone);
    intent.setData(Uri.parse("tel://"+phone));
    startActivity(intent);      
}

16. Five Layouts

  1. Linear layout (emphasis) is divided into horizontal and vertical
  2. Relative layout: Each component is placed in relative position.
  3. Frame Layout: Layer by Layer Drawing
  4. Table layout
  5. Absolute layout has been abandoned by Google

  6. Nested use of various layouts is commonly used in work.

    - Restore the end of the content.

Posted by Jason28 on Sat, 11 May 2019 01:14:18 -0700