GithubHelp home page GithubHelp logo

morristech / researchstack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from researchstack/researchstack

0.0 2.0 0.0 17.91 MB

An SDK for building research study apps on Android.

Home Page: http://researchstack.org

License: Apache License 2.0

Java 100.00%

researchstack's Introduction

ResearchStack

ResearchStack is an SDK and UX framework for building research study apps on Android.

Be sure to check out researchstack.org and the ResearchStack forum for general information and announcements about the framework.

Documentation

Documentation is written and maintained using Javadoc:

Download

Add one or both to your app/build.gradle:

compile 'org.researchstack:backbone:1.1.1'
compile 'org.researchstack:skin:1.1.1'

You may also need to add the following source repos to your project's build.gradle:

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" } // for MPAndroidChart dependency, not on jcenter yet
    }
}

##Backbone

  • The core building blocks of Research Stack
  • Tasks, Steps, and Results
  • Consent
  • File/Database Storage and Encryption

##Skin

  • Framework/template that pulls together Backbone components to take most of the work out of building a ResearchStack app
  • Designed to work with minor changes to an existing ResearchKit™ iOS app's resources

##Examples

Things to look out for when converting your ResearchKit™ app

  • Assets can be dragged and dropped into the assets folder of your project.
  • Please make sure to validate and check for malformed JSON
  • Please make sure your links define a url in your HTML. An empty HREF attribute will reload the same file in a different activity.
  • ResearchStack adds attributes to the documentProperties object for consent. Additionally, ResearchStack also supports quiz conent define in the same json file. Please update your ConsentSection json file to reflect these changes. An example can be found in the SampleApp project.
  • Images can be defined in the same directory of an HTML doc or through android's drawable directories. You can do this using the following path as an example "file:///android_res/drawable/image_name.png". Please note, loading assets through drawable path breaks when using applicationIdSuffix in gradle.
  • CSS font-family attribute should be changed to what exists on the system (i.e. sans-serif, sans-serif-light, etc..).
  • You will need to implement a class that extends the ResearchStack class and pass an instance of it into ResearchStack.init() in your Application.onCreate() method
  • Inside your ResearchStack implementation you may need to return your own implementations of things such as ResourceManager to point to your own resources
  • Look at sample app for examples of all of this. Most of the resources were pulled from the Asthma iOS app and modified base on the above points.

Tasks and Steps

Tasks and Steps should function very similarly to Apple's ResearchKit™. Extend Task if you need to do something different with step order that's not in OrderedTask or SmartSurveyTask.

If you want to implement a custom Step, create a step and make getStepLayoutClass() return the Class of your own extension of StepLayout. This provides the View for your custom step and is responsible for creating the StepResult and passing it back up to the ViewTaskActivity.

If you just want a custom QuestionStep with an answer type that isn't supported yet, you will need to just create your own AnswerFormat subclass. All QuestionSteps use the same StepLayout, but the AnswerFormat provides a StepBody class that determines what the inner UI for the question looks like (date picker, text field, slider, etc).

Third-party libraries used

com.android.support:appcompat-v7
com.android.support:cardview-v7
com.android.support:design
com.android.support:preference-v14
  • Used for theming and styling views within the framework. Libraries also provide backward-compatible versions of Android framework APIs (e.g. vector icons, preferences)

com.github.PhilJay:MPAndroidChart

  • Charting library used to visualize data

com.android.support:multidex

  • MultiDex support library enables us to go past the default 65K method limit for an android project
co.touchlab.squeaky:squeaky-query
  • Squeaky is a Database ORM for Android, simplifying database functions and used to store Task / Step result information
co.touchlab.squeaky:squeaky-processor
  • Annotation processor for the Squeaky ORMLite database library. The library creates auto-generated code at compile time for our database pojos (see TaskRecord or StepRecord classes)
net.zetetic:android-database-sqlcipher
  • Enables full 256-bit AES encryption of SQLite database
com.scottyab:aes-crypto
  • API to perform AES encryption on Android, used within the FileAccess class to write raw data to disk
compile 'com.cronutils:cron-utils
  • Used to parse crons within the tasks_and_schedules json file and calculating system notification execution time
com.google.code.gson:gson
  • Parses and maps json to java objects, used for converting json files defined in raw resource directory
io.reactivex:rxandroid io.reactivex:rxjava
  • Used to compose asynchronous and event-based networking and database calls. Also used for event-based UI calls for varius UI widgets.
com.jakewharton.rxbinding:rxbinding-appcompat-v7
com.jakewharton.rxbinding:rxbinding-design
com.jakewharton.rxbinding:rxbinding-support-v4
com.jakewharton.rxbinding:rxbinding
  • RxJava binding APIs for Android UI widgets from the platform and support libraries. Provides helper methods that wrap API methods and returns Rx Observables
com.squareup.okhttp3:logging-interceptor com.squareup.retrofit2:adapter-rxjava com.squareup.retrofit2:converter-gson com.squareup.retrofit2:retrofit
  • Networking libraries used for network interface

researchstack's People

Contributors

wdziemia avatar bmcd avatar nrlakin avatar mikecarroll avatar kpgalligan avatar ericsiegnw avatar liujoshua avatar dephillipsmichael avatar dukemike avatar niklasnordmark avatar snti avatar crayne avatar wardweistra avatar jdkizer9 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.