1 / 16

Life Clock

Android Mobile Application By Tony Pagaduan www.MrElte.com. Life Clock. SQLite DB Implementation. Copy to Excel Spreadsheet. SSA Life Expectancy Table. Excel Spreadsheet. Creating SQLite DB. SQLite Database Browser Free Software Written in Java. Formatting SQLite DB.

lynda
Télécharger la présentation

Life Clock

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android Mobile Application By Tony Pagaduan www.MrElte.com Life Clock

  2. SQLite DB Implementation

  3. Copy to Excel Spreadsheet SSA Life Expectancy Table Excel Spreadsheet

  4. Creating SQLite DB • SQLite Database Browser • Free Software Written in Java

  5. Formatting SQLite DB • Primary Key of table must be called ‘_id’ • Must create additional Android metadata table

  6. Placing SQLite DB into Project • Place SQLite file into Assets Folder

  7. Copying SQLite file to Android System • Every time App is opened • Checks if a database exists on Android System • If not: The SQLite file is copied from Assets Folder to the Android System • Using ByteSteam Operations • SQLite file coping process happens only once

  8. Requesting Data from SQLite DB • Defined Class DataBaseHelper • Extended from SQLiteOpenHelper • Simple SQL Query • “SELECT _id, male FROM life WHERE _id = 22”

  9. Updated Life Clock Calculation • Everyone is familiar with using “78.4” years with their project, instead use getLifeExp function • getLifeExp( age , gender ) • returns specific life expectancy • Add/Apply new life expectancy years to current date instead of birthdate

  10. New Additions to Life Clock • Animated Pie Chart • Utilizes Threads and Handlers Operations • Thread sends a message to Handler every 1/10 second • Handler ReDraws Pie Chart • Every ReDraw : DrawArc is increased by 20 degrees until 360 is reached

  11. New Additions to Life Clock • Menu Button • Need to define an XML layout • Put xml file into “menu” folder • Override Functions in Activity • onCreateOptionsMenu • onOptionsItemSelected • On Selection it creates a Dialog

  12. New Additions to Life Clock • Alert Dialog • Dialog Builder is created • Set a Message • Set an OK Button • Show dialog

  13. New Additions to Life Clock • Haptic Feedback • Phone Vibrates upon Calculation • Utilizes Vibrate Operation • Need to set Vibrate Permissions in AndroidManifest.xml • Function vibrate(20 milliseconds);

  14. New Additions to Life Clock • Shake to Calculate • Shake phone to start calculations • Utilizes Accelerometer • Set a Listener in SensorManager • Gravity is always acting on phone • Must calculate change in momentum • If momentum is greater than 5 units: start calculation

  15. Life Clock Demo

  16. Life Clock The End Thank You Please Visit www.MrElte.com for more information

More Related