Keywords: P2P, TCP, Wi-Fi, Android Phone, timestamp. 1. Introduction ... Any device based on android operating system versions 2.2 and higher. â¢. Support for ...
Design and Implementation of P2P Voice Communication Application for Android Systems Sunil Kumar Singh, Rajesh Duvvuru, and Bhaskar Mondal Department of Computer Science and Engineering, National Istitute of Technology Jamshedpur, Jharkhand, India {sunilkrsingh.cse,rajeshduvvuru.cse,bhaskar.cse}@nitjsr.ac.in
Abstract. The purpose of this research is to design and implement a telephony program that uses Wi-Fi in P2P (Peer-to-Peer) as a means of communication between mobile phones. This application will enable the people connected using the same Wi-Fi network to communicate with each other without incurring any cost. We will present how a mobile peer-to-peer communication can be established using Transmission control protocol (TCP) as the underlying signaling protocol. There is a server side program, tested with a tester program. After that we concentrated on recording and playing raw audio in PCM format in the Android Phone. This audio calling module was over we distributed the tasks and started working. The timestamp was included in the packet send to the server. The initiation of the call was done through TCP communication between the two phones. The address book was also incorporated in the application, in which the user can store the names and roll number of his friends. Missed Call functionality was included and when the application is in background the user will be notified when there is an incoming call. The Server IP Address which will be set will be saved on the hardware, so that the user will not have to change it unless the servers address changes. It can work at different frequency. Keywords: P2P, TCP, Wi-Fi, Android Phone, timestamp.
1
Introduction
There has been an increasing interest of a wide number of scholars and researchers in promoting the applications for Peer-to-Peer (P2P) communication in Android-based smart phones as omnipresent. However, there is no effective adaptation of these new technologies to the ensemble mobile environment. Currently, smartphones and tablets have become a commodity and highly-capable multimedia devices in the ensemble mobile environment. In addition, the introduction of Wi-Fi Direct protocol on top of the existing wireless technologies has provided users with more opportunities to utilize the P2P communication with mobile devices at anytime and anywhere in a direct manner without any interface router or access point [1],[2],[3]. Application distribution platforms for mobile devices, such as the App Store or the Android Market, have promoted the appearance of an ever-increasing number of J. Mishra and P.K.J. Mohapatra (Eds.): ICWA 2013, CCIS 414, pp. 1–11, 2013. © Springer International Publishing Switzerland 2013
2
S.K. Singh, R. Duvvuru, and B. Mondal
applications, drastically changing the landscape of the market. Although Apple pioneered this change, the convenience of the Android platform for both device manufacturers and application developers has established the Android Market as one of the most relevant application distribution platforms. Due to the fast growing number of Android terminals worldwide, application developers target this platform seeking for a massive number of potential users. The current generation of P2P protocol, i.e. the third generation of P2P systems, is a mixture of the previous generations. In third-generation systems, some of the peers are called super-peers and these peers are organized dynamically. Unlike in the earlier generations, only super-peers are used in the discovery functions of peer and resource, which significantly decreases the stress caused to the network. In addition, several binding and routing optimization methods are used to minimize the overhead. JXTA (Juxtapose) and JXME are examples of the 3rd generation P2P [6], [7]. Regarding voice communications, there are different use cases traditionally addressed by other kinds of devices different from mobile phones. Two-way radio transceivers allow peers to establish a voice communication without call for additional infrastructure, provided that the devices are in range. This is very convenient in different scenarios, especially where there is no coverage of cellular networks or just when users cannot afford maintaining an ongoing call alive for unlimited periods of time. Smartphones have great connectivity thanks to technologies such as Wi-Fi or Bluetooth, but they are not provided with voice applications allowing users to use them as two-way radios with these technologies. This is the objective of the application hereby presented, Android Intercom: turn Android terminals into two-way radios using their connectivity capabilities in the best way possible. The rest of the paper is organized as follows. The next section discusses about the software model. In section 3, we have specified the server side and client side application design. Section 4 deals with the implementation part. Finally, conclusion is drawn in section 5.
2
Software Model Used
The iterative lifecycle model does not attempt to start with a full specification of requirements. Instead, development begins by specifying and implementing just part of the software, which can then be viewed in order to identify further requirements. This process is then repeated, producing a new version of the software for each cycle of the model, until the product is accepted as shown below: A requirements phase- in which the requirements for the software are gathered and analyzed. Iteration should eventually result in a requirements phase that produces a complete and final specification of requirements. A Design phase- in which a software solution to meet the requirements is designed. This may be a new design, or an extension of an earlier design. An Implementation and Test phase- when the software is coded integrated and tested. A Review phase- in which the software is evaluated, the current requirements are reviewed, and changes and additions to
Design and Implementation of P2P Voice Communication Application for Android Systems 3
requirements. There are requirements which have to be taken into consideration for P2P in ensemble mobile environments, and they are listed as follows [4], [5].
Fig. 1. Iterative lifecycle model
2.1
Software Requirement
Software interface for “Wi-Fi Call” application: • •
Any device based on android operating system versions 2.2 and higher Support for lightweight Database Management System –SQLite
Software interface for “Server” software:
OR
3
•
Any computer with windows or Linux based operating system (Database Management System used is MySQL)
•
Any device based on android operating system versions 2.2 and higher (Database Management system used is SQLite)
Application Design
High Quality Voice Transmission is one of our design goals. It is very important to make the sound quality good in this kind of voice communication application. Minimum lag in the voice transmission is also one of the design goals. Reducing the server overhead is necessary, as when many phones would be connected to the server there would be sufficient load on the server. The server is very important and it would be running continuously. Making the server efficient in such a way that it can handle a large number of phone connections simultaneously without crashing.
4
3.1
S.K. Singh, R. Duvvuru, and B. Mondal
Use Case Diagram
Fig. 2. Use Case Diagram
3.2
Low Level Design Document
Fig. 3. Server Side Flowchart
Design and Implementation of P2P Voice Communication Application for Android Systems 5
Fig. 4. Client Side Flowchart
3.3
Product Description
In the present day where communication plays such an important role in day-to-day activity, this product was proposed with the aim to provide free communication over smaller distance eg. Within an organization campus. Wi-Fi Call application can be implemented on any android based device. The “Server” program is available in two versions. One version can be implemented on the phone itself while the other is suitable for desktop computers. 3.4.1 Product Functionality Major functions of the Wi-Fi Call application: • Connect and Login user to the desired server • Initiate a call to any available user • Receive a call from available user Major functions of the Server software: • •
Register the users who wish to use this product and allocate their phone a unique roll_no Login and logout the users when they start and close their application respectively
6
S.K. Singh, R. Duvvuru, and B. Mondal
3.4.2 Users and Characteristics The users of the “Wi-Fi Call” software are the general users: • The users are assumed to have basic knowledge of phones supported with Android devices and Wi-Fi connectivity • The users need to be registered at the server, where they are allocated unique roll_no before they can use this software The users of the “Server” software can be either general user or system administrator at the corresponding organization: • • 3.4
The users are assumed to have basic knowledge of computers or android based devices and Wi-Fi or LAN connectivity The user must be an authorized one to handle client registrations Interface Design
For the “Wi-Fi Call” application, the user interface will provide buttons to login, change settings, start call and end call. The application will have its own contact list to save roll_no and name of other users. The user will be notified with proper error messages in case of connection errors. The “Server” software has a simpler user interface. It provides facility to enter a user’s information and register it by the administrator. It also shows the list of all registered users and indicate whether they are online/offline. Request from any user is processed automatically by the server software as long as it is running, without any involvement of manual help. 3.5.1 Hardware Interface • The computer or device should be connected to a Wi-Fi access point • To use the “Wi-Fi Call” application a speaker and an internal/external microphone is required with the device 3.5.2 Software Interface Software interface for “Wi-Fi Call” application: • Any device based on android operating system versions 2.2 and later • The device should provide facility for lightweight Database Management System –SQLite Software interface for “Server” software: • Any computer with windows or Linux based operating system (Database Management System used is MySQL) • Any device based on android operating system versions 2.2 and later (Database Management system used is SQLite) 3.5.3 Communication Interface • The product uses UDP protocol for communication (login/logout) between a client and the server
Design and Implementation of P2P Voice Communication Application for Android Systems 7
• TCP protocol is used to establish a call between two clients • UDP protocol is used for transmitting the audio data between two users during the call
4
Implementation
“Peer To Peer – Server” authenticates the android devices using “Wi-Fi Call” application. You have to login into the server before making a call. At the same time you can logout from server whenever you wish to. Server will also exchange your device IP address with called person’s device. 4.1
Open Peer to Peer
Fig. 5. Peer-to-peer Server
•
Click on “Setup Server” button to set host name, database name, username and password
Fig. 6. Peer-to-peer Server Setup
8
S.K. Singh, R. Duvvuru, and B. Mondal
4.2
Registering Clients
You can register new clients under “Register Clients” tab as shown in figure.
Fig. 7. Client Registration
4.3
Registered Clients • • •
You can see all online and offline user under the “Clients” tab as shown in figure The Online users are shown in green and the Offline are shown in gray This tab is updated every 5 minutes
Fig. 8. Registered Clients
Design and Implementation of P2P Voice Communication Application for Android Systems 9
4.4
Peer-to-Peer Client
4.4.1 Set the Server IP address • Click on the Settings Icon A dialogue box will appear. It will have a default IP Address, if the application is run for the first time or the previous IP Address which was set.
Fig. 9. Setting the Server
4.4.2 Connecting with the Server • After setting proper parameters, click on the Login button If server is running on the network you will get connected with it. On successful login, the login button will be replaced with a “logout” button and you will be notified as “You have successfully logged in.” Now you are ready to receive and make calls.
Fig. 10. Application Calling Screen
4.4.3 Client Connection • When called person accepts your call your screen will be as in Figure • End the call by pressing the end call button
10
S.K. Singh, R. Duvvuru, and B. Mondal
Fig. 11. Calling
4.4.2 Connecting with the Server • After setting proper parameters, click on the Login button If server is running on the network you will get connected with it. On successful login, the login button will be replaced with a “logout” button and you will be notified as “You have successfully logged in.” Now you are ready to receive and make calls.
5
Conclusion
In this paper we have presented the key points of the development of an Android application for peer to peer voice communication over local-range wireless technologies. Furthermore, we have discussed about design considerations for server and client side and implemented algorithms for communication protocols in realworld devices. Thus, we have developed workaround solutions for efficient voice transmission over Wi-Fi with the tools that Android public APIs offer. The developed application is being successfully used by thousands of users worldwide and for many different use cases. Following improvements will include Wi-Fi Direct as emerging wireless communication technology. As mentioned, Android has avoided using P2P networking through ad hoc wireless networks. Instead, it has promoted using the new Wi-Fi Direct specification, which enables P2P relationships. On each relation, one of the peers is acting as access point and the other as a normal client. This new approach to P2P wireless networking is very promising for our application, which will improve usability and simplicity.
References 1. Motta, R., Pasquale, J.: Wireless P2P: Problem or Opportunity, pp. 32–37 (2010) 2. Kirsimäe, S., Norbisrath, U., Singer, G., Narayana Srirama, S., Lind, A.: Extending Friend-to-Friend Computing to Mobile Environments, pp. 75–80 (2011)
Design and Implementation of P2P Voice Communication Application for Android Systems 11 3. Ishikawa, N., Sumino, H., Kato, T., Hjelm, J., Murakami, S., Kitagawa, K., Saito, N.: Peer-to-Peer Networking Platform and Its Applications for Mobile Phones. In: Mobile Peer-to-Peer Computing for Next Generation Distributed Environments: Advancing Conceptual and Algorithmic Applications, p. 374 (2009) 4. Want, R., Schooler, E., Jelinek, L., Jung, J., Sengupta, U., Dahle, D.: Ensemble Computing: Opportunities and Challenges. Intel Industry (2010) 5. Tysowski, P., Zhao, P., Naik, K.: Peer to Peer Content Sharing on Ad-Hoc Networks of Smartphones, pp. 1445–1450 (2011) 6. Barolli, L., Xhafa, F.: JXTA-OVERLAY: A P2P Platform for Distributed, Collaborative and Ubiquitous Computing. IEEE Transactions on Industrial Electronics, 1 (2011) 7. Seet, B.C.: Mobile Peer-to-Peer Computing for Next Generation Distributed Environments: Advancing Conceptual and Algorithmic Applications. Information Science Reference (2009) 8. Android, Android Open Source, http://source.android.com