Added preferences for using the foreground app and

@michiel Could you review and merge? Can be tested with 
https://github.com/senseobservationsystems/sense-android-library/tree/feature_App_sensor