Skip to content

Latest commit

 

History

History
81 lines (61 loc) · 3.72 KB

README_changing_surveys.md

File metadata and controls

81 lines (61 loc) · 3.72 KB

Adding or changing the surveys used by the Android App

Both the Galaxy Zoo Android app and its web UI (clients) must know what surveys to use and must have a local copy of all questions and answers (decision tree), their icons and the URLs of their example images. Although the server can make new surveys available, the server does not tell the clients what survey's subjects to request and does not tell the client what decision tree to use.

Config

The survey IDs are listed here:
https://github.com/murraycu/android-galaxyzoo/blob/master/app/src/main/java/com/murrayc/galaxyzoo/app/provider/Config.java#L79

The true/false parameter there indicates whether new subjects should be requested for that group. Old surveys should stay in this list for a while with "false" for that parameter, just so we can still show the questions and icons for any cached subjects.

We must also specify which question is the "Do you want to discuss this?" question so we can handle that specially.

Decision Tree

The decision trees are XML files here:
https://github.com/murraycu/android-galaxyzoo/tree/master/app/src/main/assets/decision_tree
For instance:
https://github.com/murraycu/android-galaxyzoo/blob/master/app/src/main/assets/decision_tree/goods_full_tree.xml

These XML files are generated by a fork of the Galaxy Zoo web UI when run locally. (click the murrayc link to see the generated XML in the browser):
https://github.com/murraycu/Galaxy-Zoo

Yes, this is hacky. Improvements would be welcome, particularly if they can be merged with the regular Galazy Zoo web UI code.

Icons

Each question has small icons for each answer button and small thumbnail icons for each example image in the questions' help screens. These are here:
https://github.com/murraycu/android-galaxyzoo/tree/master/app/src/main/assets/icons

The names correspond to the names used in the CSS file provided by the Galaxy Zoo web UI. For instance:
https://github.com/zooniverse/Galaxy-Zoo/blob/master/css/common.styl#L146

These icon files can be generated by some usually-commented-out code in the Android App - particularly loadFromNetwork():
https://github.com/murraycu/android-galaxyzoo/blob/master/app/src/main/java/com/murrayc/galaxyzoo/app/IconsCache.java#L95

You can then extract the icon files from your (emulated) Android device with the Android Device Monitor, from
/storage/sdcard/Android/data/com.murrayc.galaxyzoo.app/cache/
and copy them into the source code.

Yes, this is hacky. This should probably be some separate Java code or some CoffeeScript code in the Galaxy Zoo fork.

The icons are usually small images extracted from a large image file such as this:
https://github.com/zooniverse/Galaxy-Zoo/blob/master/public/images/workflow.png
and this:
https://github.com/zooniverse/Galaxy-Zoo/blob/master/public/images/examples.jpg
but some newer surveys might use the actual large example images, expecting us to scale them down when using them as icons. This would be very inefficient, so we can scale them manually. For instance, by using ImageMagick like this on Linux:
mogrify -resize 100x100 icon_goods_full-*

Testing

The IconsCacheTest will check that you have added all the necessary icons and example images:
https://github.com/murraycu/android-galaxyzoo/blob/master/app/src/androidTest/java/com/murrayc/galaxyzoo/app/test/IconsCacheTest.java

If it fails then there might be a problem with the decision tree, the icons, or the CSS on the regular Galaxy Zoo web UI:

  • The decision tree might specify the wrong number of example images.
  • The CSS might not mention the example image or there might be a typo in its mention.
  • There might be a typo in the filename of the example image.

For instance:
zooniverse/Galaxy-Zoo#190