15-446 Projects
Project 1 Final
This will take longer than the check point. So please start early.
Assignment 2 is part of the Final Project and is due sooner.
Do not start the coding after the deadline of Assignment 2. Start earlier.
Project Document
All-inclusive tarball
Old ones
Project tarball
Checkpoint Solution and some update
FAQ
Running the emulator/eclipse on linux.andrew.
- Use ./run_eclipse on the project home directory (/afs/cs.cmu.edu/project/cmcl-srini-4/15-446/android/)
- Go to preference in Eclipse and set Android SDK location as /afs/cs.cmu.edu/project/cmcl-srini-4/15-446/android/android-sdk-linux_x86-1.0_r2
- In Eclipse, give the argument in the "Additional Emulator Command Line Options". "-sdcard somepath/1.img"
- In Eclipse, checking "Wipe User Data" option is helpful.
- Run "source rubyenv"
- Include the following directory in your path before you run the ruby server. (/afs/cs.cmu.edu/project/cmcl-srini-4/15-446/android/android-sdk-linux_x86-1.0_r2/tools)
*If you do not do the last step, files will not be copied to the SD card.
The emulator does not connect to the ruby server. What should I do?
If you see the message below, it means you did not update some of the files.
strings.xml, FileSharereActivity.java, and FileShareService.java need to be
updated with the ones included in Checkpoint Solution and some update.
V/CS446 FileShareWorkerThread( 157): Connecting to null:10001
What is the lasted version? What files should I use?
The best thing is to use All-inclusive tarball.
This contains the most recent version for all files.
If you already have a working version (download from various sources)
and just want to make sure if you have the latest, here is the list.
Checkpoint Solution and some update contains
recent versions of the following files.
- 1.img
- control-4.xml (* If you use older version, an error will occur in the FileSharer application.)
- jar file
Project tarball contains
recent versions of the following files.
- strings.xml
- FileShareService.java
- FileSharereActivity.java
The latest version for the ruby server was sent via email.
What are the four files we need to run?
control2.xml, control3.xml, control3-a.xml and control4.xml
Project 1
Project Document
Project tarball
Android Overview
- Checkpoint due on Feb. 5 (11:59pm)
- Final version due on Feb. 26
Hand-in instruction
Hand-in directory is the AFS directory below.
/afs/cs.cmu.edu/project/cmcl-srini-4/15-446/handin/S09_project1
Use your own directory. Copy the entire directory tree for the project. I gave access to your andrew accounts
To facilitate grading, DO NOT close the CS446Sockets
after you have established a single connection per every pair of
connected nodes.
At the time of advaceTime() call, I will check whether
there are only one connection per each connected node.
So only close the duplicates.
Additional information on project 1
Files to edit
For the checkpoint, you need to touch two files in
edu.cmu.cs446.project1. You do not need to change
the edu.cmu.cs446.ta package.
Inside the project1 package, you need to add the part to send
broadcast messages, and processes broadcast messages
that are received through the call back function. The
call back function is called by the Worker thread whose
implementation is hidden. You need to implement(or rewrite) the
BroadcastReceiveCallBack.BcastMsgReceived() method. All it does
now is to log the message. So it has to be rewritten.
Just edit the BroadcastReceiveCallBack file directly.
I would setup a singleton class that stores all the
connectivity information so that both BroadcastReceiveCallBack
and FileSynchronizerThread can access it.
Keep track of the devices near-by (inside BroadcastReceiveCallBack),
and make a connection using that information (in FileSynchronizerThread).
You may rewrite everything in cs446.project1 package,
as long as you keep the
structure in FileSynchronizerThread.run().
You can rename/rewrite functions in the middle part of run().
But keep the bottom and top part.
See the comment in the code.
AdvanceTime() is important as it advances time and changes
the connectivity. For grading purposes, do not close all the
sockets, but leave open a socket per each peer. Remember that
you have to have a connection to every connected pair at
the end of each 'time slot'. So leave them open in order to
facilitate grading.
You may delete the TestThread inside FileSynchronizerThread as it was
just provided as an example use of the socket API.
Read the comments in the code.
What does the start up code do? Where do I start from?
FileShareWorker does mainly server communication, and it starts up the FileSynchronizerThread.
When it starts up, it connects with the local server, sets up communication
channels between android emulators.
After connection setup, it receives the connectivity information from server and
it directs to the local server all data communication between
emulators using the communication channels.
To support broadcast, it spawns a thread that listens to broadcast messages sent by
other emulators and calls the callback function whenever a broadcast message arrives.
To get started, in Broadcast receive callback function, I would record the information in a singleton class that acts like a global variable so that FileSynchronizerThread can access the information to connect to other emulators.
Accessing Logs
We do not have any UI for the application. That also means
we can't tell what's going on, what the application is doing, etc.
All information is logged using Log.*() API, which is part of the Android SDK.
So we need to see the log to find out what's going on and
if everything is fine.
In order to access the log content, run logcat from the
Android shell. (or adb -s emulator-\ shell logcat).
It can be also accessed from eclipse if you run the application
in debug mode, and change the perspective to 'Debug' from 'Java'.
But if you want to get logs for multiple androids,
I think the adb command is easier to manage.
For details on adb commands, refer to \url{http://code.google.com/android/reference/adb.html}
Where do I find the API?
For the API to use for the project, refer to
Android Overview
for class defined APIs, and Android Documentation for APIs
provided by Android SDK.
How to run servers with different configuration file.
./serv {filename}
By default it reads control.xml. You can specify the configuration
file you want to use by giving
the filename as a command line argument.
How many emulators should I run?
XML configuration file tells you the total number of androids (nodes attribute).
With that you can specifiy or figure out how many emulators you should run.
You have to bring up the specified number of emulators to make it running.
The FileSynchronizer thread does not start until all applications
have started on all emulators.
On starting multiple emulators on Eclipse, refer to the lecture note.
I have two copies of FileSynchronizerThread.
FileSynchronizerThread.java and FileSynchronizerThread_new.java
Sorry. Delete(ignore) FileSynchronizerThread_new.java.
I updated the tarball. It shoudn't have FileSynchronizerThread_new.java now.
Project 2
Project 2 should be done in groups of three.
- Project proposals are due on 3/19 in class. These should be about a page
that succinctly describe what you plan to work on, a rough timeline,
and a bit of the related work in the area.
- Final project writeups are due on 5/3 at 5pm.
- Project update meetings on 3/24, 4/6 and 4/23 -- signup sheets will be posted
- Groups of 3 are preferred
- Project ideas (CMU only)
You should strongly consider using either Subversion or CVS to perform source code
control for your project and your writeup describing it. I suggest
Subversion.
Last updated: Thu Apr 09 13:21:13 -0400 2009
[validate xhtml]