AccelerationandOrientationMultisensorPedometerApplicationDesignandImplementationontheAndroidPlatformWangHongmanNationalKeyLab.ofSwitchingTechnologyandTelecommunicationNetworks,BeijingUniversityofPostsandTelecommunications,Beijing,Chinawanghm@bupt.edu.cnZhuXiaochengNationalKeyLab.ofSwitchingTechnologyandTelecommunicationNetworks,BeijingUniversityofPostsandTelecommunications,Beijing,Chinaxiaocheng.cherry@gmail.comChangJiangboShanghaiCINTelIntelligentTelecomSystemCo.,Ltd,Beijingbranch,Beijing,China,Jiangbo.chang@cintel.com.cnAbstractThispaperpresentsanAndroidplatform’spedometerapplicationdesignwhichusesSOLitedatabasetoprovidethehistoricaldataqueryfunctionandbasesontheaccelerationsensorandtheorientationsensor.ThispaperfirstintroducesthebackgroundoftheapplicationandtheprincipleofAndroidplatformpedometer.Inaddition,italsoanalyzesandcomparesthedifferentdesignbetweenthesingleaccelerationsensorpedometerandthemulti-sensorpedometer,whichprovestheadvantageofthisdesign.Andthen,onthisbasis,thispaperdescribesthreemainfunctions’designswhicharestepcountfunction,historyqueryfunctionandhealthtestfunction..Thispaperalsodescribestheimplementationandresultsofthisapplicationdesignandprovesthedesign’sfeasibilityandcorrectness.Keywords-Android;Sensor;StepsCalculationPrinciple;PedometerI.INTRODUCTIONInthousandsofyearsago,walkwascalledman'sbestmedicinebyHippocrateswhoisthefatherofmedicine,andtheWorldHealthOrganizationexplicitlypointedoutthattheworld'sbestsportistowalk.in1992.Withthedevelopmentofsociety,peoplepaymoreattentiontomakinglifehealthy,andwalkingtools-pedometerisbecomingmoreandmorepopular.Atpresent,manyentitativepedometerequipmentshavealreadyappearedinthemarket,suchasCitizen,Omronandsoon.Nowadays,suchentitativepedometersaremainlydividedintotwokinds--mechanicalandelectronic[1].Mechanicalpedometermakesuseofthevibrationgeneratedbyhumanwalkingtomakepedometerinternalspringlaminationorelasticballvibrationtoproduceelectronicpulse.Andthen,internalprocessorjudgestheelectronicpulsetoachievecountstepsfunction.Thecostofthismechanicalpedometerislower,butitsaccuracyandsensitivityareverylow.Electronicpedometermakeuseoftheaccelerationsensor[2]madebythenewtechnologywhichisthecombinationofMEMS[3]andCMOS[4],suchasADXL330,ADXL340,measuretheaccelerationofthehumanwalkingtocountsteps.Withdevelopmentofmobilenetwork,peoplewanttoachievemoretoolssoftwareimplementationonmobilephonesforconvenience.Android[5]mobilephoneplatformisopenenoughtomeettherequirements..TheexistingAndroidplatformpedometerusuallyusesthesingleaccelerationsensortocountwalkingsteps.Accordingtothehumanbodywalkprocess,Pedometerestablishescountstepsmodelthroughanalyzingtheregularityofaccelerationchangeinthegravitydirection.Butonlyusingtheaccelerationdatacollectedbysinglesensorisdifficulttoaccuratelyreflectaccelerationchangesinthegravitydirection.Thispaperdiscussesapedometerapplicationmakinguseofbothoftheorientationsensorandtheaccelerationsensor,inwhichorientationsensormapsaccelerationtothegravitydirectiontoachievetheaccurategravityaccelerationchange.II.ANDROIDPLATFORMPEDOMETEROVERVIEWA.AndroidOverviewAnnouncedbyGoogleinNovember5,2007,Androidisanopen-sourcemobileoperatingsystembasedonLinuxplatform.Thisplatformiscomposedoftheoperatingsystem,themiddleware,user’sinterfaceandapplicationsoftware.Atpresentthelatestversionis3.0.ThegreatestcharacteristicofAndroidisopen-sourcewhichmakesapplicationdevelopersmasterthedevelopmentdetailsmoreaccurately,anddevelophigherlevelandmorediscriminatingapplications.Androidplatformusessoftwarestackstructurewhichismainlydividedintothreeparts.ThebottomlayerisLinuxkernel.Themiddleiscalledmiddlewarelayer.Thetopisapplicationsoftwarelayer.Comparedwithothermobileoperatingsystems,Androidhasabroadermarket.SuchasMicrosoft’sWindowsMobile,TheoperatorsshouldtopaylicensefeestoMicrosoft.However,Androidbreakscertainrestrictionsbyopen-source.Inaddition,GoogleisalsoresponsibleforsettingupOpenmobilephoneAlliance[6](OpenHandsetAlliance)tosupportandhelpGoogletodevelopAndroidsystemanditsapplicationsoftware.Inviewoftheaboveadvantage,Androidgraduallybecomesthemainstreamplatformofmobiledevelopment,and,asaresult,manypersonalizedAndroidapplicationsaregenerated.B.SensorOverviewThesensorisdefinedbythenationalstandardGB7665-87as:Sensoriswhichcanfeelthespecifiedmeasuredsignalwhichisconvertedintousablesignalaccordingtocertainrules.Sensorusuallyiscomprisedofsensitivecomponentsandconversioncomponents.Sensorisadetectiondevice,whichcanfeelthemeasuredinformation,andcantransformtheinformationtoelectricalsignalorotherrequiredformalinformation.Itisthe2011InternationalConferenceonInstrumentation,Measurement,Computer,CommunicationandControl978-0-7695-4519-6/11$26.00©2011IEEEDOI10.1109/IMCCC.2011.71249primarysteptoimplementtheautomaticdetectionandautomaticcontrol.Accordingtotheworkingprinciple,sensorcanbedividedintophysicalsensorandchemicalsensors:Physicalsensorapplicationisbasedonphysicaleffects,suchaspiezoelectriceffect,awayfromthepolarization,thermalpower,andphotoelectric,magneticandelectriceffectands