Introduction to Android Intro
3G, 4G
- Third generation mobile communication technology (3rd-generation), the rate is generally hundreds of kbps, compared to the previous 2G and 2.5G in the data transmission speed is greatly improved.
- The fourth generation of mobile communication technology (4th-generation), the speed can reach more than 100Mbps, almost meet the needs of all people to transmit data.
The current mainstream 3G technical standards have three kinds:
- WCDMA: More than 80% of the global 3G network is the use of this format. China Unicom operates. 186
- CDMA2000: At present, Japan and South Korea and North America use more. China Telecom operations. 189
- TD-SCDMA: China's independent intellectual property rights 3G communication technology. China Mobile operations. 188
The current mainstream 4G technology is LTE, but has not been widely used:
Gsm→gprs→edge→wcdma→hsdpa→hsdpa+→lte
What is Android
Software stack memory for mobile devices, including
- A complete operating system
- Middleware
- Critical applications
The bottom layer is the Linux kernel
- Security management
- Memory management
- Process Management
- Power Management
- Hardware Drivers
Android architecture
- Applications: Applications such as desktop apps, phone apps, browsers, etc.
- Applications Framework:activitymanager, WindowManager, ContentProvider, ResourceManager, etc.
- Libraries:sqlite Library, Surfacemanager, WebKit, Oppengl and so on.
- Android runtime
- Core Libraries
- Dalvik Virtual Machine
- Linux Kernel: Hardware drivers, power management, etc.
Dalvik the difference between a VM and a JVM
- Post-compilation file format:
- JVM:. Java->.class->.jar
- Dalvik:. Java->.class->.dex->.odex
- Based on the different architectures
- JVM Stack-based architecture (stack memory)
- Dalvik Register-based architecture (CPU) with higher execution efficiency than JVM
- Dalvik specifically optimized for mobile platforms
There are many class files in the JVM jar package, each containing header information, Chang, fields, methods, and so on, and there is only one Dex in the APK, which includes all header information, Chang, methods, etc. This way, reading a file is better than reading multiple files to find blocks.
CPU Processor Architecture
- x86
- Arm
Android Project directory structure
- SRC: Source code
- Gen: System automatically generated files, R.java the various resource IDs in the project are recorded
- Res: system resources, all files will generate resource ID in R file
- Drawable: Pictures
- Layout: interface Layouts
- Values: Data
- ANIM: Defining XML for animations
- Raw: Native File
- Assets: Resource path, not registered in R file
- Project.Properties: For eclipse use, read the item using the Android version number. Earlier versions are named Default.properties
- Androidmanifest.xml: Manifest file, read when software is installed
The four components of Android (Activity, ContentProvider, Broadcastreceiver, Service) require that the permissions required to register the program in the file also need to be declared in this file, for example: Phone, SMS, Internet, Access SD Card
- Bin: binary files, including class, resource files, Dex, APK, etc.
- PROGUARD.CFG: A configuration file used to confuse code to prevent others from recompiling
APK installation Process
- Eclipse compiles. Java source files into a. class
- Convert all. class files to. dex files using the DX tool
- The. dex file and all resources are then packaged and signed as an. apk file
- Install the. apk file to the virtual machine Completion program installation
- Start Program – Open process – turn on the main thread
- Create Activity Object – Execute OnCreate () method
- Initialize the interface according to the Main.xml file
In a nutshell, the installation of the software is two processes
- Copy the apk to get some files to a directory in the system, 1./data/app/directory, 2. Create a folder/data/data/com.test.helloworld/to save the data
- Configure some information in the registry of your system. Data/system/packages.xml
Android Security Science
An important design point in Android security is that applications do not have permissions to perform actions that are harmful to other applications, operating systems, or users by default. These actions include reading/writing the user's privacy data (such as contact or e-mail), reading/writing other application files, performing network access, maintaining device activity, and so on. So there is a need to request permission for actions that involve paying or that may be related to user privacy.
Test classification
Integrated test (function test), unit test, testing (intergation test)
Android Unit Test
- Configure in Androidmanifest.xml to import the JUnit environment of Android
- Writing the test class inherits Android's Test parent class, Androidtestcase this class (Androidtestcase is to simulate a mobile phone environment, this class has a GetContext method to get to the current test class application context object, So this method has to wait until the test framework has been initialized before it can be called.
- The method name of the test is required to start with a lowercase test, such as not starting with test can only be run alone, the whole run without this method, all the test methods to throw an exception, to throw exceptions to the test framework can not be captured by themselves.
Note: The test code can only be run on the phone, it was tested on the phone and then sent the message to eclipse
- Email: [Email protected]
- Good luck!
Introduction to Android Intro