16
LIFE CLOCK Android Mobile Application By Tony Pagaduan www.MrElte.com

Life Clock

  • Upload
    lynda

  • View
    36

  • Download
    0

Embed Size (px)

DESCRIPTION

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. - PowerPoint PPT Presentation

Citation preview

Page 1: Life Clock

LIFE CLOCKAndroid Mobile Application

By Tony Pagaduanwww.MrElte.com

Page 2: Life Clock

SQLite DB Implementation

Page 3: Life Clock

Copy to Excel Spreadsheet

SSA Life Expectancy Table

Excel Spreadsheet

Page 4: Life Clock

Creating SQLite DB SQLite Database Browser

Free Software Written in Java

Page 5: Life Clock

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

Page 6: Life Clock

Placing SQLite DB into Project Place SQLite file into Assets Folder

Page 7: Life Clock

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

Page 8: Life Clock

Requesting Data from SQLite DB Defined Class DataBaseHelper

Extended from SQLiteOpenHelper

Simple SQL Query “SELECT _id, male FROM life WHERE _id = 22”

Page 9: Life Clock

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

Page 10: Life Clock

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 ChartEvery ReDraw : DrawArc is increased by 20

degrees until 360 is reached

Page 11: Life Clock

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

Page 12: Life Clock

New Additions to Life Clock Alert Dialog

Dialog Builder is createdSet a MessageSet an OK ButtonShow dialog

Page 13: Life Clock

New Additions to Life Clock Haptic Feedback

Phone Vibrates upon CalculationUtilizes Vibrate Operation

○ Need to set Vibrate Permissions in AndroidManifest.xml

○ Function vibrate(20 milliseconds);

Page 14: Life Clock

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

Page 15: Life Clock

Life Clock Demo

Page 16: Life Clock

Life Clock

The End Thank You

Please Visit www.MrElte.com

for more information