Lab4 : Voice Over IP Using Android
This is an approximation of the grading form that wil be used to grade your
project.
Goal
In this lab you will write an application that will allow communicating
two or more phones running Android over the Internet. You will work on
teams of 2 to 5 students.
Making the Teams
Make your teams and e-mail to cs290-ta@cs the list of the team members
with the name and logins. Please do it before November 19th. Also
include the number of Android phones you already have in your team
.Once we have all the teams, we will see how to allocate the
number of phones in each team.
You should not work individually. One of the goals of this lab is to
learn how to work in teams.
Downloading Android
First download the Android
SDK. The SDK has a simulator so you do not need to have a phone to
develop. Also you should download the Eclipse
IDE
for
Java Developers and the Eclipse
Android Plugin since it will make the development easier.
Start by writing a simple hello world program that you can run in the
emulator and in your phone if available.
Sound Capture and Sound Playback
Look for Sound Capture and Sound Playback examples. See how they work
and install them in your phone. You will use these examples as the base
for your phone application.
UDP and TCP sockets
Also, look for example applications that use sockets to communicate.
You will need TCP to listen for incoming calls and you will need UDP to
send the voice packets to avoid any delay. Try running these
applications in your emulator/phone.
Architecture:
The Internet phone system will consist of two programs:
- The VOIP Program that will be running in the phone for each user
using the phone.
- A Directory Server that will have the name and IP address
of each of the users. This server can be running on any UNIX machine
(lore or sslab machines).
When the telephone program starts running, it will tell the directory
server its own IP address and user name.
The VOIP program will have the following subsystems:
- A Directory Client that will communicate with the Directory
Server to add the user and IP address and to get the list of user
names.
- A Ringer Server that will be waiting for incoming communications
and will tell the user if there is an incoming communication. The
server will keep the connection open until the telephone hangs up.
- A Ringer Client, that will contact the Ringer-Server in the other
end when the dial button is pressed.
- Voice Capture Client, that will capture voice from the microphone
and it will send the voice stream to the Voice Player Server in the
other end.
- A Voice Player Server, that will receive the voice stream sent by
the Voice Capture Client.
The protocol used by the Directory Server/Client, Ringer Server/Client
will be TCP to make the lookup and call start/end reliable. The Voice
Capture Client and the Voice Player Server will use UDP since the voice
samples should arrive on time to be played on time and using TCP/IP may
add cumulative delays in the voice due to the retransmission.
Step 1. Android SDK
Download the Andorid SDK, Eclipse, and the Eclipse plugin. Get familial
with them. See the sample applications to get familiar with Android.
Step 2. Divide work
You can divide the teams in subteams that will implement the
different subsystems:
Directory Server/Directory Client
Ringer Server Ringer Client
Voice Capture Client
Voice Player server
Phone GUI
Look for example programs that can help you start with your own
implementation.
To capture and play voice use:
import android.media.AudioRecord;
import android.media.AudioTrack;
Here are some Slides that explain these
classes . You can also check the following Android VoIP implementation
in SIPDROD
for ideas. The sources are available and you can see how they solved
some of the problems.
You can also find some examples of Voice recorder/capture as well as
UDP in lab4-src. The examples currently do not
use AudioRecord and AudioTrack but they may serve as starting point.
(Thanks to Rudy Sevile for providing the examples). A program that
helps edit and generate the GUI of andorid is here.
Step 3. Source Control
You should use Source Control in this project to allow parallel
development in the team.
To use SVN:
1. Create a shared directory in one of the home directories of the team
members:
Login to lore
cd ~
mkdir-shared svn-cs290-lab4-repo login1 login2 login3 ...
where login1 login2 login3 are the logins of the member in the team
2. Create repository
svnadmin create ~/svn-cs290-lab4-repo
3. Each user now can access the repository. To create a copy of the
repository type:
Login to a different account or machine.
To use the command line svn:
svn co
svn+ssh://lore.cs.purdue.edu/homes/<user>/svn-cs290-lab4-repo
Also in windows you can download TortoiseSVN that integrates into the
Windows environment.
Also an alternative is to use a SVN
plugin
in Eclipse.
Google for "svn tutorial" or "svn commands to see how to use it.
Turnin
You will turnin your project on December 9th during your demo time.
Create a directory called lab4-android/ with all the files needed to
create your project.
Include also in this directory a README file with the following
contents:
- Members of the team with Names and Logins
- Files used in the project and a small description of what they
contain.
- Features described in the handout that work.
- Features described in the handout that do not work
- Extra Features.
To turnin your files login to lore and type:
turnin -c cs290 -p lab4 lab4-android
The projects will be
graded 11:30 am - 1:30 pm Thursday December 9th in LWSN B146. I will
bring the schedule of times to class on Wednesday December 17th.
About 15 minutes before your presentation setup the environment you
need and make sure that your project works. That will make the
presentations go faster. We will have only about 15mins per team.