In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article editor for you detailed introduction of "Android5.1 how to install apk to the system by default", the content is detailed, the steps are clear, the details are handled properly, I hope this "Android5.1 how to install apk to the system by default" article can help you solve your doubts, the following follow the editor's ideas slowly in-depth, together to learn new knowledge.
Based on: quick iTOP-4418 development board
10.9.2.1 compile APK into an Android5.1 image
Of course, users can also use the "adb install *. Apk" command to download apk to the development board. But when there are a large number of development boards, it is too tedious to use the adb command each time, so compiling the necessary apk into the Android image will greatly improve your productivity.
As shown in the following figure, there are some default applications in the Android5.1 source directory "device/nexell/s5p6818_drone/apk".
If you want to add more applications, then take ledtest as an example, you just need to create a folder ledtest under the apk file.
Then put ledtest.apk and libled.so into the folder ledtest. Go to the ledtest folder to see the APK of ledtest and the corresponding library files.
As shown in the following figure, the script for installing APK is "device/nexell/s5p6818_drone/device.mk"
First go to the corresponding folder, and then open device.mk.
As shown in the figure below, these two lines of scripts are related to ledtest. First put the ledtest.apk in the corresponding folder
Medium. Second, ledtest needs a library file, which should also be placed in the corresponding folder. (these pieces of code are to be added by yourself.) if it is another APK, you can refer to the script of ledtest.
After the modification, save and exit. Then go to the source directory to compile.
After the source code is compiled, burn the Android5.1 image (including the boot.img kernel image) to the development board
You can see the ledtest application. Then open the ledtest application and click the LED1 ON button to light up
Led on the board, click the LED1 OFF button to turn off the led light on the board.
If the small lamp does not respond, you need to go to the device node permission granted to led, and enter "chmod 777" in the serial console.
/ dev/leds_ctl ", as shown in the following figure.
Use the command "ls-l / dev | grep led" to see the command execute successfully.
Next, you can control the dimming of the led using app.
10.9.2.2 remove the default installation of APK
In the Android5.1 file system, some applications are installed by default and can be removed if they are not needed. Ben
The article takes game 2048 as an example.
The script to install APK is "device/nexell/s5p6818_drone/device.mk"
First go to the corresponding folder, and then open device.mk, as shown in the following figure.
Then find the corresponding content of 2048 and comment it out, as shown in the following figure.
Save and exit, and then go to the source directory to compile.
After the source code has been compiled, burn and write the Android5.1 image (including the boot.img kernel image) to the development board.
To 2048 applications.
10.9.2.3 Modification of Android5.1 device permissions
When Android5.1 invokes the device node of the device kernel driver, it will encounter the problem of no permissions. At this time,
You need to modify the permissions of the device later. The following serial port as an example to introduce, other equipment modification methods are also similar. In
Sometimes there is no permission when operating serial port under Android5.1, so you need to modify the startup script of android5.1.
Modify the permissions of the serial port in it.
Enter in the Android5.1 source directory
"vim device/nexell/s5p6818_drone/init.s5p6818_drone.rc"
The result is shown in the following figure.
Add a command to modify permissions, as shown in the following figure.
The "chmod 0777 xxxx" above is to modify the permissions of the device node. As shown in the figure above, we have modified the
Permissions for ttySAC0, ttySAC1, ttySAC3 device nodes.
In this way, you can also modify the permissions of other device nodes.
Then enter ". / build_android.sh" and start compiling android, as shown in the following figure.
When the compilation is complete, burn the image (including the boot.img kernel image) to the development board and restart android. Enter
Enter the folder dev and use the "ls-l" command to see that the permissions of the serial port have been modified (r-readable, w-writable, x-executable lines).
10.9.2.4 turn on the horizontal and vertical screen switch
The 6818 backplane has a gyroscope. The screen automatically switches horizontally and vertically according to the angle of the board. As shown in the following picture. If you want to fix the screen
The screen direction can be set as follows.
10.9.2.4.1 remove the automatic rotation function (default horizontal screen)
As shown below, enter the command "vi" in the Android source directory
Frameworks/base/core/res/res/values/config.xml "
After modification, run the one-click compilation script ". / build_android.sh", as shown in the following figure.
After the source code is compiled, burn the Android image to the development board, unplug the otg line, and restart the development board.
The system is displayed on horizontal screen by default, and there is no automatic rotation function. As shown in the following picture.
10.9.2.4.2 Vertical display
Based on the previous section, do the following.
As shown below, enter the command "vi frameworks/base/policy/src/com/an" in the Android source directory
Droid/internal/policy/impl/PhoneWindowManager.java ", as shown in the following figure.
Use "/ Surface.ROTATION" inside, and on line 5478, modify the parameters as shown below.
After modification, run the one-click compilation script ". / build_android.sh", as shown in the following figure.
After the source code is compiled, burn the Android image to the development board, unplug the otg line, and restart the development board.
Then the system supports vertical display and can not rotate the screen automatically. As shown in the following picture.
Note that according to the above changes, the logo direction of uboot and kernel is the same. Default horizontal screen.
Read here, this "Android5.1 how to install apk to the system by default" article has been introduced, want to master the knowledge of this article also need to practice and use in order to understand, if you want to know more related articles, welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.