preface

The golden nine silver ten job-hopping season in the workplace is hot, the difference is that this year’s competition will be more intense than in previous years, the form is more severe.

For job seekers, the interview is a hurdle, many people will be afraid of the interview, even for many years of work, there may be interview anxiety.

You may have heard or seen some information, that is, many companies are optimizing layoffs, but there are also many large companies released the information of “recruitment expansion”, such as Tencent, such as Bytedance.

1. The architecture of Android system

  • Android will ship with a set of core application packages, including an email client, SMS messaging app, calendar, maps, browser, contact manager, and more. All applications are written in the JAVA language.
  • Developers have full access to the API framework (Android.jar) used by the core application. The architectural design of the application simplifies component reuse; Any application can publish its feature block and any other application can use its published feature block.
  • System runtime library for Android system architecture
  • Linux kernel for Android system architecture

2. Activity lifecycle

3.Fragment life cycle

  • Fragment life cycle
  • Fragment vs. Activity lifecycle comparison

4.Service life cycle

In the life cycle of a Service, the following are commonly used:

Four manually called methods

StartService () Starts the service stopService() Stops the service bindService() binds the service unbindService() unbinds the serviceCopy the code

Five methods that are automatically invoked internally

OnCreat () creates the service onStartCommand() starts the service onDestroy() destroys the service onBind() binds the service onUnbind() unbinds the serviceCopy the code
  1. The internal methods onCreate() and onStartCommand() are automatically called. If a Service is started by startService() several times, onCreate() is called only once.
  2. If a Service is started and bound, it cannot be stopped if stopService() is used to stop the Service without unbinding.
  3. After calling bindService() manually, the internal methods onCreate() and onBind() are automatically called.
  4. After calling unbindService() manually, the internal methods onUnbind(), onDestory() are automatically called.
  5. StartService () and stopService() can only start or stop a Service, but cannot operate it. The Service still exists after the caller exits. BindService () and unbindService() can operate on services, which are destroyed with the caller after the caller exits.

5. The animation in the Android

Android animation: Frame animation, tween animation, and property animation (Android 3.0 onwards)

The frame of animation

Frame animation is one of the easiest animations to achieve. This kind of animation relies more on perfect UI resources. Its principle is to continuously play individual pictures, so as to produce a visual effect of animation. It’s kind of like the way some software makes ANIMATED giFs. In some code, we will also see Android: oneshot=”false”, which means the animation executes once (true) or the loop executes multiple times.

<? The 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>Copy the code

Filling between animation

The tween animation can be divided into four types: alpha, translate, scale, and rotate. The realization of tween animation is generally in the form of XML files. The code will be easier to write and read, as well as easier to reuse. Interpolator mainly controls the rate of change of an animation, the pace at which it is interpolated. Pivot determines the reference position for the current animation execution

<? The 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>Copy the code

Attribute animation

6. Four components of Android

  • Activity
  • BroadCast Receiver
  • Content Provider
  • service

7. Common Android layouts

8. Notification push

9. Android data store

  1. Store data using SharedPreferences; It is a mechanism provided by Android to store some simple configuration information in XML format to the device. It can only be used within the same package, not between different packages.
  2. File storage data; File storage is a common method. The method of reading/writing files in Android is exactly the same as that of implementing I/O programs in Java. OpenFileInput () and openFileOutput() methods are provided to read files on the device.
  3. SQLite database stores data; SQLite is a standard database that comes with Android. It supports SQL statements. It is a lightweight embedded database.
  4. Use ContentProvider to store data; It is used to exchange data between applications so that other applications can save or read the various data types of the Content Provider.
  5. Network storage data; Upload (store) and download (get) the data information we store in cyberspace through the storage space provided to us on the network.

10. Start the Activity mode

11. Broadcast registration

12. The ANR in Android

13. ListView optimization

14.Android digital signature

15. The Android root system

At the end of the article

Anyway, no matter what the size of the interview, so I wouldn’t be the interviewer don’t don’t of, only make full preparations maxed interview questions questions, in addition to this, of course, also need to beat the basis of their solid at ordinary times, so that no matter how the interviewer a chisel in the knowledge to the dead, you will be able to cope with such as flow ah ~

My 6 years of interview experience and study notes have been compiled into a **937 page PDF, along with some excellent video tutorials I have watched during my learning progress. ** Upload to my GitHub: Android architecture video +BATJ interview topic PDF+ study notes ** Please help yourself, free to share!

In fact, I have seen many friends complain about their low salary, including the author. The reason is that I did not give the interviewer a good answer in the interview process. Therefore, I will continue to update the problems encountered in the interview process, and I hope that you can progress and learn together with me.