Ractical Raining I Project Report On: A S O E A T
Ractical Raining I Project Report On: A S O E A T
Ractical Raining I Project Report On: A S O E A T
PROJECT REPORT ON
AN ANDROID APPLICATION LINKED TO GOOGLE APP ENGINE B TECH COMPUTER SCIENCE & ENGINEERING + MBA (2010-2015)
FACULTY GUIDE:
SUBMITTED BY: NAME: ENROLL NO: BATCH: NEIL MATHEW A2324710002 2010-2015
MS. SHANU SHARMA ASST PROFESSOR, CSE DEPT. ASET, AMITY UNIVERSITY
CERTIFICATE
This is to certify that Neil Mathew, student of BTech. Computer Science & Engineering + MBA, has carried out the work presented in the project of the Practical Training entitled AMIZONER: Attendance Planner on Android as a part of second year program of Bachelor of Technology in Computer Science and Engineering from Amity School of Engineering and Technology, Amity University, Noida, Uttar Pradesh under my supervision.
Ms. SHANU SHARMA Department of Computer Science Amity School of Engineering and Technology Amity University, Noida.
ii
ACKNOWLEDGEMENTS
This practical training as a part of the course curriculum has helped me immensely in understanding implementing software applications in Android. This work would not have been successfully implemented without the support of many who guided me in various stages of implementation and testing. I acknowledge their kind support. I thank our Director General Dr. Balvinder Shukla and our Head of the Department Dr. Abhay Bansal for their direction and keenness in including Practical Training as an important aspect of the curriculum and constantly guiding us all. I also extend my gratitude to Mr. KamalKant Ahirwar, for continuous encouragement. Last but not the least, I would like to thank Ms. Shanu Sharma, my mentor and project guide, for her guidance and whole hearted support in the making of this project. I am thankful to her for giving me her valuable time and attention providing me directions for completing my project in time. Without her, this project would be a distant reality.
Neil Mathew BTech CSE + MBA (2010-2015) Enrollment No: A232471002 Amity University
iii
ABSTRACT
Amity University has an excellent Student Information Portal and all Amity students use the same frequently. Attendance monitoring is one of the key issues students are concerned with. An easy and convenient way to access the Student Portal for updated information on attendance was in my mind for some time. AMIZONER is an android-based application which has the following features: logs in to www.amizone.net parses attendance details stores it locally in the phone on SQLite database works offline based on the data thus stored and finally displays the computed information in a user-friendly manner Besides what is provided in Amizone, my application introduces more information for the user, and shows it in a more convenient and concise manner. AMIZONER was designed as an application to meet every students needs when it came to attendance. This application has been a product of various technologies. It establishes a secure connection with Amizone and with the users id and password, logs in using an HTTPS Post. It then extracts the required information about the student from the retrieved pages using HTML parsing and stores the same using the phones local database, SQLite. Then, using the Android platform, the information collected is displayed to the user in an organized, concise and convenient manner using various visual means to highlight the courses based on its attendance percentage (using XML to design these pages and JAVA to programmatically update them with the computed values). Also, the application connects to the server for updates (running on Google App Engine using Python as its language).
iv
TABLE OF CONTENTS
CERTIFICATE ................................................................................................................... ii ACKNOWLEDGEMENTS ............................................................................................... iii ABSTRACT ....................................................................................................................... iv TABLE OF CONTENTS .................................................................................................... v TABLE OF FIGURES ...................................................................................................... vii LIST OF ABBREVIATIONS .......................................................................................... viii CHAPTER 1: INTRODUCTION ..................................................................................... 1 1.1 1.2 1.3 ABOUT THE PROJECT ..................................................................................... 1 MOTIVATION .................................................................................................... 1 SCOPE ................................................................................................................. 2
CHAPTER 2: MATERIALS AND METHODS ............................................................... 3 2.1 2.2 METHODOLOGY ............................................................................................... 3 SOFTWARE & HARDWARE REQUIREMENTS ............................................ 4
2.2.1 DEVELOPMENT .............................................................................................. 4 2.2.2 SERVICES ........................................................................................................ 4 2.2.3 USER ................................................................................................................. 5 2.3 IMPLEMENTATION AND TECHNOLOGIES USED...................................... 5
2.3.1 HTTPS POST & GET ........................................................................................ 6 2.3.2 HTML PARSING ............................................................................................... 8 2.3.3 SQLite DATABASE .......................................................................................... 9 2.3.4 ANDROID DEVELOPMENT ......................................................................... 10 2.3.5 SERVER-CLIENT COMMUNICATION ....................................................... 12
2.3.6 MONITORING APPLICATION USAGE ....................................................... 13 2.3.7 MONETIZING WITH ADVERTISEMENTS ................................................. 14 CHAPTER 3: RESULTS AND DISCUSSION .............................................................. 15 CHAPTER 4: CONCLUSION & RECOMMENDATIONS .......................................... 22 CHAPTER 5: IMPLICATIONS FOR FUTURE RESEARCH ...................................... 24 REFERENCES ................................................................................................................. 25
vi
TABLE OF FIGURES
FIG 1-1 SOFTWARE DEVELOPMENT CYCLE ......................................................................... 2 FIG 2-1 HTTP POST ...................................................................................................................... 6 FIG 2-2 HTTPS GET ...................................................................................................................... 7 FIG 2-3 MY COURSES .................................................................................................................. 8 FIG 2-4 ONE COURSE CODE SNIPPET ...................................................................................... 8 FIG 2-5 URL FOR ATTENDANCE DETAILS ............................................................................. 9 FIG 2-6 TABLE I : USERPASS ..................................................................................................... 9 FIG 2-7 OTHER TABLES USED ................................................................................................ 10 FIG 2-8 ACTIVITY EXAMPLE................................................................................................... 11 FIG 2-9 PROGRESS DIALOG BOX ........................................................................................... 11 FIG 2-10 AMIZONER: SELFDESTRUCT .................................................................................. 12 FIG 2-11 GOOGLE ANALYTICS SCREENSHOT..................................................................... 13 FIG 2-12 ADMOB REPORTING SCREENSHOT ...................................................................... 14 FIG 3-1 GOOGLE PLAY APPLICATION ERROR REPORTS ................................................. 16 FIG 3-2 AMIZONER: HOME ...................................................................................................... 17 FIG 3-3 AMIZONER: MY COURSES ......................................................................................... 17 FIG 3-4 AMIZONER: SPECIFIC COURSE ................................................................................ 18 FIG 3-5 AMIZONER: ATTENDANCE ....................................................................................... 18 FIG 3-6 AMIZONER: TIMETABLE ........................................................................................... 19 FIG 3-7 AMIZONER: HOLIDAYS .............................................................................................. 19 FIG 3-8 APPLICATION PACKAGE EXPLORER(ECLIPSE) ................................................... 20 FIG 3-9 METRICS: ACTIVITY CLASSES ................................................................................. 21 FIG 3-10 METRICS: TOTAL LINES OF CODE......................................................................... 21 FIG 4-1 GOOGLE PLAY USER DEVICE GRAPH .................................................................... 22 FIG 4-2 GOOGLE PLAY TOTAL USER INSTALL GRAPH .................................................... 23 FIG 5-1 AMIZONER: SPLASH SCREEN ................................................................................... 24
vii
LIST OF ABBREVIATIONS
API GAE GB HDD HTML HTTP HTTPS ICS IDE OS RAM SDK SSL XML
Application Programmer Interface Google App Engine Ginger Bread (Android Operating System) Hard disk drive Hypertext Markup Language Hypertext Transfer Protocol Hypertext Transfer Protocol Secure Ice Cream Sandwich (Android Operating System) Integrated Development Environment Operating System Random-Access Memory Software Development Kit Secure Sockets Layer Extensible Markup Language
viii
Chapter 1 INTRODUCTION
1.2 MOTIVATION
Attendance monitoring has been one of the key issues students are concerned with. Earlier I had created an algorithm which calculates the number of classes one must attend or can skip to maintain his target attendance percentage. I felt the need for creating an application which combined this both so that the student is always aware of his or her situation and is informed through concise, convenient and organized pages.
1.3 SCOPE
The scope of the project included developing an application on android platform to understand the nuances of software application development, testing, distribution, version control, etc as a part of Practical Training I. It is important to have insight into making of a software application following the Software Development Cycle that included a series of phases and iterations. This development cycle can be applied to any product at any point in its lifetime; the cycle works for developing new products as well as maintaining already developed products.
The project involved all the steps of the development cycle namely Business Modeling, Planning, Finalization of Requirements, Analysis and Design, Implementation, Testing, Deployment and Evaluation. The AMIZONER application development took
approximately 40 iterations, progressively adding features, correcting bugs, improving user experience etc. Further, areas of analytics of users and usage of the application,
2.1 METHODOLOGY
The objective was to create an Android Application that could perform the following: Connecting to an HTTPS site (Amizone) through GPRS/WiFi. Opening the relevant html pages using HTTP POST & GET. Parsing the student info/course/attendance data logically. Creating a local database for offline view. Creating a user-friendly interface with proper highlighting using XML. Creating an efficient navigation design and making it compatible with all Android API versions and devices. Connecting the application with my personal server (Server-Client
Communication) for updates using Google App Engine to host the server. Deployment and usage analysis using Google Analytics Monetization through advertisements using Google Admob
2.2.1 DEVELOPMENT
Hardware Requirements Software Requirements
Laptop with following specs was used for development o Processor: Intel Core 2 Duo P8600 (2.4GHz), o Memory: 3GB - 2DIMM DDR3 o HDD: 320GB 7200rpm o Graphics: ATI Mobility
Eclipse with Java SDK & Android SDK & Android Emulator
CorelDRAW X4 Google App Engine Launcher Python SDK Google Analytics SDK AdMob platform SDK
RADEON HD 3670 (512MB) o Display: 14.0" 1080p Full HD RGBLED LCD with 2.0 MP Webcam OS: (32bit) Windows 7 Professional
2.2.2 SERVICES
Hardware Requirements Software Requirements
No Hardware Required
Amizone https://amizone.net/ Google App Engine https://appengine.google.com Google Analytics https://analytics.google.com Google Admob https://admob.com
2.2.3 USER
Hardware Requirements Software Requirements
Android-enabled Mobile Phone For User Testing and Review, the following were used: o Samsung Galaxy SII o Sony Ericsson Xperia Mini Pro o Samsung Galaxy Tab o HTC Hero
Android
OS
with
minimum
Using these methods, the html codes of the following pages are retrieved: My Courses, My Faculty, Attendance Details of each Course and Time Table. In the HTTPs POST, certain parameters should be sent. Besides the username and password, there were hidden parameters as well. Them being: __EVENTTARGET __EVENTARGUMENT __VIEWSTATE __EVENTVALIDATION
The Username and Password is given by the user of the android application but hidden parameters were browser generated. Using a HTTP Get, I retrieved those values from source code and sent them back in the HTTP Post.
There was also a need to study SSL and Trust Managers. An https page uses SSL protocol. I had to configure the android app to accept Amizones digital certificate since it did not recognize it. This ensures a unique session between the user and the server, ensuring security in the login and retrieval process.
To show how parsing was implemented in my application, Ive added a screenshot of the My Courses page of Amizone. This is the table within that page which provides us with the immediate details of each course. Consider a single row, that is the information about a single course. The details of this course, say Computer Graphics (highlighted by red in the above diagram) needs to be extracted. Below is that rows respective source code. All the information required is
available to us. All we need to do is retrieve specific values (highlighted by green in the below diagram) using string functions.
Also, the next pages (attendance details of each course) can be found from the extracted values as well. From there, we can programmatically retrieve for each course.
Table I : UserPass :This table stores the login details and preferences of the user. Table II: MyCourses: This table stores the course information. Table III: CourseTeacher: This table stores the faculty assigned to course. Table IV: AllTeachers: This table stores the faculty information.
9
Table V: AttendanceLogs: This table stores the attendance logs of all courses. Table VI: TimeTable: This table stores the timetable.
When making an android application, a lot of things have to be considered, such as, Screen size and density Input configurations Device features Platform Version
Every user will have a different device (which in turn implies different screen sizes and hardware) and in turn, a different Android OS. It is my task to ensure that the application is compatible with all devices which install my application. Besides design and compatibility, I also had to learn advanced programming concepts like threads and asynchronous tasks to implement the progress dialog box of my application. After many repeated trials and errors, I finally managed to create a non-UI thread which can handle the syncing process and be minimized so that the user does not need to wait directly for it to complete. He or she may partake in other activities while the process continues in the background. On completion, the current page is refreshed with the new values.
11
The Yes message, as I call it, is the message which allows the syncing process with Amizone and informs the user of any new updates. By changing this value on my server, I can ensure every user of this app will be informed when they update. The No Message is to block the syncing process with Amizone and display my customized error message. This is to be done when Amizone changes its html code and possibly create some parsing errors. The Destruct Message is a more intense form of the No Message. This not only blocks the syncing with Amizone, but rather prevents the user from using any feature of the application. This was done to force that the user to update his version.
My server-side application (amizoner.appspot.com) is hosted on Google App Engine, and the messages are part of a validation page which I make my application direct to. This ensures the very latest version is run on all devices.
Google App Engine (GAE) is a unique hosting platform that lets you build applications and run them in Googles data centers using the massive global infrastructure built to run the Internets most powerful company.
12
I also needed to study some rudimentary python to help me with redirection of URLS for my server. GAE has a lot of potential and I intend to go more deeply into this next time.
Sales and usage analytics let companies monitor and understand client actions and preferences. I was white listed for usage of recently released Version 2 and therefore I have quickly adapted the application to Version 2 which has several advanced analytics features.
13
14
AMIZONER, as an application, has been developed, tested and successfully distributed on the market (Google Play). It is now available for download by all Amitians. I intend to learn from the feedback and also take this as an opportunity to learn marketing skills which I will require in the fulfillment of my MBA degree. Developing this application has enabled me to study many concepts and technologies which I can use to create robust applications following a systematic software development cycle.
Briefly put, the learnings have been as follows: Android Development Compatibility with various Android versions Transition Animations XML Designing Dynamically creating layouts using Java Backend Java programming
Client-side communication Syncing with Amizone Syncing with personal server hosted on Google App Engine Parsing source code to retrieve specific information Create a secure connection (SSL protocols)
Server-side communication Creating a server using GAE (Python) Communication with Android Device
15
Local database management Designing ideal schema Indexing and creating relationships between tables Proper retrieval, storage, and updating of the same
Advertising and Monetizing Adding Advertising to understand monetization of apps Publicizing the app on Facebook, Twitter, etc
Analysis of User and Usage Using Google Analytics to track app usage Uploading the application on Google Play (Google Market)
Application Testing Network Connectivity Errors Database management Errors Async Tasks and Threads Errors Navigation within Activities Errors Dynamic Layout Creation Errors And many prevalent bugs of Android (early APIs)
Below is a screenshot of the application error reports provided by Google Play when a user chooses to send the error reports.
16
AMIZONER was made with the intent of helping students keep track of their attendance and be warned when it falls short. This has been accomplished. A screenshot of each task in progress is shown, with its respective explanation kept brief to catch the imagination of the reader.
LOGIN AND UPDATE Taking Username and Password from the student, it performs a login into Amizone. Once logged in, it extracts the required attendance details from specific pages and stores them into a database. The Syncing process with Amizone can minimized so that the user does not need to wait for the update.
FIG 3-2 AMIZONER: HOME
MY COURSES The student can specify the target percentage which they wish to maintain. In the screenshot, the Desired percentage is set to 95%. The courses will be displayed, as shown, coloured red or green whether they cross their target percentage or not. When a course has been tapped, more details of the same will be displayed.
FIG 3-3 AMIZONER: MY COURSES
17
TAP COURSE FOR MORE INFO Besides the percentage attendance, it also displays the No. of classes one needs to attend to attain Target percentage. This is found using an algorithm I designed which does not need the total number of classes. It shows the teachers cabin no incase the student needs to clarify his uploaded attendance. It provides provisions to modify and store it. It also shows the attendance log with reformatted dates.
FIG 3-4 AMIZONER: SPECIFIC COURSE
END OF DAYS The End Of Days is a date-wise search of the attendance logs of the student. After a tiring day, the student need only click a button and see the days attendance on one page rather than checking each and every course on amizone. Each course can be tapped to show more details about the same. These courses of the day are sorted according to the the timetable.
FIG 3-5 AMIZONER: ATTENDANCE
18
TIME TABLE The Time Table is shown day wise, with a fast clean user-interface. The day can be easily changed by clicking on the spinner control provided at the top of the page. Each period shows the courses FULL name, where Amizone shows its short form. Each course has a time slot and its classroom mentioned. On tapping a course, more details are shown.
FIG 3-6 AMIZONER: TIMETABLE
THE HOLIDAYS Hostlers have a need to book tickets to go home in advance. This page helps them plan that. This page displays both the calendar view and list view of all the holidays of the present year. The holiday list is not restricted to that of India alone, but is available also for the students studying in Amity University of Singapore, UK, US, and Dubai.
FIG 3-7 AMIZONER: HOLIDAYS
19
The following screenshot displays the Eclipse Package Explorer. This includes the java codes under the src folder, the animation xmls under res/anim folder, the images and styles in xml used under res/drawable folder, the external jar files used under libs folder and finally the layout xmls under the layout folder.
20
The AMIZONER Application was analyzed using the Metrics 1.3.6 plugin of Eclipse. A total of 30 classes were made for achieving the desired outcomes from the application and a total of 164 methods were used. Here, the total lines of code only include nonblank and non-comment lines in a compilation unit.
21
The development experience during the summer vacation has been very exciting and rewarding. The project has enabled me with skillsets in leveraging the Eclipse with Android SDK development environment. I have been able to use Android Developer Tools, Java IDE for developing, debugging, and packaging Android apps. The project prompted me to register my own domain name (www.metalwihen.com) and host the same in Google App Engine. I believe that Google App Engine (GAE) with Android will offer a developer the best of both worlds: server side and client side apps. I also ended up taking an account in Google Play as a part of this project which give insights into Android application distribution.
22
The outcome of this summer assignment has elevated me to a higher level of understanding of a number of aspects of IT product delivery with respect to android platform. I hope to continue my efforts in this space taking live projects from Industry, for which I would request the support of the Amity faculty and placement cell. As of now, the application retrieves information about the user by parsing specific pages of www.amizone.net. However, this causes the syncing process to be rather slow as it needs to perform an HTTP Get for each page (over 20 pages are being parsed for the required outputs). If Amity was to provide the APIs to access the portal database, I would be able to create a single direct connection and the time taken for the syncing would decrease dramatically ensuring user satisfaction. There is also potential in creating CRON jobs in the GAE to do the parsing instead of the android phone itself. If accomplished, the mobile can access the retrieved values from my server making the syncing faster.
23
Applications in Android platform are growing at unimaginably high pace. Android has rapidly become the fastest-growing mobile OS with largest installed base. Every day more than 900,000 new Android devices are activated worldwide. Androids openness has made it a favorite for consumers and developers alike, driving strong growth in app consumption. Android users download more than 1 billion apps and games from Google Play each month. With its partners, Android is continuously pushing the boundaries of hardware and software forward to bring new capabilities to users and developers. For developers, Android innovation lets us build powerful, differentiated applications that use the latest mobile technologies. Google Play is the premier marketplace for distributing Android apps. I propose to continue my development activities in Android, Java and Python to be part of the ongoing Innovations happening in the Industry. I also would seek to found a company to slowly build on Android development leveraging Google App Engine. I hope to work under the guidance and facilitation of the Amity faculty to interact with the Industry (both Developer community and Hardware
manufacturers) for enabling me to undertake Live projects as per requirements of the Industry.
FIG 5-1 AMIZONER: SPLASH SCREEN
24
REFERENCES
[1] H. Schildt, The Complete Reference: Java, New Delhi: Tata McGraw-Hill Publishing Company Limited, 2007. [2] M. L. Murphy, The Busy Coders Guide to Android Development, NEW DELHI: CommonsWare, LLC, 2009. [3] D. Flanagan, Java Examples in a Nut Shell, Sebastopol: O'Reilly & Associates, Inc, 1997. [4] D. Koosis, Java 2 Programming for Dummies, New Delhi: IDG Books, India Ltd, 2000. [5] "Stack Overflow," [Online]. Available: http://stackoverflow.com. [Accessed June 2012]. [6] "Android Developer Site," [Online]. Available: http://developer.android.com. [Accessed June 2012]. [7] "Wow Java Blog," [Online]. Available: http://wowjava.wordpress.com. [Accessed June 2012]. [8] "Vogella Tutorials," [Online]. Available: http://vogella.com. [Accessed July 2012]. [9] "Android Coding Blog," [Online]. Available: http://android-coding.blogspot.in. [Accessed July 2012]. [10] "Android Snippets," [Online]. Available: http://androidsnippets.com. [Accessed June 2012]. [11] "Learn It Stuff Blog," [Online]. Available: http://learn-it-stuff.blogspot.in. [Accessed June 2012].
25