Mr yue   189 1893 5218

Mr Zeng 134 1010 8691

 

mobile phone APP or applet still locate Bluetooth AoA in the background?


question: when APP or applet is in the background, can the mobile phone be used as a beacon terminal for positioning?

below, let's look at it first.2a question:


Question 1: Why is it slower or possible to restart the APP after the APP runs in the background for a period of time?

, from the perspective of the operating system, memory is a data storage area and a resource that can be scheduled by the operating system. In a multi-task (process) OS, memory management is particularly important, and the OS needs to allocate memory resources reasonably for each process. Therefore, the memory management mechanism can be understood from both OS memory and recycling.

allocation mechanism:allocates a reasonable size block of memory for each task (process) to ensure that each process can run normally, while ensuring that the process does not take up too much memory.

recovery mechanism:When the system memory is insufficient, a reasonable recycling and redistribution mechanism is needed to ensure that the new process can run normally. To kill those processes that are occupying memory when recycling, the OS needs to provide a reasonable mechanism for killing processes.

is also a multitasking operating system. Android system has its own method for memory management. There are fewer memory resources on mobile phones than PC, so it needs to manage memory more carefully.

mobile phone OS uses memory in a way of "using it as much as possible". Only when there is not enough memory will other processes be killed to recover enough memory. But the Android system can't just kill a process, it also has a mechanism to kill the process to reclaim memory.. Extension

Android OSkill process:

1.Process Priority

Android the concept of assigning a priority group to each process, the lower the priority group, the greater the probability of being killed. According to the importance of the process, it is divided into 5 levels:

1) foreground process (Foreground process)

the processes necessary for the user's current action. There are usually few foreground processes at any given time. The system will terminate them only as a last resort if there is not enough memory to support them while they continue to run.

2) visible process (Visible process)

a process that does not have any foreground components, but still affects what the user sees on the screen. Visible processes are considered to be extremely important processes, and the system will not terminate these processes unless they must be terminated in order to maintain all foreground processes running at the same time.

3) Service process (Service process)

Although service processes are not directly associated with what the user sees, they typically perform some action that the user cares about (e. g., playing music in the background or downloading data from the network). Therefore, unless there is not enough memory to keep all foreground and visible processes running at the same time, the system will keep the service process running.

4) Background Process (Background process)

background processes have no direct impact on the user experience, the system may terminate them at any time to reclaim memory for use by foreground processes, visible processes, or service processes. usually has many background processes running, so they are saved in the LRU list to ensure that the process containing the user's most recently viewed Activity is terminated last. If a Activity implements the lifecycle method correctly and saves its current state, terminating its process will not have a noticeable impact on the user experience, because when the user navigates back to the Activity, the Activity restores all of its visible state.

5) Empty process

a process that does not have any active application components. The only purpose of keeping this process is to use it as a cache to shorten the startup time required to run the component in it the next time. To keep overall system resources balanced between the process cache and the underlying kernel cache, the system tends to terminate these processes.

usuallycircumstances, the first three processes are not killed.

2. Recovery proceeds

When the Android system starts to kill the processes in the LRU cache, the system determines the recovery benefit after each process is killed. Because Android always tend to kill a process that can reclaim more memory, so that fewer processes can be killed to get more memory. The fewer processes you kill, the less impact you have on the user experience.

problem delayStretch:Why should App comply with memory management mechanism?

In the Android system, App conforming to the memory management mechanism is a win-win process for the Android system and App. Suchfruitevery App follows this rule, the Android system will be smoother, will bring a better user experience, and the App can reside in memory for a longer time.If you really need a lot of memory, you can use multiple processes.

Question 2: Do WeChat applets need to conform to the memory management mechanism?

small program fromis actually a (hybrid) app between web app and native native app. It has rich interfaces for calling various functions of mobile phones, and at the same time has flexibility and cross-platform. Of coursealso need to follow WeChator mobile OSmemory management mechanism.


small program running mechanism:

  • foreground/background status

applet is started, the interface is displayed to the user, and the applet is in the foreground state at this time.

When the user clicks the capsule button in the upper right corner to close the applet, or presses the device the Home key left WeChat, the applet did not completely terminate its operation, but enteredbackground state, the applet can also run for a short period of time.

when the user enters WeChat again or opens the applet again, the applet will enter the foreground from the background. However, if the user does not enter the applet for a long time, or the system resources are tight, the applet may be destroyed, that is, the operation may be completely terminated.

  • applet startup

applet startup can be divided into two situations, one is cold startup and the other is hot startup.

Cold Start:If the user opens it for the first time, or the applet is opened again by the user after being destroyed, the applet needs to be reloaded and started, that is, cold start.

Hot Start:, if the user has already opened a small program and then opens the small program again within a certain period of time, the small program is not destroyed at this time, but only enters the foreground state from the background state, which is a hot start.

  • applet destruction

Usually, only when the applet enters the background for a certain period of time, or the system resources are too high, it will be destroyed. Specifically, it includes the following situations:

1) When the applet enters the background, it can maintain a running state for a short period of time. If it does not enter the foreground within this period of time, the applet will be destroyed.

2) When the small program occupies too much system resources, it may be destroyed by the system or actively recycled by WeChat client.

in iOS, when WeChat client continuously receives system memory alarms within a certain time interval, it will actively destroy small programs according to certain policies and prompt the user 「running out of memory, please reopen the applet」.

final conclusion:

1. Both APP and applets need to follow the memory management mechanism of OS. If you want to keep app or applets running all the time, you must ensure that they are of high priority for a long time.(Front, Visible, Service)process.

2. In the Bluetooth AoA positioning system, the mobile phone uses APP or WeChat applet as the positioning beacon terminal. When the APP or applet is destroyed by the mobile phone system, there is no API interface for calling the mobile phone's Bluetooth broadcast data,certainly can't locate.




Shenzhen Nuclear Core IOT Technology, the first domestic manufacturer to independently develop and mass produce 2.4G AOA/Bluetooth AOA/Bluetooth AOA Plus/high-precision fusion precision positioning base stations and algorithm engines,focuses on the research and development of AoA positioning base stations and positioning algorithms, maintaining the concept of open cooperation and empowering more partners.


Nuclear Core IOT has successfully introduced a number of indoor high-precision positioning equipment based on AoA/AoD algorithm. It is the first manufacturer in China to independently develop mass-produced 2.4G Bluetooth AoA positioning base station and deploy 2.4G Bluetooth AoA plus fusion positioning scheme, leading the research on sub-meter positioning technology based on low-power Bluetooth scheme and the trend of localization of core equipment.welcome more partners to join the AoA positioning ecosystem and seek common development.


Core IOT Technology Product Information Link:

domestic Bluetooth AoA positioning base station factory, the first domestic mass production shipping equipment manufacturers

Core-of-Things officially released to support Apple/Android WeChat applet Bluetooth AOA positioning base station

domestic starting artifact! New generation of long-distance Bluetooth AoA positioning base station

Core IOT Technology Product Application Scene Video Data Link:

Shenzhen Core IOT AoA High Precision Positioning Application Scene Video