Android 11 Set landscape display on the default system. _android fixed landscape display

There are two solutions to implement the default horizontal screen: First method: Directory device/rockchip/rk356x/BoardConfig.mk SF_PRIMARY_DISPLAY_ORIENTATION := 90 Second way: The Android system displays vertical screen by default. If you want to complete horizontal screen display, follow the following steps to configure the function: Modify in the directory frameworks/base/cmds/bootanimation/BootAnimation.cpp // create the native surface sp control…

Read More

ota_update

Foreword: Three upgrade methods First, classify Android upgrades into categories, namely Non-A/B system updates A/B (seamless) system updates Virtual A/B upgrade (Virtual A/B overview) Non-A/B System Updates The official website documents are as follows: https://source.android.com/docs/core/ota/nonab?hl=zh-cn Non-A/B upgrade is the traditional Android system update method. The system updates the system image file during operation, and after…

Read More

In-depth analysis of Android Service (6) (End)

Article Directory In-depth Analysis of Android Service (End) 1. Service Lifecycle Management 2. Service lifecycle approach 2.1 onCreate() 2.2 onStartCommand(Intent intent, int flags, int startId) 2.3 onBind(Intent intent) 2.4 onUnbind(Intent intent) 2.5 onRebind(Intent intent) 2.6 onDestroy() 3. Service Restart Policy 4. Use Service for foreground tasks 5. Implementing the Foreground Service Example 5.1 Create Front…

Read More

In-depth analysis of Android BroadcastReceiver (4)

Article Directory In-depth Analysis of Android Broadcast Receiver (4) 1. In-depth optimization and application of broadcast receiver 1.1 Applications with high real-time requirements 1.1.1 Example: Handling the Headphone Plug and Unplug Event in the Music Player 1.1.2 Dynamic Registration Receiver 1.2 handle time consuming operation 1.2.1 Example: Using \ IntentService\ to handle time-consuming operations 1.3…

Read More

In-depth analysis of Android BroadcastReceiver (8)

Article Directory In-depth Analysis of Android Broadcast Receiver (8) 1. System and Custom Implementation 1.1 System broadcast mechanism 1.1.1 Implementation principle of system broadcasting 1.1.2 Source code analysis of system broadcasting 1.2 Custom broadcast mechanism 1.2.1 Implementation steps of custom broadcast 1.2.2 Source Code Analysis of Custom Broadcast 2. The original intention and advantages of…

Read More

In-depth analysis of Android BroadcastReceiver (7)

Article Directory In-depth Analysis of Android Broadcast Receiver (7) 1. Advanced application scenarios 1.1 Example: Dynamic Permission Request 1.2 Example: In-app notification update 2. Security and performance optimization 2.1Example: Setting Permissions to Prevent Broadcast Attacks 2.2 Example: Using the Local Broadcast Manager 2.3 Example: Registering and unregistering a broadcast receiver in the life cycle 3.…

Read More

Compile Android14 source code for Raspberry Pi 5

Compiling Android 14 source code for Raspberry Pi 5 1. Hardware and software requirements Official recommended configuration: Ubuntu 22.04 Virtual Machine Memory is 16GB minimum The minimum disk size is 360 GB 2. Install dependent tools Official document: https://source.android.google.cn/docs/setup/start/initializing?hl=zh-cn. sudo apt install git-core gnupg flex bison build-essential zip curl zlib1g-dev libc6-dev-i386 libncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev…

Read More

Scrcpy: Master your Android device

Scrcpy: Mastering Your Android Device This article will introduce the Scrcpy tool, which is a powerful Android device control tool that can achieve screen mirroring, operation control and other functions. We’ll explore the basics of Scrcpy and how it works, as well as how to connect and control Android devices with Scrcpy. In addition, we…

Read More

productFlavors Android product flavor customization, multi-channel packaging configuration, application slimming

Android gradle provides productFlavors, which allows developers to customize and distinguish multiple product flavors. Common functions include configuring multiple channels, specifying different dimensions, specifying custom parameter strings, and specifying signatures. Step 1: Usually, we need to preset the dimensions required by the product in the build. Gradle under the app in advance //flavor(Product flavor)Configuration flavorDimensions…

Read More