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
routing
intelligent terminal
Prior art date
Application number
CN201310175217.1A
Other languages
Chinese (zh)
Inventor
钟芹盛
Original Assignee
上海盛本通讯科技有限公司
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 上海盛本通讯科技有限公司 filed Critical 上海盛本通讯科技有限公司
Priority to CN201310175217.1A priority Critical patent/CN103491653A/en
Publication of CN103491653A publication Critical patent/CN103491653A/en

Links

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:
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 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 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 (15)

* 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

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973800B (en) * 2014-05-19 2017-12-08 普天信息技术有限公司 A kind of double netcard based on Android system and the implementation method deposited
CN103973800A (en) * 2014-05-19 2014-08-06 普天信息技术有限公司 Android-based double-network-card concurrence implementation method
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

Similar Documents

Publication Publication Date Title
US20200170055A1 (en) Session Management Method and System, and Terminal
CN104704875B (en) The method and apparatus for controlling multipriority in a wireless communication system
US9432067B2 (en) Supporting SIM toolkit applications in embedded UICCs
CN103558836B (en) Equipment state synchronisation control means and home appliance
CN101115248B (en) Multi-mode terminal and data forwarding method
CN202218258U (en) Intelligent home gateway and system thereof
CN101252376B (en) System and method for connecting blue tooth equipment and mobile communication terminal thereof
CN104378729B (en) Mobile communications network service implementation method and mobile terminal system
CN104080074B (en) User equipment and communication system and its method for managing tracing area identification list
JP4486511B2 (en) Call processing method and apparatus
CN101690317B (en) Data type encoding for media independent handover
Nirjon et al. Multinets: Policy oriented real-time switching of wireless interfaces on mobile devices
US20180129444A1 (en) System and Apparatus for Transferring Data Between Communication Elements
CN106789526B (en) method and device for connecting multiple system networks
CN104363588A (en) Mobile terminal internet access control method and mobile terminal
CN103533669B (en) The many APN network concurrents systems of mobile terminal and its networking method
CN104159276A (en) Network search method of multi-mode terminal, and network search device of multi-mode terminal
EP3116161A1 (en) Security unit management method and terminal
US8554244B2 (en) Configuration of mobile communication devices
CN105722058A (en) User equipment and information forwarding method
CN104486785A (en) Switching method and system of mobile terminal network optimization
CN100466821C (en) Wireless switch-in network, method for grouped transmission and method for terminal switch
CN101977382B (en) Audio and video integrated control circuit and method for accessing access point
US8489143B2 (en) ME network parameters configuration by UICC
CN101188818B (en) Base station, processing method for its baseband signal and wireless communication system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C41 Transfer of patent application or patent right or utility model
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.

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140101