Skip to content

Storybook Experiment Tutorial

cesine edited this page Sep 30, 2013 · 15 revisions

Background

This tutorial lists the steps to create a new storybook app using a CSV file and an R script.

Audience

Researchers who wish to collect video/audio data using image and audio stimuli.

Steps

A screencast of the following steps can be viewed at http://www.youtube.com/watch?v=DJrwBhu0AO0.

  1. Install Git (http://git-scm.com/downloads), Smartgit (http://www.syntevo.com/smartgithg/), R (http://www.r-project.org/) and ADT Eclipse (http://developer.android.com/sdk/index.html).
  2. Download the tutorial (clone the iLanguage/OPrime git repository): open smartgit; select clone repository; copy the HTTPS URL from the Github; select a place to save (ideally in git).
  3. Navigate to the stimuli folder in the OPrime-Android-Tutorial project folder.
  4. Save image and audio files into the stimuli folder. File names must not have spaces!
  5. Edit the csv file (sample_stimuli.csv) with the correct file names in the corresponding image and audio columns. NB: the order of the files in the csv determines the order in which they will appear in the app. Names in csv must be identical to file names (including case and file extensions).
  6. Save the csv file with a new name to the stimuli folder. Take note of the new name!
  7. Open the create_new_stimuli.R file in a text editor. In the first line, change the file name from "sample_stimuli.csv" to the name of your saved csv file. Keep the file open for later.
  8. Open R. Set working directory to the stimuli folder. Ex: setwd("/home/USER/git/OPrime/OPrime-Android-Tutorial/stimuli")
  9. Double-check new working directory with getwd()
  10. Copy and paste all code from create_new_stimuli.R (from the text editor) into R. Press Enter.
  11. Open Eclipse. If opening Eclipse for the first time, click File --> New --> Project. Select Android --> Android Project from Existing Code. Click Next. Click Browse and select the OPrime directory. Click Finish.
  12. Right-click on OPrimeStorybookExperimentTutorial and select Run as... --> Android Application. Make sure to have an Android device connected to your computer.

Troubleshooting

If Eclipse reports errors when trying to run as Android Application:

  1. Double-check file names to make sure they match the names in the csv file.
  2. Double-check the name of the csv file in the R code (create_new_stimuli.R).
  3. Make sure you are in the correct working directory in R (the OPrime/OPrime-Android-Tutorial/stimuli folder).

Results

A storybook app for Android devices which displays images with corresponding audio (and a page-turning animation), and which records audio/video data.

Where to go from here

Make different apps with different stimuli.

References

http://step.psy.cmu.edu/scripts-plus/