The launch of the Android mobile phone operating system has been greatly favored by the majority of programmers. So what are its outstanding characteristics attracting people's eyes? Here we summarize some Android features for your reference and learning.
- Android Audio Distortion Solution
- Android target Type Selection Skills
- Code Analysis for Android multimedia playback
- Android tab Code Writing Method
- Summary of common Android skills
1. What is Android?
Android is a platform, mainly including Linux microkernel, middleware SQLite, etc.), key application phone book, email, short message, GoogleMap, browser, etc.), Java framework provided, and JVM in Android.
2. Key features of Android
View, ContentProviders application interaction management class), ResourceManager non-coding resource management class, icationicationmanager announcement management class), ActivityManager lifecycle management class ).
3. Android features-interface development
This section mainly discusses the Android interface development mechanism. We can introduce the initialization extraction of components and put them in the configuration file. Component updates are encoded for processing.
4. Application Composition
Android applications generally consist of the following four key parts: Activity, IntentReceiver, Service, and ContentProvider. Activity is a necessary part.
Application scenarios:
Every application of an Activity is required. An Activity represents a specific interface management class of an application and is not displayed.
IntentReceiver can enable the application to respond to external events. For example, when an application is executing and a call suddenly occurs, you can use IntentReceiver to handle the event, which makes the application more robust.
The life cycle of a Service Android application is determined by the Android system. When the application needs to run normally without interface display, there must be a background thread, and the background thread will not be recycled by the system until the thread ends.) At this time, the Service is used.
ContentProvider can be said that ContentProvider encapsulates many context environments in Android, including SQLite, which makes interaction between different applications possible.
5. layout management based on Android features
FrameLayout: only one component is displayed in the upper left corner.
LinearLayout: Linear layout manager, which consists of horizontal and vertical lines. Only one row layout can be performed.
TableLayout: table layout manager for any row or column. TableRow represents a row, and each view component of TableRow represents a cell.
AbsoluteLayout: absolute layout manager. Axis mode. The upper left corner is 0, 0). It increments to the right X axis and down to the Y axis.
RelativeLayout: relative to the layout manager, the latest view component or top-level parent component is used to determine the location of the next component.
6. Activity Interaction
Intent method: Intent is actually used for interaction between activities. It should be noted that Intent has an Intent description, which is worth further exploration. For a simple example, there is a kind of Intent. ACTION_CALL, which can be called directly.
SharedPreferences is a lightweight storage class on the Android platform. It stores some common configurations. SharedPreferences is similar to the ini configuration file on Windows in the past. However, SharedPreferences can be divided into multiple permissions, which can be shared globally and stored in xml format. SharedPreferences are not as efficient as Intent, but can be shared, all can interact with each other. However, it is more efficient than SQLite.
SQLite is also a database. This method is not recommended because of its efficiency. If it is used for interaction between different applications, you can consider SQLite. Or permanent storage.
7. lifecycle of Android features
It is very important to understand the Android lifecycle, including the following:
Every Android application runs in the form of a process. Its lifecycle is not controlled by itself, but determined by the System Based on some features of the running application.
It is important to understand the Android lifecycle when your application will be recycled by the system.
Understanding the lifecycle can improve the robustness of applications. For example, the application initialization should be put in the onCreate method. When the application is paused, the application will rewrite the onPause method to save the operation results of the current application.
8. SQLite
SQLite is a built-in database provided by Android and is said to be lighter than MySql. SQLite is also an open-source product. The database operation methods are as follows:
You can directly insert, update, or delete SQL statements and call execSQL (). rawQuery is required for query, the query result returned is a scrollable result set. before performing the Cursor operation on the Cursor, you need to move the Cursor to the first place. Each result is moved to the first place.
9. Android Development Experience Sharing
1. display of custom components. When writing a custom View, you must adjust X and Y of the View to reach the expected ideal position. You can draw the X and Y coordinate values of each component next to the component. This is intuitive and you will know how to adjust them at a glance.
2. Use Log to print logs and perform debugging.
3. Using the LogCat view, there is a LogCat view in the showView. The LogCat view displays the stack information printed by some Android simulators, which is very helpful for application debugging, in addition, the Log printed by Log is also displayed here.
4. Using the Emulator Control view, Emulator Control can complete some simple device operations, such as simulating incoming calls and short messages.
5. tools in the tools directory are provided in the Android SDK. These tools can be used to operate Android simulators, such as creating a virtual SD card, move the files in the system to the virtual SD. Android provides corresponding tools and relevant commands can be viewed online.
The above is all the Android features we have summarized for you.