CN103491653A - WiFi and 3G coexisting method based on Android intelligent terminal - Google Patents

WiFi and 3G coexisting method based on Android intelligent terminal Download PDF

Info

Publication number
CN103491653A
CN103491653A CN201310175217.1A CN201310175217A CN103491653A CN 103491653 A CN103491653 A CN 103491653A CN 201310175217 A CN201310175217 A CN 201310175217A CN 103491653 A CN103491653 A CN 103491653A
Authority
CN
China
Prior art keywords
network
wifi
information
intelligent terminal
dns
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310175217.1A
Other languages
Chinese (zh)
Inventor
钟芹盛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Sheng Ben Intelligent Technology Co., Ltd.
Original Assignee
SHANGHAI BASEWIN TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHANGHAI BASEWIN TECHNOLOGY Co Ltd filed Critical SHANGHAI BASEWIN TECHNOLOGY Co Ltd
Priority to CN201310175217.1A priority Critical patent/CN103491653A/en
Publication of CN103491653A publication Critical patent/CN103491653A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to a WiFi and 3G coexisting method based on an Android mobile intelligent terminal. The method includes the following steps of starting a system service and establishing a user operation class to judge a network port, configuring a default network, starting connection of a first network and acquiring network information of the first network, updating a DNS and adding routing information of the first network into a routing list; starting connection of a second network and acquiring network information of the second network, updating the DNS and adding routing information of the second network into the routing list. The WiFi and 3G coexisting method based on the Android intelligent terminal has the advantages that through the arrangement of the WiFi and the 3G network, the 3G network is supported while the WiFi network is connected so that a user can perform 3G network communication and WiFi network communication at the same time.

Description

WiFi based on the Android intelligent terminal and 3G coexistence method
Technical field
The present invention relates to the data communication technology field, especially relate to a kind of method based under the Android mobile intelligent terminal, WiFi and 3G network coexist.
Background technology
At present, in mobile terminal, data network commonly used is generally broadband wireless network WiFi and 3G (Third Generation) Moblie 3G, and wherein, the 3G network coverage rate is wider, but the 3G flow that the user has every month is limited, and rate are higher; The WiFi focus only is present in fixed-site, and the mobile terminal of holding as the user is positioned at the fixed-site at WiFi focus place, after being connected to WiFi, can freely use this WiFi to carry out network service, generally limited flow not.
The network communication method of existing mobile terminal mainly comprises: the operating system carried by mobile terminal realizes the connection of WiFi internet and 3G network is controlled; A time period, when needs adopt the WiFi network to carry out network service, operating system is connected the control to the WiFi network; When needs adopt 3G network to carry out network service, first disconnect the control to WiFi, then connect the control to 3G network.From said process, a time period, or surf the Net by 3G, or surf the Net by WiFi.And, the mobile terminal that some functions are fairly perfect, the smart mobile phone based on the android Android system for example, the network priority setting of WiFi is higher than 3G, in the situation that 3G network link, open the WiFi network and connect, can automatically close 3G network and connect, the current network link is switched to the WiFi network; In the situation that the WiFi network links, can not open 3G network and connect.Be that synchronization can only have a kind of network linking to exist.Qchat (wireless talkback business) can only be used the 3G wireless network.Existing Android mobile device terminal is in the situation that unlatching WiFi can not be used the Qchat function.
Hence one can see that, in existing mobile terminal, can't realize opening 3G network and WiFi network simultaneously, affects to a certain extent user's Experience Degree, and then also just can't meet the demand that the user carries out 3G network communication and WiFi network service simultaneously.
Therefore, in order to meet user's demand, a kind of appearance of the method based under the Android mobile intelligent terminal, WiFi and 3G network coexist is necessary.
Summary of the invention
The present invention proposes a kind of WiFi and 3G coexistence method based on the Android intelligent terminal, has solved the problem that can't realize simultaneously opening 3G network and WiFi network in the prior art.
Technical scheme of the present invention is achieved in that
WiFi based on the Android intelligent terminal and 3G coexistence method comprise the following steps:
S1: start system service and set up user's class of operation, in order to judge the network port;
S2: allocating default network;
S3: start first network and connect, and obtain the network information of first network;
S4: upgrade DNS, and the routing iinformation of first network is added in routing table;
S5: start second network and connect, and obtain the network information of second network;
S6: upgrade DNS, and the routing iinformation of second network is added in routing table.
As preferred technical scheme, described first network and second network are respectively wifi and 3G network.
As preferred technical scheme, the described network information comprises link information and connection type, and described link information also comprises DNS information and routing iinformation.
The beneficial effect that the present invention has is: by the setting to wifi and 3G network, realized also having supported 3G network when connecting the Wifi network, and then met the demand that the user carries out 3G network communication and Wifi network service simultaneously.
The accompanying drawing explanation
Fig. 1 is the present invention: the schematic diagram of the WiFi based on the Android intelligent terminal and 3G coexistence method;
Fig. 2 is the present invention: the flow chart of the WiFi based on the Android intelligent terminal and 3G coexistence method.
Embodiment
For technological means, creation characteristic that the present invention is realized, reach purpose and effect is easy to understand, below in conjunction with concrete diagram, further set forth the present invention.
Shown in Fig. 1, the WiFi based on the Android intelligent terminal and 3G coexistence method comprise the following steps:
S1: start system service and set up user's class of operation, in order to judge the network port;
S2: allocating default network;
S3: start first network and connect, and obtain the network information of first network;
S4: upgrade DNS, and the routing iinformation of first network is added in routing table;
S5: start second network and connect, and obtain the network information of second network;
S6: upgrade DNS, and the routing iinformation of second network is added in routing table.
Described first network and second network are respectively wifi and 3G network.
Shown in Fig. 2, set forth the WiFi that the present invention is based on the Android intelligent terminal and the specific embodiments of 3G coexistence method,
1, start system service
When starting, the Android mobile terminal system starts a background system service (ConnectivityService).Judgement, selection to network are all processed in this service.
2, set up user's class of operation (ConnectivityManager), by AIDL(Android InterfaceDefinitionLanguage: the service that interface description language) technology access ConnectivityService provides.
3, preparation default network
In ConnectivityManager
The WiFi network type is formulated as to TYPE_WIFI.
The 3G network type is formulated as to TYPE_MOBILE.
Default network is formulated as defaultNet=TYPE_WIFI.
Backup network is otherNet=TYPE_MOBILE.
4, starting terminal the first network connects
Network interface card by the Android terminal equipment connects, and the network interface card here can be wlan0 (WiFi network interface card) or ppp0 (3G network interface card).Wherein, the WiFi network interface card is the wireless connections with the WiFi focus for foundation, so that terminal is by WiFi focus accessing Internet; The 3G network interface card is the wireless connections with base station equipment for foundation, so that terminal is by base station equipment access communications network.
During the network successful connection, Android terminal bottom module reports upper layer application by the network information NetworkInfo of this connection, the network information reported comprises link information LinkProperties, and link information comprises InetAddress(dns information) and RouteInfo (routing iinformation).Also comprise ConnectivityType (connection type) in the network information.NetworkInfo.getType () can obtain this connection type.
5, obtain the DNS interface
According to report network acquisition of information default network and backup network link information:
LinkPropertiesmyLP=NetworkInfo[defaultNet].getLinkProperties();
LinkPropertiesotherLP=NetworkInfo[otherNet].getLinkProperties();
What judge current unlatching is any network type, has opened several networks.If network has been opened, the connection attribute of network is not empty, i.e. LinkProperties unequal to null.
According to following condition judgment, current dns interface is set:
Figure BDA00003181527400051
GetInterfaceName obtains the network interface card title of connection, and WiFi is wlan0, and 3G is ppp0.
If default network is opened myLP unequal to nul, the dns interface is set to default network; If default network is not opened myLP==null, backup network is opened, otherLP unequal to null, and the dns interface is set to backup network.Here be ppp0 (3G network interface card).
If two kinds of networks are opened myLP unequal to nul&amp simultaneously; & OtherLP unequal to null, the dns interface is set to default network.
6, upgrade DNS
Call network management services (NetworkManagementService) at the bottom of the Android mobile terminal arrange dns be the dns interface that obtains in step 5:
NetworkManagementService.setDefaultInterfaceForDns(defDnsIface)。
7, add routing table
UpdateRoutes by ConnectivityService goes to upgrade routing table, finally by NetworkManagementService.addRoute (ifaceName,, RouteInfo); The routing iinformation connected is specifically added in routing table.Wherein, the title that ifaceName is this connection network card, RouteInfo is the routing iinformation after connecting.
If this time be connected to WiFi, default router table is as follows:
Destination?Gateway?Genmask?Flags?Metric?Ref?Use?Iface
Default?192.168.1.1?0.0.0.0?UG?0?0?0?Wlan0
If this time be connected to 3G, default router table is as follows:
Destination?Gateway?Genmask?Flags?Metric?Ref?Use?Iface
Default?115.168.41.27?0.0.0.0?UG?20?0?0?ppp0
Annotate: the gateway that different terminal equipment obtains (Gateway) may be different, upper table WiFi network interface card (wlan0), and the gateway obtained is 192.168.1.1.3G network interface card (ppp0), the gateway obtained is 115.168.41.27
8, starting terminal the second network connects
Obtain the DNS interface according to the step 5 of front, step 6 is upgraded DNS.
9, add routing table
Add the routing iinformation of the first network in step 7 to routing table, added the routing iinformation of the second network here to routing table.UpdateRoutes by ConnectivityService goes to upgrade routing table,
Finally by NetworkManagementService.addRoute (ifaceName,, RouteInfo); The routing iinformation connected is specifically added in routing table.Wherein, the title that ifaceName is this connection network card, RouteInfo is routing iinformation.
Two kinds of networks (WiFi, 3G) while also is stored in the Android mobile terminal, and default router table is as follows:
Destination?Gateway?Genmask?Flags?Metric?Ref?Use?Iface
Default?192.168.1.1?0.0.0.0?UG?0?0?0?Wlan0
Default?115.168.41.27?0.0.0.0?UG?20?0?0?ppp0
Annotate: the gateway that different terminal equipment obtains (Gateway) may be different, upper table WiFi network interface card (wlan0), and the gateway obtained is 192.168.1.1; 3G network interface card (ppp0), the gateway obtained is 115.168.41.27
Above demonstration and described basic principle of the present invention and principal character and advantage of the present invention.The technical staff of the industry should understand; the present invention is not restricted to the described embodiments; that in above-described embodiment and specification, describes just illustrates principle of the present invention; without departing from the spirit and scope of the present invention; the present invention also has various changes and modifications, and these changes and improvements all fall in the claimed scope of the invention.The claimed scope of the present invention is defined by appending claims and equivalent thereof.

Claims (3)

1. the WiFi based on the Android intelligent terminal and 3G coexistence method, is characterized in that, the method comprises the following steps:
S1: start system service and set up user's class of operation, in order to judge the network port;
S2: allocating default network;
S3: start first network and connect, and obtain the network information of first network;
S4: upgrade DNS, and the routing iinformation of first network is added in routing table;
S5: start second network and connect, and obtain the network information of second network;
S6: upgrade DNS, and the routing iinformation of second network is added in routing table.
2. WiFi and the 3G coexistence method based on the Android intelligent terminal according to claim 1, is characterized in that, described first network and second network are respectively wifi and 3G network.
3. WiFi and the 3G coexistence method based on the Android intelligent terminal according to claim 1, is characterized in that, the described network information comprises link information and connection type, and described link information also comprises DNS information and routing iinformation.
CN201310175217.1A 2013-05-13 2013-05-13 WiFi and 3G coexisting method based on Android intelligent terminal Pending CN103491653A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310175217.1A CN103491653A (en) 2013-05-13 2013-05-13 WiFi and 3G coexisting method based on Android intelligent terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310175217.1A CN103491653A (en) 2013-05-13 2013-05-13 WiFi and 3G coexisting method based on Android intelligent terminal

Publications (1)

Publication Number Publication Date
CN103491653A true CN103491653A (en) 2014-01-01

Family

ID=49831517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310175217.1A Pending CN103491653A (en) 2013-05-13 2013-05-13 WiFi and 3G coexisting method based on Android intelligent terminal

Country Status (1)

Country Link
CN (1) CN103491653A (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103957572A (en) * 2014-05-20 2014-07-30 普天信息技术有限公司 Android-system-based distribution method through multi-network route policy
CN103973800A (en) * 2014-05-19 2014-08-06 普天信息技术有限公司 Android-based double-network-card concurrence implementation method
CN104486785A (en) * 2014-12-23 2015-04-01 广东欧珀移动通信有限公司 Switching method and system of mobile terminal network optimization
CN104981030A (en) * 2015-07-10 2015-10-14 努比亚技术有限公司 Network connection control method and device
CN105430763A (en) * 2015-11-30 2016-03-23 上海斐讯数据通信技术有限公司 Data acquisition method and device synchronously used by WIFI (Wireless Fidelity) data and mobile data
CN105744646A (en) * 2016-01-30 2016-07-06 努比亚技术有限公司 Mobile terminal and communication method
CN106413045A (en) * 2016-09-30 2017-02-15 深圳市保千里电子有限公司 Synchronous running method and system for wifi and mobile communication
CN106953752A (en) * 2017-03-14 2017-07-14 上海联彤网络通讯技术有限公司 Realize multi-network coexisted and simultaneously accessed system and method
CN106998294A (en) * 2017-04-26 2017-08-01 贵州省广播电视信息网络股份有限公司 A kind of method that multirouting Multi net voting is supported based on android system
WO2017128663A1 (en) * 2016-01-30 2017-08-03 努比亚技术有限公司 Mobile terminal, wifi control method and storage medium
WO2017139979A1 (en) * 2016-02-19 2017-08-24 吴伟东 Mobile telephone smart networking method and system
CN107734591A (en) * 2017-11-15 2018-02-23 世纪龙信息网络有限责任公司 The wireless public network connection method of intelligent terminal and system
CN108616951A (en) * 2016-12-20 2018-10-02 大唐半导体设计有限公司 A kind of method and apparatus for realizing data transmission
US10104643B2 (en) 2014-11-06 2018-10-16 Mediatek Inc. Method and apparatus for heterogeneous communication
CN108924274A (en) * 2018-09-14 2018-11-30 Oppo广东移动通信有限公司 domain name system DNS processing method, device, storage medium and electronic equipment
CN112235849A (en) * 2020-10-19 2021-01-15 展讯半导体(成都)有限公司 Method, system, electronic device, and medium for identifying Wi-Fi hotspot type
CN113543146A (en) * 2021-07-16 2021-10-22 杭州迈冲科技有限公司 Network coexistence control method and device based on Android system
CN114364059A (en) * 2022-01-11 2022-04-15 拉扎斯网络科技(上海)有限公司 Communication method and device of storage cabinet

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973800A (en) * 2014-05-19 2014-08-06 普天信息技术有限公司 Android-based double-network-card concurrence implementation method
CN103973800B (en) * 2014-05-19 2017-12-08 普天信息技术有限公司 A kind of double netcard based on Android system and the implementation method deposited
CN103957572A (en) * 2014-05-20 2014-07-30 普天信息技术有限公司 Android-system-based distribution method through multi-network route policy
US10104643B2 (en) 2014-11-06 2018-10-16 Mediatek Inc. Method and apparatus for heterogeneous communication
CN104486785A (en) * 2014-12-23 2015-04-01 广东欧珀移动通信有限公司 Switching method and system of mobile terminal network optimization
CN104486785B (en) * 2014-12-23 2018-05-29 广东欧珀移动通信有限公司 A kind of switching method and system of mobile terminal network optimization
CN104981030B (en) * 2015-07-10 2016-11-09 努比亚技术有限公司 network connection control method and device
CN104981030A (en) * 2015-07-10 2015-10-14 努比亚技术有限公司 Network connection control method and device
CN105430763A (en) * 2015-11-30 2016-03-23 上海斐讯数据通信技术有限公司 Data acquisition method and device synchronously used by WIFI (Wireless Fidelity) data and mobile data
CN105744646A (en) * 2016-01-30 2016-07-06 努比亚技术有限公司 Mobile terminal and communication method
WO2017128663A1 (en) * 2016-01-30 2017-08-03 努比亚技术有限公司 Mobile terminal, wifi control method and storage medium
WO2017139979A1 (en) * 2016-02-19 2017-08-24 吴伟东 Mobile telephone smart networking method and system
CN106413045A (en) * 2016-09-30 2017-02-15 深圳市保千里电子有限公司 Synchronous running method and system for wifi and mobile communication
CN106413045B (en) * 2016-09-30 2018-05-11 深圳市保千里电子有限公司 A kind of wireless wifi and the method and system of mobile communication synchronous operation
CN108616951A (en) * 2016-12-20 2018-10-02 大唐半导体设计有限公司 A kind of method and apparatus for realizing data transmission
CN106953752A (en) * 2017-03-14 2017-07-14 上海联彤网络通讯技术有限公司 Realize multi-network coexisted and simultaneously accessed system and method
CN106998294A (en) * 2017-04-26 2017-08-01 贵州省广播电视信息网络股份有限公司 A kind of method that multirouting Multi net voting is supported based on android system
CN107734591A (en) * 2017-11-15 2018-02-23 世纪龙信息网络有限责任公司 The wireless public network connection method of intelligent terminal and system
CN108924274A (en) * 2018-09-14 2018-11-30 Oppo广东移动通信有限公司 domain name system DNS processing method, device, storage medium and electronic equipment
CN108924274B (en) * 2018-09-14 2021-10-26 Oppo广东移动通信有限公司 Domain name system DNS processing method and device, storage medium and electronic equipment
CN112235849A (en) * 2020-10-19 2021-01-15 展讯半导体(成都)有限公司 Method, system, electronic device, and medium for identifying Wi-Fi hotspot type
CN113543146A (en) * 2021-07-16 2021-10-22 杭州迈冲科技有限公司 Network coexistence control method and device based on Android system
CN113543146B (en) * 2021-07-16 2024-02-09 杭州迈冲科技有限公司 Network coexistence control method and device based on Android system
CN114364059A (en) * 2022-01-11 2022-04-15 拉扎斯网络科技(上海)有限公司 Communication method and device of storage cabinet
CN114364059B (en) * 2022-01-11 2024-02-23 拉扎斯网络科技(上海)有限公司 Communication method and device of storage cabinet

Similar Documents

Publication Publication Date Title
CN103491653A (en) WiFi and 3G coexisting method based on Android intelligent terminal
WO2019157885A1 (en) Communication method and device under centralized unit-distributed unit architecture
CN103458136B (en) The talking management method of many cards manifold terminal and device
CN103281797A (en) Mobile terminal and method of transmitting business data by same
CN105939381B (en) A kind of controlling terminal automatically switches the method and system of downloading file mode
EP2640159B1 (en) Method and apparatus for implementing service distribution for dual-network dual-standby terminal
CN103533609B (en) The concurrent network system of mobile terminal many APN network channel and creation method thereof
WO2015051701A1 (en) Method for realizing multi-channel concurrent internet accessing by synchronizing wifi with apn network, and automatically choosing wifi networking preferentially
CN106385664A (en) IOT (Internet of Things) intelligent equipment communication method and system based on virtual SIM card
CN109462844A (en) A kind of system and method that list WiFi chip runs multi-platform SDK
CN102340843A (en) Terminal mode processing method, network access method and base station thereof
CN102724658B (en) Terminal is connected concurrent processing method with multichannel data
WO2016119218A1 (en) Call supplementary service configuration synchronization method, apparatus and system
CN106131816A (en) Virtual sim card management method and terminal
CN103281799A (en) Network connection switching method based on mobile phone hot spots and mobile phone
CN103491105A (en) Multi-APN channel management method for multi-APN network concurrent networking
CN110324808A (en) Switching method, device and the mobile terminal of configuration file
CN102594918A (en) Address book realization method and system for terminal, and terminal
CN107592639A (en) A kind of terminal device adds the method and system of router white list
CN102098763A (en) Dual-mode wireless terminal and handover method thereof
CN104661322A (en) Application internet access processing method and device as well as terminal
CN105812178B (en) A kind of terminal staging method and terminal
CN105072026A (en) Internet-of-things gateway communication system
CN109617723A (en) A kind of cloud communication system of broadcasting equipment
CN102752753B (en) A kind of method and mobile radio terminal of control ZigBee-network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
C41 Transfer of patent application or patent right or utility model
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20160128

Address after: 200235, room 5, building 20, 102 middle Xu Xu Road, Shanghai, Xuhui District

Applicant after: Shanghai Sheng Ben Intelligent Technology Co., Ltd.

Address before: 200235, 4, 20 middle Xu Xu Road, Shanghai, Xuhui District

Applicant before: Shanghai Basewin Technology Co., Ltd.

WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140101

WD01 Invention patent application deemed withdrawn after publication