Home -> Teaching -> CSAS Android

CSAS Android Workshop

The class meets MWF 12:00pm - 1:45pm
in the Math/CS Computer Lab Science Hall 222.

This "class" consists of a series of workshops to get a working knowlege of programming for the Android OS. The following list contains a few highlights and tidbits of information.

  1. PowerPoint on "Android" introduction
  2. Book used for the workshop: Android Programming: The Big Nerd Ranch Guide (Big Nerd Ranch Guides) [Kindle Edition]
  3. First project: GeoQuiz
  4. Second project: AddressBook
    • posted soon
  5. Third project: iBookmarks
    • Part 1: Project description and intial code. Copy the code from the project description or download the complete zipped project here. Unzip to your computer, start Eclipse, click "File | Import" and copy the Android project from the downloaded directory.
    • Part 2: We added "auto-saving to disk" to the code using a text file in the private storage segment dedicated to the app. We also added the beginning code to implement a "CAB" (context action bar). To get the complete updated source code, download the zipped project, part 2,and install it on your laptop.

      Homework: Implement the "add bookmark" feature by using another activity. You should be able to enter the title and url of your new bookmark, as well as preview the link in a "web view".

      For more on the iBookmark activity, including the complete source code, visit iBookmark.html ...

General Information

  • Students


  • JSON library
  • ava SDK
  • Eclipse
  • Android SDK
  • MainActivity.java and XMLData.java



  • Enable buttons to show different messages (via Toasts) when clicked
  • Create the layout for the GeoQuiz app
  • Install and configure Eclipse + Android SDK

  1. Fourth Project: CriminalIntent

In this project we will introduce "fragments". Fragments are an essential ingredient of all Android activities since "Honeycomb". In fact, every app should be written using fragments, not activities, even if the app does not utillize any of the advanced features of fragments. And you can utilize an external library to enable fragments for all Android versions above Foyo (2.2), so fragments are backwards compati[lClick here to download the Eclipse project file that sets up the project. Import it into Eclipse.

7. Fifth Project: Async Data Loading with JSON formatting: an SHU News Reader

First, we added "saving and loading" of data in JSON format to our CriminalIntent project. Check out the code contained in the following archive:

Seond, we modify our previous iBookmark project so that it loads data asynchronously from a public web document. Check, in particular, the class BookmarkLoader, which includes a lot of comments explaining how this class works.

  • Check Bookmark-web.zip to see how to properly move remote file loading to its own thread

For a complete project that downloads Seton Hall news and events in JSON format and shows that info in a kind of newsfeed reader, click here ... soon :-)

8. Gettting data from a JSON News Feed

coming up soon

9. Getting data from an XML Feed

Create a new project, create two classes named "MainActivity" and "XMLData". Copy the code, compile, and run. Then take the code in the true parser and replace your XML parser by that code. For more instructions, please download the complete project file, unzip, import into Eclipse, and run it. Each class has extensive comments, so you should be able to figure out how to use the class. Note that it easy to modify this project to read most XML files that contain 'records' of objects and the code should have sufficient comments to make sense of it pretty easilty.

(c) bgw