added Preferences and MainActivity

preferences:
- code
- time1 - time4