Download All Vocabulary Words Grouped in the Form of Virtual Notes
Total Page:16
File Type:pdf, Size:1020Kb
STUDYHIVE ANDROID APPLICATION A Project Presented to the faculty of the Department of Computer Engineering California State University, Sacramento Submitted in partial satisfaction of the requirements for the degree of MASTER OF SCIENCE in Computer Engineering by Tony Dinh SPRING 2014 © 2014 Tony Dinh ALL RIGHTS RESERVED ii STUDYHIVE ANDROID APPLICATION A Project by Tony Dinh Approved by: __________________________________, Committee Chair Dr. Jinsong Ouyang ____________________________ Date iii Student: Tony Dinh I certify that this student has met the requirements for format contained in the University format manual, and that this project is suitable for shelving in the Library and credit is to be awarded for the project. __________________________, Graduate Coordinator ___________________ Dr. Preetham Kumar Date Department of Computer Engineering iv Abstract of STUDYHIVE ANDROID APPLICATION by Tony Dinh There are many things that contribute to a student's success. Therefore, it is important to develop strong study habits and skills. We all know the key to successful studying isn’t cramming, but studying more efficiently. In order to study effectively, a possible solution is to provide a way for students to study on the go. By having their notes on their phone, it gives them the ability to study virtually anywhere. Mobile software applications now have many capabilities to create a learning tool for users to become more engaged and track their learning progress. For example, a mobile application can provide interactive quizzes or implement studying techniques that help them learn more efficiently. With this said, students can only benefit from this learning mobile applications. _______________________, Committee Chair Dr. Jinsong Ouyang _______________________ Date v ACKNOWLEDGEMENTS I would like to express my appreciation to Dr. Ouyang for his valuable and constructive suggestions during the development of this master project. His willingness to give his time has been very much appreciated. I would also like to express my appreciation to Sean Sohal and Paul Sohal of StudyHive for letting me use their website as a resource to develop this mobile application. vi TABLE OF CONTENTS Page Acknowledgements .................................................................................................................. vi List of Figures .......................................................................................................................... ix Chapter 1. INTRODUCTION ............................................................................................................. 1 1.2 Background of Project ........................................................................................ .. 2 1.3 Goals of the Project ............................................................................................ .. 2 2. REQUIREMENTS ANALYSIS ......................................................................................... 4 2.1 Login Specification ............................................................................................... 4 2.2 User Interface Specification .................................................................................. 4 2.3 Quiz Specification ................................................................................................. 4 2.4 Scoring Specification ............................................................................................ 5 3. ANDROID PLATFORM ................................................................................................ 7 3.1 Creating New Android Project ............................................................................... 7 3.2 Android Activity ................................................................................................... 9 3.3 Android XML Layout ......................................................................................... 10 3.4 Asynchronous Task ............................................................................................. 14 4. BACKEND IMPLEMENTATION................................................................................... 15 4.1 RESTful Web Service ......................................................................................... 15 4.2 JSON ................................................................................................................... 17 4.3 Information Storage ............................................................................................ 19 5. USER INTERFACE IMPLEMENTATION ..................................................................... 22 vii 5.1 Login Activity ..................................................................................................... 22 5.2 Main Activity ...................................................................................................... 25 5.3 Note Detail Activity ............................................................................................ 28 5.4 Simple Flashcard Quiz/Review Activity ............................................................ 31 5.5 Fill In Quiz Activity ............................................................................................ 32 5.6 Multiple Choice Activity .................................................................................... 37 5.7 Scrabble Quiz ...................................................................................................... 49 5.8 Progress Activity ................................................................................................. 44 6. CONCLUSION ................................................................................................................. 47 References ............................................................................................................................... 49 viii LIST OF FIGURES Figures Page 1. Score Calculation Equation…………………… ......... .………………………………. 6 2. New Android Application Wizard ………………….… . ……………………………. 8 3. Initial Activity Screen…………………… ..………….………………………………. 8 4. Android Activity Code ………………………….……… ... …………………………. 9 5. Fragment Code ………………………….……… ............. …………………………. 10 6. Android Layout XML Example ………………….……… …………………………. 11 7. RelativeLayout UI and XML …………………….……… …………………………. 12 8. LinearLayout UI and XML ………………………….……… .... ……………………12 9. FrameLayout UI and XML ………………………….……… ………………………13 10. AsyncTask Code ………………………….……… .......... …………………………. 14 11. RESTful GET Request Code …………………….……… ………………………….16 12. RESTful PUT Request Code …………………….……… …………………………. 17 13. Model Representation in Java and JSON ………….……… ... ………………………18 14. Gson Conversion from JSON to Java Object …….……… ………………………….18 15. SqlHelper: SQLite Initialization ……………….……… .. …………………………. 19 16. Access SQLite using SqlHelper Code …….……… .... …………………………. 20 17. Storing Java Object as JSON to Databases ….……… …………………………. 21 18. Login Activity UI and XML …….……… .................... …………………………. 22 19. Login Activity Code …….……… ................................. …………………………. 23 20. Invoking MainActivity …….……… ............................. …………………………. 24 ix 21. Main Activity and Navigation Drawer …….……… ... …………………………. 24 22. DrawerLayout XML …….……… ................................. …………………………. 25 23. Custom ArrayAdapter …….……… ............................... …………………………. 27 24. Initializing Custom ArrayAdapter …….……… .......... …………………………. 27 25. Passing Note to Next Activity Code …….……… ....... …………………………. 28 26. Note Detail Activity and XML …….……… ................ …………………………. 28 27. Retrieving Note From Previous Activity …….……… …………………………. 29 28. Creating Header View for ListView …….……… ....... …………………………. 29 29. Quiz Type Dialog Code and UI …….……… ............... …………………………. 30 30. Simple Flashcard Quiz Term and Answer ….……… . …………………………. 31 31. Dynamic View Size Based on Screen Size Code … .. …………………………. 32 32. FragmentManager Code and Object Animation XML … ………………………33 33. Sliding XML Animation Right …….……… ................ …………………………. 34 34. Fill In Quiz Activity and XML…….……… ................. …………………………. 35 35. Initialization of QuizViewPager …….……… .............. …………………………. 36 36. FillInPageAdapter Code …….……… ........................... …………………………. 36 37. Quiz Submission Code …….……… ............................. …………………………. 37 38. Multiple Choice Quiz Activity …….……… ................ …………………………. 37 39. DragOnTouchListener Code …….……… .................... …………………………. 38 40. ValidDragListener Code …….……… .......................... …………………………. 39 41. InvalidOnDragListener Code …….……… ................... …………………………. 40 x 42. Scrabble Quiz…….……… .............................................. …………………………. 40 43. Construction of Tile in ScrabbleQuiz Code …….……… ....... …………………. 41 44. Dynamic Answer Layout for Scrabble Quiz Code …….……… ……………… 42 45. Calculate Distance for Animation …….……… ........... …………………………. 43 46. Translation Animation Code…….……… ..................... …………………………. 43 47. Progress Activity and Chart …….……… ..................... …………………………. 44 48. Invoking Chart Output Activity Code …….……… .......... …………………………. 45 49. Data Population of Chart Activity …….……… .......... …………………………. 46 xi 1 1. INTRODUCTION There are many things that contribute to a student's success. Therefore, it is important to develop strong study habits and skills. We all know the key to successful studying isn’t cramming, but studying more efficiently. Cramming is not considered to be an effective studying technique since it