Measuring height/depth with accelerometer

I’m making an app which measures height/depth with the accelerometer of a phone, but I’m having difficulty setting it up. Can anyone help me by giving me some code? 

Thanks in advance.

Height/depth?

The accelerometer measures current movement. It can measure your phone moving up and down. But not altitude (height, depth). For that you would use the built in barometer, but Corona SDK doesn’t have access to that and I’m not sure how accessible it is from native.  The GPS can also give you altitude information, if you have access to the GPS satellites.  Sometime’s location services will gave location information from WiFi routers which won’t have height information.

Rob

Height/depth?

The accelerometer measures current movement. It can measure your phone moving up and down. But not altitude (height, depth). For that you would use the built in barometer, but Corona SDK doesn’t have access to that and I’m not sure how accessible it is from native.  The GPS can also give you altitude information, if you have access to the GPS satellites.  Sometime’s location services will gave location information from WiFi routers which won’t have height information.

Rob