RAIK183H Fall 2011

crookedabidingMobile - Wireless

Nov 12, 2013 (4 years and 1 month ago)

75 views

RAIK183H

Fall 2011


Homework Assignment 0:


Picture Organization and Tagging


Objectives


1.

Become familiar with

control flow statements

a.

For or while loops

b.

If
-
then
-
else or case statements

2.

Gain exposure to Java syntax, programming styles, and Java classes

3.

Gain an understanding of basic programming in Android


Problem Description


An Android mobile development company has developed an application to allow users to take
pictures of different plant and animal specimens and
conveniently save information about t
hem
.
However, the company has received complaints that the application does not allow use
r
s to
easily browse through different pictures of specimens. So, you

have been hired to provide a
solution to this problem.


Using control flow statements
,
you must divide the pictures into categories based on labels
attached to the pictures
. For example, pictures may be tagged as “mammals”, “reptiles”, or “
wild
flowers
” and you must implement methods to group these pictures by their respective labels.


To perform this task, you must implement two methods in the Group.java class. They are
addToTypeArray(String path, String type) and addToCategoryArray(String path, String Type).
In the Group.java class, there will be a plants array, an animals array, and a
n array for each type
of animal and each type of plant. Your task will be to add the filenames of the pictures to these
arrays based on the tags attached to the file names. You will not directly be changing how the
pictures themselves are displayed because

this has been done for you; as long as you correctly
group the pictures, they will display as such.


The labels for animals are mammals, reptiles, amphibians, fish, birds, and invertebrates. The
labels for plants are wild flowers, garden and house plants,

trees and shrubs, cacti and succulents,
grasses and ferns, fruits and vegetables, and aquatic and semi
-
aquatic plants.


The final product for the application should allow users to choose a type of plant or animal from
a dropdown menu when browsing through

pictures. Their selections act as a filter for which
pictures will be displayed. For example, if the user selects the type “Mammals”, then only
pictures of mammals will be displayed on the screen. Whenever the user changes the dropdown
menu, the pictures
will change as well.


To complete this assignment, you must download the BioData.zip file from the course webpage,
which will provide you with all of the source code for the application.
Group
.java has been
provided for you to implement your methods to
gro
up

the pictures. Make changes ONLY to this
file.

Additionally, in BioData.zip, you will find a folder with sample pictures for the app. If you
do not already have an SD card image for your emulator, follow the instructions at
http://www.streamhead.com/andr
oid
-
tutorial
-
sd
-
card/ to learn about using one. Once you have an
SD card image, push all of the sample pictures and the pictures.txt file onto the image. This will
provide you with sample pictures and data for each picture.


Extra Credit


In

the Group.java

class, each array has its own counter. However, it can be done with fewer.
Implement the Group.java class in such a way that it does not use a counter variable for every
single array.


Submission Procedure


It is highly recommended that you read the gradi
ng policy and grading guidelines on the course
website for a complete explanation of how the assignments will be graded. Remember, your
program should follow a good programming style, include plenty of comments


both inline
documentation and
Javadoc

docum
entation, and perform all of the functionality outlined above.
Also, in the welcome page of your program, state whether you are implementing the
extra credit

functionality.


There are two submission steps:

1.

After completing your changes to the
Group
.java file and creating your README files,
compress all of your java and class files (as well as your README) into a file named
BioData.zip. Submit this file online at the CSE handin website: http://cse.unl.edu/handin

2.

Submit a
stapled

paper copy of a
cover
sheet
,
Group
.java,
and your
README
file.