APN network application method and device in Android environment and medium

By building an APN network model and dynamic registration mode in an Android environment, using broadcast components to monitor network status changes and generate a boot strategy, the problem of complex settings of the private network APN network and affecting the mobile phone data network is solved, real-time monitoring and boot settings are realized. Improved user experience.

CN119402865AActive Publication Date: 2025-02-07山东浪潮智水数字科技有限公司 +1
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411741696.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-02-07
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

How to monitor and guide the private network APN network in real time to solve the problems that users have complex settings and affect mobile phone data network.

Method used

Build an APN network model in an Android environment, obtain permissions through dynamic registration mode, use broadcast components to monitor network status changes, generate network identifiers, and compare preset boot sets based on device model and network identifiers, generate boot policies, and remind users to switch networks. .

Benefits of technology

Real-time monitoring and guidance settings for the private network APN network are realized, which simplifies the user setting process, avoids the impact of network switching on the mobile phone data network, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402865A_ABST
    Figure CN119402865A_ABST
Patent Text Reader

Abstract

The invention discloses an APN network application method and device in an Android environment and a medium, and belongs to the technical field of network access. The method comprises the following steps: constructing an APN network model, and accessing a preset application; determining the model of the Android terminal, and sending a permission application according to the model to complete a dynamic registration mode; the method comprises the following steps of: constructing a Network Changed Receiver on the basis of a broadcast component in an Android system, and monitoring the network state change of an Android end on the basis of the Network Changed Receiver; the method comprises the following steps: establishing an Activity parent class Networking Activity, acquiring a callback event of a network state change of an Android end based on a preset Networking interface, and acquiring current network information of the Android end to generate a network identifier of the Android end; comparing a preset guide set according to the network identifier and the model to generate a guide strategy; and when the application corresponding to the Android end is in the background, reminding a user of the Android end to switch the network. According to the method, the effects of real-time monitoring and guide setting on the private network APN are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of network access, and in particular to an APN network application method, device and medium in an Android environment. Background Art

[0002] With the advent of the mobile Internet era, mobile office applications have gradually become popular. How to achieve efficient mobile office while taking into account internal data security has become a major problem for some governments, enterprises and institutions. At present, opening an APN network dedicated line is a relatively safe way. It only requires deploying servers, databases and other resources on the intranet, and then using the operator to deploy a dedicated line access to meet the mobile terminal's access to services and resources.

[0003] However, dedicated APN access requires users to frequently set up the mobile network and configure proxy, port, account password and other information. It is more complicated to use, and connecting to the private network APN will affect the current use of the mobile data network.

[0004] Therefore, how to conduct real-time monitoring and guidance setting of private APN network has become an urgent problem to be solved. Summary of the invention

[0005] The embodiments of the present application provide an APN network application method, device and medium in an Android environment to solve the following technical problem: how to monitor and guide the setting of a private APN network in real time.

[0006] In the first aspect, an embodiment of the present application provides an APN network application method in an Android environment, the method comprising: constructing an APN network model and accessing a preset application; wherein the application is in an Android environment; determining the device model of the Android device, and sending a permission application based on the device model to complete a dynamic registration mode; constructing a NetworkChangedReceiver based on a broadcast component under the Android system, and monitoring network status changes of the Android device based on the NetworkChangedReceiver; constructing an Activity parent class NetworkBaseActivity, and obtaining callback events of network status changes of the Android device based on a preset networkevent interface, and obtaining the current network information of the Android device to generate a network identifier of the Android device; comparing a preset boot set based on the network identifier and the device model to generate a boot strategy; and when the application corresponding to the Android device is in the background, reminding the user of the Android device to switch networks.

[0007] In one implementation of the present application, the model of the Android terminal is determined, and a permission application is sent according to the model to complete the dynamic registration mode, specifically including: obtaining the device model of the Android terminal based on the Build class of the Android terminal; wherein the device model includes the manufacturer, code and update version; comparing the preset application information according to the device model to determine the list of system permissions that need to be applied for; dynamically applying for the required permissions based on the ActivityCompat class or ContextCompat class of the Android terminal; when the application is approved, completing the dynamic registration mode.

[0008] In one implementation of the present application, a NetworkChangedReceiver is constructed based on the broadcast component under the Android system, and the network status changes of the Android end are monitored based on the NetworkChangedReceiver, specifically including: calling the broadcast component under the Android system to construct a NetworkChangedReceiver, and setting the broadcast interception intent filter ConnectivityManager.CONNECTIVITY_ACTION in the NetworkChangedReceiver; displaying the NetworkEvent interface based on the NetworkChangedReceiver; registering the NetworkChangedReceiver to the Android end based on dynamic registration to receive the network status changes of the Android end.

[0009] In one implementation of the present application, an Activity parent class NetworkBaseActivity is constructed, and based on a preset NetworkEvent interface, a callback event of a network status change of the Android end is obtained, and the current network information of the Android end is obtained to generate a network identifier of the Android end, specifically including: connecting the NetworkEvent interface based on the Activity parent class NetworkBaseActivity, and obtaining a network change callback event based on the NetworkEvent interface; determining the network connection information based on the network change callback event; generating a network identifier based on the obtained network connection information to reflect the current network status; wherein the network identifier includes WiFi and mobile network.

[0010] In one implementation of the present application, the method also includes: when submitting page data, turning off the network identification and identifying the network status; if the network status is normal, submitting the page data to a preset server; if the network is abnormal or the page data submission fails, submitting the page data to a preset SQLlite database and marking the page data as data to be submitted; when the network status is normal, uploading the data to be submitted in the SQLlite database to the server.

[0011] In one implementation of the present application, a preset boot set is compared according to the network identifier and the model to generate a boot strategy, specifically including: constructing the boot set; wherein the boot set includes multiple boot strategies; when the network identifier changes, according to the current network identifier and the model, the corresponding boot strategy is searched and displayed in the boot set; wherein, when the network identifier is WiFi, the WiFi connection is closed based on the preset WifiManager class, and the user is guided to open the mobile network based on the boot strategy; when the network identifier is a mobile network, all access point information and mobile phone card operator information of the user in the user's mobile phone are obtained, and it is determined whether the operator has a dedicated APN access point; if there is a dedicated APN access point, the user is guided to select the corresponding APN option based on the boot strategy; when it is impossible to jump to the APN addition page, the user is guided to add a new APN access point based on the boot strategy.

[0012] In one implementation of the present application, when the application corresponding to the Android end is in the background, the user of the Android end is reminded to switch networks, specifically including: connecting to the Application.ActivityLifecycleCallbacks interface preset on the Android end to monitor the life cycle of all Activities; when all Activities enter the onPause or onStop state, it is determined that the application has entered the background; based on the guidance strategy, the user is reminded to switch to a normal network; wherein the normal network includes WiFi or a mobile network.

[0013] In one implementation of the present application, the method also includes: when the page enters the visible state callback method, performing a NetworkChangedReceiver broadcast registration, and comparing the boot set according to the network identifier and the device model to generate a boot strategy; when the page is no longer in the visible state callback method, canceling the NetworkChangedReceiver broadcast registration.

[0014] In one implementation of the present application, when the application corresponding to the Android end is in the background, the user of the Android end is reminded to switch networks, specifically including: connecting to the Application.ActivityLifecycleCallbacks interface preset on the Android end to monitor the life cycle of all Activities; when all Activities enter the onPause or onStop state, it is determined that the application has entered the background; based on the guidance strategy, the user is reminded to switch to a normal network; wherein the normal network includes WiFi or a mobile network.

[0015] In one implementation of the present application, the method also includes: when the page enters the visible state callback method, performing a NetworkChangedReceiver broadcast registration, and comparing the boot set according to the network identifier and the device model to generate a boot strategy; when the page is no longer in the visible state callback method, canceling the NetworkChangedReceiver broadcast registration.

[0016] In a second aspect, an embodiment of the present application further provides an APN network application device in an Android environment, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: construct an APN network model and access a preset application; wherein the application is in an Android environment; determine the model of the Android terminal, and send a permission application based on the model to complete a dynamic registration mode; construct a NetworkChangedReceiver based on the broadcast component under the Android system, and listen to changes in the network status of the Android terminal based on the NetworkChangedReceiver; construct an Activity parent class NetworkBaseActivity, and obtain a callback event of a change in the network status of the Android terminal based on a preset networkevent interface, and obtain the current network information of the Android terminal to generate a network identifier of the Android terminal; compare the preset guidance set based on the network identifier and the model to generate a guidance strategy; when the application corresponding to the Android terminal is in the background, remind the user of the Android terminal to switch networks.

[0017] In the third aspect, the embodiment of the present application also provides a non-volatile computer storage medium of an APN network application in an Android environment, storing computer executable instructions, and the computer executable instructions are set to: construct an APN network model and access a preset application; wherein the application is in an Android environment; determine the model of the Android end, and send a permission application based on the model to complete the dynamic registration mode; construct a NetworkChangedReceiver based on the broadcast component under the Android system, and listen to the network status changes of the Android end based on the NetworkChangedReceiver; construct an Activity parent class NetworkBaseActivity, and obtain the callback event of the network status change of the Android end based on the preset networkevent interface, and obtain the current network information of the Android end to generate the network identification of the Android end; compare the preset boot set according to the network identification and the model to generate a boot strategy; when the application corresponding to the Android end is in the background, remind the user of the Android end that he can switch networks.

[0018] The embodiments of the present application provide an APN network application method, device, and medium in an Android environment, which at least include the following technical effects: By building an APN network model and connecting to preset applications in the Android environment, the applications can communicate using specific network access points, effectively protecting the data within the applications.

[0019] By determining the model of the Android terminal, corresponding permission applications can be sent for different models of devices, thereby completing the dynamic registration mode, improving the compatibility and flexibility of the application, and ensuring that the application can run normally on different models of Android devices and obtain the necessary permissions.

[0020] By using the broadcast component (BroadcastReceiver) under the Android system to build a NetworkChangedReceiver, you can monitor the network status changes on the Android side in real time, so that the application can respond to changes in the network status in a timely manner, such as network connection, disconnection or switching, and perform corresponding processing.

[0021] By constructing the Activity parent class NetworkBaseActivity and obtaining callback events of network status changes based on the preset networkevent interface, the current network information of the Android side can be obtained. This information can be used to generate the network identifier of the Android side, and then used for subsequent network management and optimization.

[0022] According to the generated network identifier and Android model, by comparing with the preset guidance set, the corresponding guidance strategy can be generated. When the corresponding application on the Android side is in the background, if the network status changes or needs to be optimized, the Android user can be reminded to switch networks, which helps to improve the user experience and enable real-time monitoring and guidance settings of the private network APN network. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 A flowchart of an APN network application method in an Android environment provided by an embodiment of the present application; Figure 2 A schematic diagram of the internal structure of an APN network application device in an Android environment provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0025] The embodiments of the present application provide an APN network application method, device and medium in an Android environment to solve the following technical problem: how to monitor and guide the setting of a private APN network in real time.

[0026] The technical solution proposed in the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0027] Figure 1 The present invention provides an APN network application flow chart in an Android environment. Figure 1 As shown, an APN network application method in an Android environment provided by an embodiment of the present application specifically includes the following steps: Step 1: Build an APN network model and access a preset application; wherein the application is in an Android environment.

[0028] APN network model: used to access preset applications to achieve the effect of APN access. The specific implementation method is described in detail in the subsequent steps.

[0029] Preset applications: These applications are usually internal mobile applications of governments, enterprises and institutions. Since some internal data must be kept confidential, they cannot be directly exposed to the Internet for use.

[0030] Step 2: Determine the device model of the Android terminal, and send a permission application according to the device model to complete the dynamic registration mode.

[0031] First, the device model of the Android terminal is obtained based on the Build class of the Android terminal; wherein the device model includes the manufacturer, code and update version. In Android development, the Build class is a static inner class that contains information about the device build. By accessing various properties of the Build class, such as MANUFACTURER, MODEL and VERSION.RELEASE, the manufacturer, code and update version of the Android operating system can be obtained.

[0032] Furthermore, the preset application information is compared according to the device model to determine the list of system permissions that need to be applied for. Different device models may require different system permissions. For example, some devices may have specific hardware functions (such as NFC, fingerprint recognition, etc.) that require additional permissions to access. In an embodiment of the present application, the preset application information (this implementation is to set a configuration file to associate the device model with the required permissions) is used to determine which system permissions the current device needs to apply for.

[0033] Furthermore, the required permissions are dynamically applied based on the ActivityCompat class or ContextCompat class on the Android side. In Android 6.0 (API level 23) and higher, a dynamic permission application mechanism is introduced. Therefore, the application must request permissions at runtime, not at installation time. Therefore, using the requestPermissions method in the ActivityCompat class or ContextCompat class, you can dynamically apply for permissions from the user, which will not be described in detail here.

[0034] Furthermore, when the application is approved, the dynamic registration mode is completed.

[0035] When the user responds to the permission request (whether agreeing or denying), the system calls the onRequestPermissionsResult method of the activity to process the user's response. If the permission is granted, the function that requires the permission can continue to execute.

[0036] Understandably, if permission is denied, explain to the user why the permission is needed and provide a path to guide the user to manually enable the permission.

[0037] Step 3: construct a NetworkChangedReceiver based on the broadcast component under the Android system, and monitor the network status changes of the Android end based on the NetworkChangedReceiver.

[0038] First, call the broadcast component under the Android system to build NetworkChangedReceiver and set the broadcast interception intent filter ConnectivityManager.CONNECTIVITY_ACTION in NetworkChangedReceiver. In the Android system, the broadcast component is a mechanism that allows applications to send and receive application or system level events. NetworkChangedReceiver is a custom broadcast receiver used to monitor changes in network status, so create a class that inherits from BroadcastReceiver and implement the onReceive method in it.

[0039] Intent filters are used to specify which broadcasts a broadcast receiver should receive. In NetworkChangedReceiver, set an intent filter to intercept broadcasts related to network status changes. ConnectivityManager.CONNECTIVITY_ACTION is a system broadcast that the system automatically sends when the network status (such as connected or disconnected) changes. By setting this intent filter in NetworkChangedReceiver, you can ensure that the receiver can receive these network status change broadcasts.

[0040] Furthermore, the NetworkEvent interface is displayed based on the NetworkChangedReceiver. The NetworkEvent interface is a custom interface used to define callback methods related to network status changes. By having the NetworkChangedReceiver implement this interface, when the receiver receives a broadcast of network status changes, the methods in the interface can be called to handle these changes.

[0041] Furthermore, NetworkChangedReceiver is registered to the Android terminal based on a dynamic registration method to receive changes in the network status of the Android terminal.

[0042] Dynamically registering NetworkChangedReceiver ensures that the receiver can receive broadcasts of all network status changes that occur during application execution and handle these changes in a timely manner.

[0043] Step 4: construct the Activity parent class NetworkBaseActivity, and obtain the callback event of the network status change of the Android terminal based on the preset networkevent interface, and obtain the current network information of the Android terminal to generate the network identifier of the Android terminal.

[0044] First, the NetworkEvent interface is connected based on the Activity parent class NetworkBaseActivity, and the network change callback event is obtained based on the NetworkEvent interface. In Android development, an Activity is a separate screen of an application that contains a user interface. NetworkBaseActivity is a custom Activity parent class, which means that other Activities can inherit from it to share some common network processing logic.

[0045] The NetworkEvent interface defines callback methods related to network status changes. NetworkBaseActivity can receive notifications of network status changes by connecting to the NetworkEvent interface. When the network status changes, the methods of the NetworkEvent interface will be called to obtain the changes in the network status.

[0046] Furthermore, network connection information is determined based on the network change callback event.

[0047] In the callback method of the NetworkEvent interface, NetworkBaseActivity can obtain detailed information about the network status change. This information may include network type (such as WiFi, mobile network), network status (such as connected, disconnected), network strength, etc. By parsing this information, NetworkBaseActivity can determine the current network connection information.

[0048] Furthermore, based on the acquired network connection information, a network identifier is generated to reflect the current network status; wherein the network identifier includes WiFi and mobile network.

[0049] The network ID is a string or identifier used to identify the current network status.

[0050] NetworkBaseActivity generates an identifier that accurately reflects the current network status based on the network connection information obtained from the NetworkEvent interface. The identifier can be used for application logic judgment, user interface updates, etc.

[0051] For example, if the current connection is to a WiFi network, NetworkBaseActivity can generate a string identified as "WiFi"; if the connection is to a mobile network, a string identified as "mobile network" can be generated.

[0052] When submitting page data, turn off the network identification and identify the network status; if the network status is normal, submit the page data to the preset server; if the network is abnormal or the page data submission fails, submit the page data to the preset SQLlite database and mark the page data as data to be submitted. When the network status is normal, upload the data to be submitted in the SQLlite database to the server.

[0053] Before submitting the page data, first close the network identifier that was previously used to reflect the current network status. This is because the process of submitting data requires a new network request, and the old network identifier may no longer be accurate or relevant.

[0054] After turning off the network logo, immediately identify the current network status, which is divided into normal (i.e. the device is connected to the Internet) and abnormal (i.e. the device is not connected to the Internet or the connection is unstable).

[0055] If the network status is identified as normal, the page data is directly submitted to the preset server.

[0056] If the network status is abnormal, or the page data submission fails due to other reasons (such as server response error), the page data will be submitted to the preset SQLite database. When submitting to the database, the page data will be marked as pending data so that it can be resubmitted later when the network status is restored.

[0057] When the network status returns to normal, check whether there is data to be submitted in the SQLite database. If there is, then upload this data to the server. Once the data is successfully uploaded to the server and a confirmation response is received from the server, the data can be deleted from the SQLite database to avoid repeated submission or data redundancy.

[0058] Step 5: Compare the preset boot set according to the network identifier and the device model to generate a boot strategy.

[0059] First, the boot set is constructed; wherein the boot set includes multiple boot strategies. The boot set is a collection of multiple boot strategies. These strategies are formulated according to different network conditions, device models and user needs. The boot strategy may include how to connect to WiFi, how to switch network types, how to configure APN (Access Point Name), etc.

[0060] Furthermore, when the network identifier changes, the corresponding guidance strategy is searched and displayed in the guidance set according to the current network identifier and the model. The specific steps are described by A1 to A4: A1. When the network type is WiFi, the WiFi connection is closed based on the preset WifiManager class, and the user is guided to open the mobile network based on the guidance strategy. When the network type is WiFi, WiFi needs to be closed and switched to the mobile network. The preset WifiManager class will be used to close the WiFi connection, and the user will be shown how to open the mobile network according to the guidance strategy. It can be understood that the guidance strategy is displayed according to the device model. The same is true for A2 to A4.

[0061] A2. When the network identifier is a mobile network, obtain all access point information and mobile phone card operator information of the user in the user's mobile phone, and determine whether the operator has a dedicated APN access point. When the network type is a mobile network, obtain the current network operator information and mobile phone card operator information.

[0062] A3. If there is a dedicated APN access point, guide the user to select the corresponding APN based on the guidance strategy. If the operator has a dedicated APN access point, guide the user to select the correct APN based on the guidance strategy. For example, display an interface containing a list of available APNs and let the user make a selection.

[0063] A4. When the page cannot be redirected to the APN add page, the user is guided to add a new APN access point based on the guidance policy. If the page cannot be redirected to the APN add page for some reason (for example, system setting restrictions), the user is guided to manually add a new APN access point based on the guidance policy. For example, detailed step-by-step instructions or graphic tutorials are provided to help the user complete the configuration.

[0064] Step 6: When the application corresponding to the Android terminal is in the background, remind the user of the Android terminal to switch networks.

[0065] First, connect the Application.ActivityLifecycleCallbacks interface preset on the Android side to monitor the life cycle of all Activities. Application.ActivityLifecycleCallbacks is an interface provided by Android that allows applications to monitor the life cycle events of all Activities. By implementing this interface, you can obtain changes in the life cycle state of Activity, such as creation, start, pause, and stop. When the application is connected to the Application.ActivityLifecycleCallbacks interface, it can monitor the life cycle changes of all Activities. This includes onPause and onStop states, which usually indicate that the Activity is losing or has lost the user's focus and may enter the background.

[0066] Furthermore, when all Activities enter the onPause or onStop state, it is determined that the application has entered the background.

[0067] Further, based on the guidance strategy, the user is reminded to switch to a normal network; wherein the normal network includes WiFi or a mobile network. Once it is determined that the application has entered the background, the system will decide whether to remind the user to switch networks based on the guidance strategy previously formulated. The normal network refers to WiFi or a mobile network.

[0068] At the same time, in order to prevent APN from affecting the normal use of users to a certain extent, the following methods are also included: When the page enters the visible state callback method, NetworkChangedReceiver broadcast registration is performed, and the guidance set is compared according to the network identifier and the device model to generate a guidance strategy. When a page of the application enters the user-visible state, the system triggers the corresponding callback method. In the callback method, the application performs a broadcast registration of NetworkChangedReceiver. The application then begins to monitor changes in the network status so that it can respond in time when network conditions change. Further, according to the current network identifier (such as WiFi, mobile network, etc.) and device model, the preset guidance set is compared to generate an appropriate guidance strategy. This guidance strategy may include how to configure APN, how to switch network types, etc., to ensure that users can use the application normally under the current network conditions.

[0069] When the page is no longer visible in the callback method, the NetworkChangedReceiver broadcast registration is canceled. When the application's page is no longer visible to the user (for example, the user switches to another application or closes the current page), another callback method is triggered. In this callback method, the application cancels the NetworkChangedReceiver broadcast registration, and the application no longer needs to monitor changes in network status because the user is not currently interacting with the application.

[0070] Canceling broadcast registration can reduce the resource consumption of the application, avoid unnecessary background processing, and also avoid displaying notifications or reminders related to network changes when the user does not need them.

[0071] The above is an embodiment of the method proposed in this application. Based on the same inventive concept, this application embodiment also provides an APN network application device in an Android environment, whose structure is as follows: Figure 2 shown.

[0072] Figure 2 The following is a schematic diagram of the internal structure of an APN network application device in an Android environment provided by an embodiment of the present application. Figure 2 As shown, the device includes: at least one processor 201; and, a memory 202 communicatively connected to the at least one processor; The memory 202 stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor 201 to enable at least one processor 201 to: Build an APN network model and connect to the preset application; determine the model of the Android end, and send a permission application based on the model to complete the dynamic registration mode; build a NetworkChangedReceiver based on the broadcast component under the Android system, and listen to the network status changes of the Android end based on NetworkChangedReceiver; build the Activity parent class NetworkBaseActivity, and obtain the callback event of the network status change of the Android end based on the preset networkevent interface, and obtain the current network information of the Android end to generate the network identification of the Android end; compare the preset guidance set according to the network identification and model to generate a guidance strategy; when the corresponding application of the Android end is in the background, remind the user of the Android end to switch networks.

[0073] Some embodiments of the present application provide corresponding Figure 1 A non-volatile computer storage medium of an APN network application in an Android environment stores computer executable instructions, and the computer executable instructions are set as follows: Build an APN network model and connect to the preset application; determine the model of the Android end, and send a permission application based on the model to complete the dynamic registration mode; build a NetworkChangedReceiver based on the broadcast component under the Android system, and listen to the network status changes of the Android end based on NetworkChangedReceiver; build the Activity parent class NetworkBaseActivity, and obtain the callback event of the network status change of the Android end based on the preset networkevent interface, and obtain the current network information of the Android end to generate the network identification of the Android end; compare the preset guidance set according to the network identification and model to generate a guidance strategy; when the corresponding application of the Android end is in the background, remind the user of the Android end to switch networks.

[0074] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the IoT device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0075] The system and medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the system and medium also have similar beneficial technical effects to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the system and medium will not be repeated here.

[0076] Those skilled in the art will appreciate that the embodiments of the present application may provide methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0077] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.

[0078] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0080] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0081] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0082] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0083] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device that includes the elements.

[0084] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. An APN network application method in an Android environment, characterized in that: The method comprises: Construct an APN network model and access a preset application; wherein the application is in an Android environment; Determine the device model of the Android terminal, and send a permission application according to the device model to complete the dynamic registration mode; Constructing a NetworkChangedReceiver based on the broadcast component under the Android system, and monitoring the network status changes of the Android terminal based on the NetworkChangedReceiver; Construct the Activity parent class NetworkBaseActivity, and obtain the callback event of the network status change of the Android terminal based on the preset networkevent interface, and obtain the current network information of the Android terminal to generate the network identifier of the Android terminal; Comparing a preset boot set according to the network identifier and the device model to generate a boot strategy; When the application corresponding to the Android terminal is in the background, the user of the Android terminal is reminded to switch networks.

2. According to the APN network application method in an Android environment according to claim 1, it is characterized in that: Determine the model of the Android terminal and send a permission application according to the model to complete the dynamic registration mode, specifically including: Obtaining the device model of the Android terminal based on the Build class of the Android terminal; wherein the device model includes the manufacturer, code and update version; Compare the preset application information according to the device model to determine the list of system permissions that need to be applied for; Dynamically apply for the required permissions based on the ActivityCompat class or ContextCompat class on the Android side; When the application is approved, the dynamic registration mode is completed.

3. According to the APN network application method in an Android environment as described in claim 1, it is characterized in that: Building a NetworkChangedReceiver based on the broadcast component under the Android system, and monitoring the network status changes of the Android terminal based on the NetworkChangedReceiver, specifically including: Call the broadcast component under the Android system to build a NetworkChangedReceiver, and set the broadcast interception intent filter ConnectivityManager.CONNECTIVITY_ACTION in the NetworkChangedReceiver; Display the NetworkEvent interface based on the NetworkChangedReceiver; The NetworkChangedReceiver is registered to the Android end based on a dynamic registration method to receive the network status changes of the Android end.

4. The APN network application method in an Android environment according to claim 1, characterized in that: Construct the Activity parent class NetworkBaseActivity, and obtain the callback event of the network status change of the Android terminal based on the preset NetworkEvent interface, and obtain the current network information of the Android terminal to generate the network identifier of the Android terminal, specifically including: Connecting the NetworkEvent interface based on the Activity parent class NetworkBaseActivity, and obtaining a network change callback event based on the NetworkEvent interface; Determine network connection information based on the network change callback event; According to the acquired network connection information, a network identifier is generated to reflect the current network status; wherein the network identifier includes WiFi and mobile network.

5. The APN network application method in an Android environment according to claim 4, characterized in that: The method further comprises: When submitting page data, closing the network identification and identifying the network status; If the network status is normal, the page data will be submitted to the preset server; If the network is abnormal or the page data submission fails, the page data is submitted to the preset SQLlite database and marked as data to be submitted; When the network status is normal, the data to be submitted in the SQLlite database is uploaded to the server.

6. The APN network application method in an Android environment according to claim 5, characterized in that: Comparing a preset boot set according to the network identifier and the model to generate a boot strategy, specifically including: Constructing the guidance set; wherein the guidance set includes multiple guidance strategies; When the network identifier changes, according to the current network identifier and the model, the corresponding boot strategy is searched in the boot set and displayed; Wherein, when the network identifier is WiFi, the WiFi connection is closed based on the preset WifiManager class, and the user is guided to open the mobile network based on the guidance strategy; When the network identifier is a mobile network, all access point information and mobile phone card operator information of the user in the user's mobile phone are obtained, and it is determined whether the operator has a dedicated APN access point; If there is a dedicated APN access point, guiding the user to select a corresponding APN option based on the guidance strategy; When the user cannot be redirected to the APN adding page, the user is guided to add a new APN access point based on the guidance policy.

7. The APN network application method in an Android environment according to claim 1, characterized in that: When the application corresponding to the Android terminal is in the background, reminding the user of the Android terminal to switch networks, specifically including: Connect to the Android-preset Application.ActivityLifecycleCallbacks interface to monitor the lifecycle of all Activities; When all Activities enter the onPause or onStop state, it is determined that the application has entered the background; Based on the guidance strategy, the user is reminded to switch to a normal network; wherein the normal network includes WiFi or a mobile network.

8. The APN network application method in an Android environment according to claim 1, characterized in that: The method further comprises: When the page enters the visible state callback method, NetworkChangedReceiver broadcast registration is performed, and the boot set is compared according to the network identifier and the device model to generate a boot strategy; When the page is no longer in the visible state, the callback method cancels the NetworkChangedReceiver broadcast registration.

9. An APN network application device in an Android environment, characterized in that: The device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: Construct an APN network model and access a preset application; wherein the application is in an Android environment; Determine the model of the Android terminal, and send a permission application according to the model to complete the dynamic registration mode; Constructing a NetworkChangedReceiver based on the broadcast component under the Android system, and monitoring the network status changes of the Android terminal based on the NetworkChangedReceiver; Construct the Activity parent class NetworkBaseActivity, and obtain the callback event of the network status change of the Android terminal based on the preset networkevent interface, and obtain the current network information of the Android terminal to generate the network identifier of the Android terminal; Comparing a preset boot set according to the network identifier and the model to generate a boot strategy; When the application corresponding to the Android terminal is in the background, the user of the Android terminal is reminded to switch networks.

10. A non-volatile computer storage medium for an APN network application in an Android environment, storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Construct an APN network model and access a preset application; wherein the application is in an Android environment; Determine the model of the Android terminal, and send a permission application according to the model to complete the dynamic registration mode; Constructing a NetworkChangedReceiver based on the broadcast component under the Android system, and monitoring the network status changes of the Android terminal based on the NetworkChangedReceiver; Construct the Activity parent class NetworkBaseActivity, and obtain the callback event of the network status change of the Android terminal based on the preset networkevent interface, and obtain the current network information of the Android terminal to generate the network identifier of the Android terminal; Comparing a preset boot set according to the network identifier and the model to generate a boot strategy; When the application corresponding to the Android terminal is in the background, the user of the Android terminal is reminded to switch networks.

Citation Information

Patent Citations

  • Real-time monitoring optimizing configuration method for smart phone

    CN103581966A

  • Method and device for automatically obtaining authority

    CN108171044A

  • A network connection management and control method and device

    CN109819092A

  • Method for improving background survival rate of application program in Android system and mobile terminal

    CN112925582A

  • Network request method and related equipment

    CN114844940A