Online Android development! What are the Android interviewers from BAT manufacturers thinking? Review guide

This column focuses on sharing knowledge of large-scale Bat interviews, and will continue to be updated in the follow-up. If you like, please click a follower

Interviewer: What is audio and video, and why does the video need to be compressed?

Psychological analysis : Many people's concept of audio and video rests on Mr. Cang's short film, and they can only understand that he is a video file. The interviewer examines whether there are any concepts related to the encapsulation format under the video file, the composition of the video file, and the development of audio and video

**Job applicants:** First, you need to explain from the composition of the video file, and slowly go deep into the video encoding

1. The architecture of the Android system

  • The application of the Android system architecture
    Android will be released together with a series of core application packages, which include email client, SMS short message program, calendar, map, browser, contact management program, etc. All applications are written in JAVA language.
  • The application framework of the Android system architecture
    Developers can fully access the API framework (android.jar) used by the core application. The architecture design of the application simplifies the reuse of components; any application can release its function blocks and any other application can use the released function blocks.
  • System runtime library of Android system architecture
  • Linux kernel of Android system architecture

2. Activity life cycle

image.png

3. Fragment life cycle

  • Fragment life cycle
  • Fragment and Activity life cycle comparison

4. Service life cycle

In the life cycle of Service, commonly used are:

4 manual methods

startService()    启动服务
stopService()    关闭服务
bindService()    绑定服务
unbindService()    解绑服务

5 methods that are automatically called internally

onCreat()            创建服务
onStartCommand()    开始服务
onDestroy()            销毁服务
onBind()            绑定服务
onUnbind()            解绑服务
  1. Manually call startService() to start the service, and automatically call the internal methods: onCreate(), onStartCommand(). If a Service is started multiple times by startService(), then onCreate() will only be called once.
  2. Manually call stopService() to close the service, and automatically call the internal method: onDestory(). If a Service is started and bound, if you use stopService() to close the service without unbinding, the service cannot be stopped.
  3. After manually calling bindService(), internal methods are automatically called: onCreate(), onBind().
  4. After manually calling unbindService(), internal methods are automatically called: onUnbind(), onDestory().
  5. startService() and stopService() can only open and close the Service, and cannot operate the Service. The Service still exists after the caller exits; bindService() and unbindService() can operate the Service. After the caller exits, the Service is destroyed with the caller.

5. Animation in Android

Animations in Android are frame animation, tween animation and attribute animation (after Android 3.0)

Frame animation

Frame animation is the easiest kind of animation to achieve. This kind of animation relies more on perfect UI resources. Its principle is to play individual pictures consecutively to produce an animation effect visually. ; Somewhat similar to the way some software makes gif animations. In some codes, we will also see android: oneshot="false", the meaning of this oneshot is whether the animation is executed once (true) or executed multiple times in a loop.

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:drawable="@drawable/a_0"
        android:duration="100" />
    <item
        android:drawable="@drawable/a_1"
        android:duration="100" />
    <item
        android:drawable="@drawable/a_2"
        android:duration="100" />
</animation-list>

Tween animation

Tween animation can be divided into four forms, namely alpha (fade in and fade out), translate (displacement), scale (zoom size), rotate (rotation).
The realization of tween animation will generally adopt the form of xml file; the code will be easier to write and read, and it is also easier to reuse. The main function of Interpolator is to control the rate of change of the animation, which is the speed of the animation. pivot determines the reference position of the current animation execution

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@[package:]anim/interpolator_resource"
    android:shareInterpolator=["true" | "false"] >
    <alpha
        android:fromAlpha="float"
        android:toAlpha="float" />
    <scale
        android:fromXScale="float"
        android:toXScale="float"
        android:fromYScale="float"
        android:toYScale="float"
        android:pivotX="float"
        android:pivotY="float" />
    <translate
        android:fromXDelta="float"
        android:toXDelta="float"
        android:fromYDelta="float"
        android:toYDelta="float" />
    <rotate
        android:fromDegrees="float"
        android:toDegrees="float"
        android:pivotX="float"
        android:pivotY="float" />
    <set>
        ...
    </set>
</set>

Property animation

6. 4 major components in Android

  • Activity
  • BroadCast Receiver
  • Content Provider
  • service

7. Common layouts in Android

8. Ways of Push Messages

9.Android data storage

  1. Use SharedPreferences to store data; it is a mechanism provided by Android to store some simple configuration information, and uses XML format to store data in the device. It can only be used in the same package, and cannot be used between different packages.
  2. File storage data; file storage is a more commonly used method. The method of reading/writing files in Android is exactly the same as the program that implements I/O in Java. OpenFileInput() and openFileOutput() are provided. Method to read files on the device.
  3. SQLite database stores data; SQLite is a standard database that Android brings, it supports SQL statements, and it is a lightweight embedded database.
  4. Use ContentProvider to store data; mainly used for data exchange between applications, so that other applications can save or read various data types of this Content Provider.
  5. Network storage of data; upload (store) and download (obtain) the data information we store in the network space through the storage space provided to us on the network.

10.Activity startup mode

11. Broadcast registration

12. ANR in Android

13.ListView optimization

14.Android digital signature

15.Android root mechanism

Finally, take a look at the "Android Framework Architecture (Advanced UI+FrameWork Source Code)" mind map of all the knowledge points needed for learning. All the content of the following knowledge points are included in the study notes just now! Part of it has been shown in the article! If you are worried about how to learn or want to improve the efficiency of learning this knowledge, then this study note is definitely your secret weapon!

BC%81.md) Mind map of all the knowledge points needed for learning. All the content of the following knowledge points are included in the study notes just now! Part of it has been shown in the article! If you are worried about how to learn or want to improve the efficiency of learning this knowledge, then this study note is definitely your secret weapon!

[External link pictures are being transferred...(img-50bFZgTV-1614151758811)]

Guess you like

Origin blog.csdn.net/m0_52308677/article/details/114024233