Summary of the invention
The object of the present invention is to provide a kind of method and device that obtains the intelligent terminal telephone directory information, to solve existing Android intelligent terminal, can not pass through the technical problem of other intelligent terminal telephone directory information of bluetooth approach active obtaining.
For reaching this purpose, the present invention by the following technical solutions:
One aspect of the present invention provides a kind of method of obtaining the intelligent terminal telephone directory information, comprising:
The first intelligent terminal passes through bluetooth discovery the second intelligent terminal, and carries out Bluetooth pairing with the second intelligent terminal;
The first intelligent terminal sends Bluetooth connection request to the second intelligent terminal that completes Bluetooth pairing, sets up and is connected with the bluetooth of the second intelligent terminal;
The first intelligent terminal sends Object Exchange OBEX connection request to the second intelligent terminal, sets up and is connected with the OBEX of the second intelligent terminal;
The first intelligent terminal sends the request of obtaining associated person information in the second intelligent terminal phone directory to the second intelligent terminal based on this access protocal of bluetooth telephone, and receive the associated person information of the correspondence that the second intelligent terminal returns, add described associated person information to local call in this.
Wherein, described the first intelligent terminal receives the associated person information of the correspondence that the second intelligent terminal returns, by described associated person information add to local call in this after, also comprise:
The first intelligent terminal sends OBEX to the second intelligent terminal and disconnects request, disconnects and being connected with the described OBEX of the second intelligent terminal;
The first intelligent terminal cuts out bluetooth socket, disconnects and being connected with the bluetooth of the second intelligent terminal.
Wherein, described the first intelligent terminal sends Bluetooth connection request to the second intelligent terminal that completes Bluetooth pairing, sets up and is connected with the bluetooth of the second intelligent terminal, comprising:
The second intelligent terminal adopts this access protocal of bluetooth telephone to create a BluetoothServerSocket, monitors the Bluetooth connection request of the first intelligent terminal by this BluetoothServerSocket;
The first intelligent terminal sends Bluetooth connection request to the second intelligent terminal, creates a customer end B luetoothSocket;
The second intelligent terminal BluetoothServerSocket listens to the Bluetooth connection request that described the first intelligent terminal sends and accepts this Bluetooth connection request, obtains a server end BluetoothSocket;
Setting up described the first intelligent terminal based on described customer end B luetoothSocket and server end BluetoothSocket is connected with the bluetooth of the second intelligent terminal.
Wherein, described the first intelligent terminal sends the request of obtaining associated person information in the second intelligent terminal phone directory to the second intelligent terminal based on this access protocal of bluetooth telephone, and receive the associated person information of the correspondence that the second intelligent terminal returns, described associated person information is added in the local call basis, comprising:
The first intelligent terminal sends the instruction of obtaining contact person's sum in the second intelligent terminal phone directory to the second intelligent terminal based on this access protocal of bluetooth telephone, receive the phone directory contact person sum that the second intelligent terminal returns;
The first intelligent terminal sends the instruction of obtaining each associated person information in the second intelligent terminal phone directory one by one to the second intelligent terminal based on this access protocal of bluetooth telephone, and receive associated person information corresponding in the phone directory that the second intelligent terminal returns, add the associated person information received to local call in this.
Wherein, described the first intelligent terminal receives associated person information corresponding in the phone directory that the second intelligent terminal returns, and adds the associated person information received to local call in this, is specially:
The first intelligent terminal receives associated person information corresponding in the phone directory that the second intelligent terminal returns one by one, and the associated person information received is saved as to the .vcf formatted file;
The first intelligent terminal is resolved one by one described .vcf formatted file and is obtained corresponding associated person information, and the associated person information of acquisition is added in the local call basis.
Wherein, described the first intelligent terminal and the second intelligent terminal are the intelligent terminal of Android system.
The present invention also provides a kind of device that obtains the intelligent terminal telephone directory information on the other hand, comprising:
The Bluetooth pairing module, for passing through bluetooth discovery the second intelligent terminal, and carry out Bluetooth pairing with the second intelligent terminal;
The bluetooth link block, for sending Bluetooth connection request, set up and be connected with the bluetooth of the second intelligent terminal;
The OBEX link block, for sending Object Exchange OBEX connection request, set up and be connected with the OBEX of the second intelligent terminal;
Obtain phonebook module, for send the request of obtaining the second intelligent terminal phone directory associated person information based on this access protocal of bluetooth telephone, and receive the associated person information of the correspondence that the second intelligent terminal returns, add described associated person information to local call in this.
Wherein, described OBEX link block, also disconnect request for sending OBEX, disconnects and being connected with the described OBEX of the second intelligent terminal;
Described bluetooth link block, also for closing bluetooth socket, disconnect and being connected with the bluetooth of the second intelligent terminal.
Wherein, described bluetooth link block specifically for:
Send Bluetooth connection request to the second intelligent terminal; If this Bluetooth connection request is accepted by the BluetoothServerSocket of the second intelligent terminal, set up and be connected with the bluetooth of the second intelligent terminal;
Wherein, the second intelligent terminal adopts this access protocal of bluetooth telephone to create a BluetoothServerSocket, monitors the Bluetooth connection request entered by this BluetoothServerSocket.
Wherein, the described phonebook module of obtaining, specifically for:
Send the instruction of obtaining contact person's sum in the second intelligent terminal phone directory based on this access protocal of bluetooth telephone to the second intelligent terminal, receive the phone directory contact person sum that the second intelligent terminal returns according to this instruction; And,
Send one by one the instruction of obtaining each associated person information in the second intelligent terminal phone directory to the second intelligent terminal based on this access protocal of bluetooth telephone, and receive associated person information corresponding in the phone directory that the second intelligent terminal returns, the associated person information received is saved as to the .vcf formatted file; And,
Resolve described .vcf formatted file and obtain associated person information, the associated person information obtained is added in the local call basis.
Implement the embodiment of the present invention, there is following beneficial effect:
The embodiment of the present invention is based on the Android system, utilize bluetooth PBAP(Phone Book Access Profile: the phone directory access protocal) agreement, and use Object Exchange (OBEX:Object Exchange) to realize the client functionality of the PBAP service of Android system, make the Android intelligent terminal can pass through the telephone directory information of other intelligent terminals of bluetooth approach active obtaining, provide users with the convenient.
Embodiment
Below in conjunction with accompanying drawing of the present invention, technical scheme in the embodiment of the present invention is carried out to clear, complete description, obviously, described embodiment is only a part of embodiment of the present invention, rather than whole embodiment.Embodiment based in the present invention, the every other embodiment that those of ordinary skills obtain under the prerequisite of not making creative work, belong to the scope of protection of the invention.
The Android system starts to support new bluetooth PBAP after 2.0, in bluetooth protocol repertory, PBAP downloads for blue tooth vehicular equipment a set of agreement that the phone directory in mobile phone defines specially automatically, it is structured on Object Exchange OBEX basis, and PBAP is based on similar Basic API interface and calls path implement.Due to based on the OBEX agreement, the realization of PBAP comprises Server server end and Client client two ends, and current Android system itself has only realized the Server end of PBAP, and the Client end is not realized.Therefore, existing Android intelligent terminal can't obtain by the bluetooth request telephone directory information of other equipment.
The embodiment of the present invention is based on the Android system, utilize the client-side program of bluetooth PBAP protocol development, to realize the PBAP client functionality in the Android intelligent terminal, can allow that the intelligent terminal with this function can pass through the associated person information of bluetooth active obtaining to method, apparatus.More because now on the market Android mobile phone version all more than 2.3, so, after the present invention realizes, there is larger application space.
In the embodiment of the present invention, intelligent terminal can comprise: PC, panel computer, mobile phone, PDA(Personal Digital Assistant, palmtop PC), electronic reader, notebook computer, intelligent television, car-mounted terminal etc. can set up the intelligent terminal of phone directory, and described intelligent terminal is based on the Android system.Preferably, if without illustrating, the intelligent terminal in the present embodiment refers to the smart mobile phone of Android system.
Below in conjunction with accompanying drawing 1-accompanying drawing 4, the method for obtaining the intelligent terminal telephone directory information that the embodiment of the present invention is provided describes in detail.
Refer to Fig. 1, Fig. 1 is the schematic flow sheet of the embodiment of a kind of method of obtaining the intelligent terminal telephone directory information of the present invention, and the method specifically comprises the steps S1-S4:
Step S1, the first intelligent terminal passes through bluetooth discovery the second intelligent terminal, and carries out Bluetooth pairing with the second intelligent terminal.
During concrete enforcement, can customize corresponding PBAP application program at the first intelligent terminal and the second intelligent terminal in advance, comprise the processing of some interface controls etc.After receiving this application program of user's operational order initialization the first intelligent terminal, also need the bluetooth that detects the first intelligent terminal and the second intelligent terminal whether all to open, if do not have, need first to open the bluetooth of the first intelligent terminal and the second intelligent terminal.
Carry out Bluetooth pairing about the first intelligent terminal and the second intelligent terminal and belong to prior art, can carry out with reference to existing Bluetooth pairing method, do not repeat them here.
Step S2, the first intelligent terminal sends Bluetooth connection request to the second intelligent terminal that completes Bluetooth pairing, sets up and is connected with the bluetooth of the second intelligent terminal.Be specially, the first intelligent terminal sends Bluetooth connection request to the second intelligent terminal that completes Bluetooth pairing, if described Bluetooth connection request is accepted by the second intelligent terminal, setting up the first intelligent terminal is connected with the bluetooth of the second intelligent terminal, otherwise the first intelligent terminal continues to send Bluetooth connection request.
The embodiment of the present invention is to utilize bluetooth PBAP agreement, develops the client client functionality of realizing PBAP on the OBEX protocol basis in the Android intelligent terminal.At first need the bluetooth of setting up two intelligent terminals to connect.Connect in order to create a bluetooth on two intelligent terminals, must on software, realize the mechanism of server end and client, between them, with the distinct methods of BluetoothSocket class, obtain data.Only have when server end and client have a BluetoothSocket, could set up a bluetooth between them and connect, can start transfer of data.
Therefore, when wanting bluetooth to connect two Android intelligent terminals, using one of them intelligent terminal as client, in the present embodiment, the first intelligent terminal is as client, by wherein the another one intelligent terminal is as server end, in the present embodiment, the second intelligent terminal is as server end.And pass through the proprietary UUID(Universally Unique Identifier of bluetooth PBAP at server end, general unique identifier) create a Bluetooth Server Socket, open this Bluetooth Server Socket and monitor the Bluetooth connection request entered.The bluetooth connection procedure of client and server end is as follows.
At first, client sends a Bluetooth connection request to the server end that completes Bluetooth pairing, in client, has created a BluetoothSocket.
Concrete, for bluetooth to server end of initialization connects, at first client must obtain a BluetoothSocket connection of initialization, and basic process is as follows:
The client bluetooth equipment calls createRfcommSocketToServiceRecord (UUID) to obtain the BluetoothSocket of a client.The UUID coupling that the parameter UUID herein imported into is used in the time of must opening BluetoothServerSocket with server end.
Then, client call connect () method is with Bluetooth connection request of initialization.By call connect () method system will carry out SDP search remote Bluetooth devices with the coupling UUID.When the Bluetooth connection request only sent when the client bluetooth equipment comprises the UUID coupling that UUID and the BluetoothServerSocket that monitoring register Bluetooth connection request just possible serviced device termination be subject to.
If search successfully and the bluetooth equipment of server end has been accepted this connection, connect () will return to a BluetoothSocket, and client obtains a BluetoothSocket.Connect () method is that an obstruction calls.The connection failure of any reason or overtime (greatly about 12 seconds) all will be dished out one extremely.
Further, server end listens to the Bluetooth connection request sent from client, if accept, the current bluetooth of response message notice client of to client, returning to a correspondence connects and is accepted.When Bluetooth connection request that server end is accepted to send from client, at server end, will produce a BluetoothSocket.So far, the client and server end all has a BluetoothSocket, is defaulted as the bluetooth successful connection of client and server end, and the client and server end just can connect and carry out transfer of data by this bluetooth.
Concrete, as the second intelligent terminal of server end by BluetoothServerSocket and accept the elementary process that a bluetooth connects and be:
At first, call listenUsingRfcommWithServiceRecord (String, UUID) and obtain a BluetoothServerSocket.Wherein, string argument UUID is the identification name of the bluetooth equipment of server end, and system will be write this identification name a new Service Discovery Protocol (SDP: bluetooth device discovery protocol) in data base entries on equipment automatically.UUID also can be comprised in this new SDP entry, and as with the bluetooth equipment of client, setting up the basis that bluetooth is connected.
Next, server end calls accept () method and starts to monitor the Bluetooth connection request from client.When server end has been accepted the Bluetooth connection request of a client, accept () method will be returned to the BluetoothSocket of a server end, and server end obtains a BluetoothSocket.So far, can set up described the first intelligent terminal based on described customer end B luetoothsocket and server end BluetoothSocket and be connected with the bluetooth of the second intelligent terminal, the bluetooth successful connection of client and server end.
Because being an obstruction, accept () method calls, therefore should not be in main Activity UI thread and carry out, is all to carry out in a new thread while generally using Bluetooth Server Socket or BluetoothSocket to carry out related work.Call for fear of calling the obstruction such such as accept (), call close () for the Bluetooth Server Socket from other threads or BluetoothSocket and will make to block to call immediately to return.
After the bluetooth successful connection of client and server end, server end usually calls close () method and closes BluetoothServerSocket, the all resources that take to discharge BluetoothServerSocket and it, but do not close the BluetoothSocket connected that accept () returns.Be to call immediately the BluetoothServerSocket that close () carrys out the closing server end after server end has created the socket that a bluetooth connects, stop monitoring the Bluetooth connection request of the first intelligent terminal.
It should be noted that: it is bluetooth socket connection that the described bluetooth of the present embodiment connects actual.Because connection is the Broken method, therefore need to put into Thread and process, wait for the bluetooth successful connection, if successfully connect illustrate that the PBAP that the first intelligent terminal has been set up bluetooth with the second intelligent terminal is connected.
It should be noted that, if described the first intelligent terminal and the second intelligent terminal do not carry out Bluetooth pairing before being connected setting up bluetooth, in the process of setting up the bluetooth connection, the Android system will provide information or a dialog box of a Bluetooth pairing request automatically so.Only have after the user confirms Bluetooth pairing, the RFCOMM connection between equipment just can be proceeded, otherwise the bluetooth connection failure.
Step S3, the first intelligent terminal sends Object Exchange OBEX connection request to the second intelligent terminal, sets up and is connected with the OBEX of the second intelligent terminal.Be specially: the first intelligent terminal sends Object Exchange OBEX connection request to the second intelligent terminal, if receive, the second intelligent terminal returns corresponding with described OBEX connection request replys instruction, set up the first intelligent terminal and be connected with the OBEX of the second intelligent terminal, start the PBAP service of the first intelligent terminal and the second intelligent terminal.
Refer to Fig. 2, this step specific implementation process is:
Step 21, client 100 sends the OBEX connection request to service end, and command code is 0X80, and brings parameter TAGET UUID into, and the UUID coupling of value and the second intelligent terminal, wait for that service 200 is responded.
Step 22, server end 200 is received described OBEX connection request, if accept the OBEX connection request of client 100, returns to response instruction, and command code is 0X A0, and notice client 100OBEX connection request is accepted.
So far, i.e. the OBEX successful connection of client 100 and server end 200.Client 100 records the sign CONNECT ID that distributes to current connection in the server end return data, then carries out next step.Any server acknowledge code except 0XA0 is mistake, carries out final step and quits a program.
Step S4, the first intelligent terminal sends the request of obtaining associated person information in the second intelligent terminal phone directory to the second intelligent terminal based on PBAP, and receive the associated person information corresponding with described PBAP request instruction that the second intelligent terminal returns, described associated person information is added in the local call basis.
PBAP is to adopt the GET order just can realize to phone directory simultaneous operation on OBEX.The adaptation of PBAP on OBEX is very simple, at first it is encapsulated as MIME(Multipurpose Internet Mail Extensions to the phone directory file, the expansion of multipurpose internet mail) file that type is " x-bt/phonebook ", and filename also fixed, such as the phone directory file of SIM card is SIM1/telecom/pb.vcf.After the client of PBAP (the first intelligent terminal) and server end (the second intelligent terminal) connect like this, client is initiated the GET order, and this document of request the type just can obtain the telephone directory information of server end.
PBAP adopts the form of file that phone number entry of the same type is fitted together, defined five kinds of file types: local phone phone directory, sim card number book, dialed call, missed call, received call, these files have specific filename.The file format standard of encapsulation standard based on the VCARD(electronic business card of concrete telephone item, can be used as the DIF between various application or system).
Refer to Fig. 2, in the present embodiment, client 100 first intelligent terminals are served and are sent the request instruction that obtains associated person information in server end 200 second intelligent terminal phone directories by PBAP, and receive the associated person information of the correspondence that the second intelligent terminal returns, add described associated person information to local call and specifically comprise the steps: in this
Step 23, the request instruction that obtains phone directory contact person sum that client 100 sends based on PBAP, in the present embodiment, command code is 0X83.Specifically according to the form shown in Fig. 3, constructed each field of request instruction and sent.Wherein the MLC field must be set to 0, and meaning needs server end 200 to return to phone directory contact person sum.
Step 24, after service end 200 is received the request of include instruction code 0X83 of client 100, the inquiry local call originally obtains contact person's sum N, return carried contact person's sum N information response instruction code 0XA0 to client 100.
Step 25, if client 100 is received the 0XA0 instruction of service end 200 responses, record server end 200 phone directory contact person sum N, and execution is rapid step by step, otherwise quits a program.
Step 26, client 100 sends the instruction of obtaining single contact person in server end 200 phone directories, single associated person information in acquisition request server end 200 phone directories.Described instruction is constructed each field of instruction and is sent according to the form of Fig. 3 in detail, and wherein the MLC field is set to 1, LOS field field and is incremented to N-1 from 0 successively, and the name that the NAME field arranges server end phone directory file is telecom/pb/0.vcf.
Step 27, server end 200 returns to corresponding single associated person information to client 100.In the present embodiment, the form of the associated person information that server end returns is the .vcf form.
Step 28, call Android system vcard import api and resolve described .vcf formatted file and obtain corresponding associated person information after client 100, the associated person information of acquisition is inserted into to local call in this.
N execution step 26-step 28 of circulation, client 100 is obtained each associated person information in server end 200 phone directories one by one, and each associated person information is added in client 100 phone directories.
For example, first contact person in client 100 acquisition request server end 200 phone directories, to be set to 1, LOS field field be that the name that 0, NAME field arranges server end phone directory file is telecom/pb/0.vcf to the MLC field in corresponding request instruction.Corresponding, server end 200 returns to first associated person information vcard_0 in phone directory, and client 100 is resolved vcard_0 corresponding associated person information is inserted in the local call basis.N contact person in client 100 acquisition request server end 200 phone directories, to be set to 1, LOS field field be N-1 to the MLC field in corresponding request instruction, the name that the NAME field arranges server end phone directory file is telecom/pb/0.vcf.Corresponding, server end 200 returns to N associated person information vcard_N in phone directory, and client 100 is resolved vcard_N corresponding associated person information is inserted in the local call basis.
Client 100 sends OBEX and disconnects request after getting in server end 200 phone directories all associated person informations, and instruction is replied in the disconnection that server end 200 returns if receive, and disconnects client 100 and is connected with the OBEX of server end 200.In the present embodiment, the command code that client 100 transmission OBEX disconnect request is 0X81, and the command code that instruction is replied in the disconnection that server end 200 returns is 0XA0.
It should be noted that, in the above embodiment of the present invention, the custom end intelligent terminal has been obtained the whole associated person informations in the phone directory of server end intelligent terminal by the bluetooth active request, principle based on similar, the custom end intelligent terminal can also have been obtained by the bluetooth active request associated person information of the part in the phone directory of server end intelligent terminal, the perhaps information of some particular contact, the principle of its realization and process can, with reference to the above embodiment of the present invention, not repeat them here.
The method of obtaining the intelligent terminal telephone directory information by above-described embodiment, based on the Android system, utilize bluetooth PBAP agreement, and use Object Exchange OBEX to realize the customer side function of the PBAP service of Android system, make the Android intelligent terminal can pass through the telephone directory information of other intelligent terminals of bluetooth approach active obtaining, provide users with the convenient.
For more detailed explanation a kind of method of obtaining the intelligent terminal telephone directory information of the present invention, the present invention also provides a kind of particular flow sheet that obtains the method for intelligent terminal telephone directory information, refers to Fig. 4, comprises the steps 30-step 39.
At first, open the PBAP application program of the first intelligent terminal and the second intelligent terminal, wherein, the first intelligent terminal and the second intelligent terminal have completed Bluetooth pairing.
Whether step S30, detect the bluetooth of the first intelligent terminal and open, if carry out next step, otherwise the prompting user opens bluetooth, re-executes this step.
Step 31, whether near bluetooth equipment search, search the bluetooth equipment of the second intelligent terminal, if carry out next step, otherwise proceeds to wrong treatment step.
Step 32, the first intelligent terminal sends Bluetooth connection request to the second intelligent terminal, if this Bluetooth connection request is carried out next step by the second intelligent terminal acceptance, otherwise proceeds to wrong treatment step.
Step 33, the first intelligent terminal sends the OBEX connection request to the second intelligent terminal, if this OBEX connection request is carried out next step by the second intelligent terminal acceptance, otherwise proceeds to wrong treatment step.
Step 34, the first intelligent terminal send obtain phone directory contact person sum instruction to the second intelligent terminal, the phone directory contact person sum that the second intelligent terminal returns if receive is carried out next step, otherwise proceeds to wrong treatment step.
Step 35, the first intelligent terminal send obtain the single contact person of phone directory instruction to the second intelligent terminal, in the phone directory that the second intelligent terminal returns if receive, corresponding associated person information is carried out next step, otherwise proceeds to wrong treatment step.
Step 36, the first intelligent terminal saves as the .vcf formatted file by the associated person information of acquisition.
The instruction that the single contact person of phone directory is obtained in the first intelligent terminal circulation transmission is to the second intelligent terminal, to obtain one by one the associated person information in the second intelligent terminal phone directory.
Step 37, the first intelligent terminal is resolved described .vcf formatted file and is obtained associated person information, and the associated person information obtained is added in the local call basis.
Step 38, the first intelligent terminal sends OBEX and disconnects request to the second intelligent terminal, instruction is replied in the disconnection that the second intelligent terminal returns if receive, and disconnects the first intelligent terminal and is connected with the OBEX of the second intelligent terminal.
Step 39, the first intelligent terminal cuts out bluetooth socket, disconnects the first intelligent terminal and is connected with the bluetooth of the second intelligent terminal.
Finally, the first intelligent terminal completes the solicit operation to the second intelligent terminal phone directory, exits respectively the PBAP application program of the first intelligent terminal and the second intelligent terminal according to user's operational order.
The method of obtaining the intelligent terminal telephone directory information by the present embodiment, based on the Android system, utilize bluetooth PBAP agreement, and use Object Exchange OBEX to realize the customer side function of the PBAP service of Android system, make the Android intelligent terminal can pass through the telephone directory information of other intelligent terminals of bluetooth approach active obtaining, provide users with the convenient.
Below the embodiment of the device that obtains the intelligent terminal telephone directory information that provides for the embodiment of the present invention.Embodiment and the above-mentioned embodiment of the method for device belong to same design, and the detail content of detailed description not in the embodiment installed, can be with reference to the above-mentioned embodiment of the method for readding.
Below in conjunction with accompanying drawing 5, the device that obtains the intelligent terminal telephone directory information that the embodiment of the present invention is provided describes in detail.
Refer to Fig. 5, the device that obtains the intelligent terminal telephone directory information of the present embodiment comprises:
Bluetooth pairing module 510, for passing through bluetooth discovery the second intelligent terminal, and carry out Bluetooth pairing with the second intelligent terminal.Specifically as described in Fig. 1 and embodiment.
Bluetooth link block 520, for to the the second intelligent terminal matched, sending Bluetooth connection request, set up and be connected with the bluetooth of the second intelligent terminal.Wherein, the server end that described the second intelligent terminal connects as bluetooth.Specifically as described in above-mentioned embodiment.
OBEX link block 530, for to the second intelligent terminal, sending the OBEX connection request, set up and be connected with the OBEX of the second intelligent terminal.Specifically as described in above-mentioned embodiment.
Obtain phonebook module 540, for send the request of obtaining the second intelligent terminal phone directory associated person information to the second intelligent terminal based on this access protocal of bluetooth telephone, and receive the associated person information of the correspondence that the second intelligent terminal returns, add described associated person information to local call in this.
Preferably, described OBEX link block 530, also disconnect request for to the second intelligent terminal, sending OBEX, disconnects and being connected with the described OBEX of the second intelligent terminal.Specifically, as described in above-mentioned embodiment, repeat no more.
Preferably, described bluetooth link block 520, also for closing bluetooth socket, disconnect and being connected with the bluetooth of the second intelligent terminal.Specifically, as described in above-mentioned embodiment, repeat no more.
Further, described bluetooth link block 520 can specifically for: send Bluetooth connection request to the second intelligent terminal; If this Bluetooth connection request is listened to and accepts by the second intelligent terminal BluetoothServerSocket, set up and be connected with the bluetooth of the second intelligent terminal; Wherein, the second intelligent terminal adopts BluetoothServerSocket of bluetooth telephone this access protocal specification creation, monitors the Bluetooth connection request entered by this BluetoothServerSocket.Specifically, as described in above-mentioned embodiment, repeat no more.
Further, described obtain phonebook module 540 can specifically for: send the instruction obtain contact person's sum in the second intelligent terminal phone directory based on the phone directory access protocal to the second intelligent terminal, receive contact person's sum that the second intelligent terminal returns according to this instruction; And, send one by one the instruction of obtaining each associated person information in the second intelligent terminal phone directory to the second intelligent terminal based on the phone directory access protocal, and receive the corresponding relationship people that the second intelligent terminal returns, the associated person information received is saved as to the .vcf formatted file; And, resolve described .vcf formatted file and obtain associated person information, the associated person information obtained is added in the local call basis.Specifically, as described in above-mentioned embodiment, repeat no more.
By implementing the above embodiment of the present invention, based on the Android system, utilize bluetooth PBAP agreement and use Object Exchange OBEX, realized the customer side function of the PBAP service of Android system, make the Android intelligent terminal can pass through the telephone directory information of other intelligent terminals of bluetooth approach active obtaining, provide users with the convenient.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, be can be relevant by computer program instructions hardware complete, described program can be stored in a computer-readable access media, when this program is carried out, can comprise the flow process of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (random access memory, RAM) etc.
Above disclosed is only preferred embodiment of the present invention, certainly can not limit with this claim scope of the present invention, therefore, all any modifications of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., still belong to the scope that the present invention is contained.