|
|
|
|
Project 1: Project Source Setup
Out: Monday March 26
Due: Wednesday April 4 (midnight)
Turnin: Online
Teams: Pairs
1. Fetch and Unpack the Source
The source is at /cse/courses/cse461/12sp/461projects.jar . Fetch a copy onto your
development machine and unjar it (jar xf 461projects.jar ). It will produce
a 461projects directory.
2. Establish an Eclipse Workspace
Eclipse probably created a default workspace for you (in a directory named workspace ),
and will open that one when you launch Eclipse. We want to use a different one.
Launch Eclipse. If you're asked what workspace to open, direct it to your
461projects directory. Otherwise, on the File menu, choose Switch Workspace, then Other... Browse to your
461projects directory. Close the Welcome tab, if that's what you see.
At this point you should see an empty Project Explorer pane in the upper left.
You need to import the three project 1 Eclipse projects.
Select the File menu, then Import...,
then expand General, select Existing Projects into Workspace, and hit Next.
For the root directory, browse to your 461projects directory, then OK. Three projects
should appear in the large text box. If they're not selected, hit Select All. Now hit Finish.
3. Fix the Absolute Paths Problems
You now have three Eclipse projects, but they have build errors because of an unfortunate
feature of Eclipse:
Eclipse embeds absolute paths into the metadata it keeps about jar files
required to build projects.
The absolute path to the jars on my development machine isn't the same as the absolute
path on yours, so you get build errors. We'll fix them.
Here are specific instructions for the util project:
- Right-click on the
util project, then Build Path, then Configure Build Path.
- Select the Libraries tab, then select the
org.json.jar entry and click the Edit button.
- Navigate to your
cse461projects/lib/ directory and select the org.json.jar
file you find there. Click OK to close any open dialog boxes.
You'll need to follow the same procedure for project timingframing . It requires
two jars, though (org.json.jar and commons-cli-1.2.jar ). Fix them both.
At this point you should have no build errors.
4. Launch the App in the Android Emulator
Right-click on project timingFramingAndroid ,
then Debug As, then Android Application. The first time you do this, no virtual phone exists, so
you will be asked to create one. Work through the creation dialogs, making sure to create a phone
that runs Android 2.3.3.
Right-click/Debug As again. Now that you have an emulator, it should come up. We've observed,
though, that a first attempt in an Eclipse session to launch the emulator sometimes results in a "Can't connect to adb" error.
If you see that, just try again, and it will work.
Okay, at this point the Android emulator should launch.
Drag the green lock icon to the right, wait a bit, and the Project 1 app will evidence itself.
You can simply kill the emulator's window to terminate it. (The application doesn't run at this point,
although you can interact with most of the UI.)
5. Launch the App on a Phone
To run on a phone, first make sure it has USB debugging enabled:
touch the grid of dots on the home screen to get the apps
page, then select the Settings app, then Applications,
then Development, then enable USB debugging. Hit the back arrow repeatedly to get back to the home screen, or
the home icon to get back directly, or just leave it where it is.
Connect the phone by USB to your machine.
The right-click/Debug As procedure used previously to launch the emulator will now launch the
app on the phone. (You may see a dialog asking what you want to do, run on an emulator or the
phone, but I think the default is to use the phone if its available.)
6. Generate Javadoc
The code is reasonably well set up to produce Javadoc documentation. There shouldn't be
much need for it in this project, though. (It might useful for the next one, though.)
Right-click on a project, then Export..., then expand the Java entry, and then click on Javadoc.
|