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 mainly explains "Android how to make APP self-start when the system is running". Interested friends may wish to take a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to make APP start itself when the system is running" by Android.
Let's first create an empty project called autorun, or you can choose the App project you want to start.
We want app to start automatically after boot, so we need to receive a boot broadcast; so app first needs to register a broadcast about accepting boot And it must be noted that this broadcast must be statically registered, not dynamically registered (this kind of broadcasting must be statically registered, so that applications can still receive boot broadcasts even before they are running. Dynamic broadcasting is not good). First, in AndroidManifest. Add a permission declaration to the xml file because RECEIVE_BOOT_COMPLETED permission is required to receive BOOT_COMPLETED messages. And then through the AndroidManifest. Register a receiver as configured in the xml file, as shown in the following figure.
After statically registering the broadcast, we create a new BootUpReceiver class and do the Activity jump in the onReceive method. The Activity to jump to is the MainActivity of the app program; this completes the requirement.
When we run and install APP, we must pay attention to: after installing demo and letting demo run, shut down the computer first and then start it. In other words, after installing the application and running, be sure to restart the machine, the development board starts up, and finds that APP starts automatically.
At this point, I believe you have a deeper understanding of "Android how to make APP self-boot when the system is running". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.