1. Architecture

iOS:

  1. cocoa Touch layer: including Foundation Framework, UIkit Framework, Address Book UI Framework

  2. Media layer: including image, audio, and video technologies

  3. Core service layer: For example, CoreFoundationframework is an interface set based on C language, providing

Basic data management and service functions of the application: CFNetworkframework is a set of high-performance C language interfaces
A collection that provides an object-oriented abstraction of network protocols. Developers can use the CFNetwork framework to operate the protocol stack and access the underlying structures such as BSDsockets, etc.: Securityframework provides interfaces for managing certificates, public/private key pairs, and trust policies to ensure the security of application data

  1. Core os layer: based on Mac operating system

android

  1. Application program: written in java

  2. Application frame:

Activity Manager: Used to manage the application life cycle and provide common navigation fallback functions
Resource Manager: Provides access to non-code resources such as local strings, graphics, and layout files
Content provider: used to store and retrieve data and use this data to be accessible by all applications
XMPP Server: An XML-Based Network Real-time Communication Protocol

  1. System runtime library + Android runtime

System runtime library: android includes some c/c++ libraries, which can be used by different components in the android system, such as libc is a standard c system function library inherited from BSD: webkit is the web browser engine
Support Android browser (the engine of Apple Safari is also webkit). SQLite is a powerful lightweight
Relational database engine (this database engine is also used by iOS).

Android runtime: including the core library (basic class library, such as datastructurenetworkfile
system, etc.), many implementation codes come from the ApacheHarmony project, the main purpose is to ensure that the class library of the virtual machine can be compatible with the JavaSE class library to the greatest extent) and the Dalvik virtual machine (used to run dex:dalvik executable format binary executable files, the The biggest difference between the virtual machine and the java virtual machine is that Dalvik is based on registers)

  1. linux kernel: based on linux2.6 kernel

2. Operation mechanism: sandbox operation and virtual machine operation mechanism

The reason why Android phones freeze is mainly caused by defects in the operating mechanism of the system, and the operating mechanism of the iOS system is quite different from that of Android.
iOS adopts a sandbox operation mechanism. Each application runs in an independent and safe sandbox. There is no interference between APPs, and the operation efficiency is fast and stable. Netizens refer to it as “tombstone mechanism”.
Android uses a virtual machine operating mechanism, and programs can access each other. It takes up a lot of memory and consumes quickly, and it is easy to generate junk files. In this case, the phone will get stuck more and more.

3. Background operation mechanism:

Android articles

  1. After the APP enters the background, it will continue to run and continue to receive information. Unless the background is turned off to prevent the app from running, some apps are still running even if the background is turned off!

  2. Disadvantages: power consumption, occupying valuable system running memory. If the memory is full, it will cause lag. The running memory is only so big in total, and it depends on the system to allocate it to whoever it is. (The main reason for the freeze in the early years of Android was due to memory fragmentation and imperfect memory allocation mechanism)

  3. Advantages: True background, even if it is separated from the Google server, as long as it is still running in the background, it can still receive messages. As long as you don’t close it, these tasks will always run normally in the background; the advantage is that receiving information and sending data is faster than the fake background. But the memory size has an upper limit. When it reaches the critical value, it will still kill the background (memory recycling)

Ios article

  1. After the Apple APP enters the background, it stops running, and the APP relies on the Apple server to receive information. (Apple background belongs to the tombstone mechanism, that is, fake background)

  2. Disadvantages: The APP does not stay in the background, and it is not easy to use when switching between multiple tasks. The program will be suspended when it enters the background. If the APP crashes, it means that the running memory is insufficient! The system will automatically recycle the memory. (Software incompatibility or compatibility problems will also flash back)

  3. Advantages: There is no need to clean the background frequently, and the program will stop running the moment it enters the background. And it will not happen that many APPs will grab CPU resources, and more CPU resources can be allocated to the current APP for use. The Apple background card does not need to be cleaned up, because the application is suspended, click the card again, and it will continue to run from where you left off. (Interrupt response, understand?) After the card is cleared, you click the APP again to reload, but it consumes more power. Unless the APP crashes, there is no need to clean the background. But if the APP is not started again in the background for a long time, it will still be directly killed by the system, and the part of the memory it occupies will be released. (Apple has introduced the active background from iOS7, allowing some background to reside)

4. Priority of screen commands:

iOS has the highest priority for screen response, and its response order is Touch–Media–Service–Core architecture. In other words, when the user touches the screen, the system will give priority to processing the screen display. That is, the Touch level, followed by Media, Service and Core architecture.

The priority response level of the Android system is the Application–Framework–Library–Kernal architecture, and the display-related graphics and image processing part belongs to the Library, you can see that it is the third place, when you touch the screen The Android system activates the application first, then the framework, then the screen, and finally the core architecture.

5. Desktop:

The Android system can set its own desktop according to its own preferences, while the ios only has a monotonous desktop.

6. Version protection difference:

  1. iOS

Appstore, using FairPlayDRM to protect store download apps

2.Android

(1) google play store, using Android License Verification Library to protect the store to download applications
(2)Amazon Appstore DRM
(3) Others