First step for this app should be to get angle to which point mobile(camera) is inclined. If it is possible to get inclined angle a,
then as per your given link by formula of tangent you will get distance of the object from the camera , here you have to consider cameras height(h).Once you get height then again incline your mobile to the top of the object,and calculate height.
In short most important step is to get angle of inclination of the mobile to the object, after that all remaining part is trigonometric calculations.
After all it will give approximate results not accurate.

If you are able to calculate angle to which mobile is inclined
Step First: calculate distance
1) Incline your mobile to the bottom of the object it will give you angle A(as shown in diagram)
2) consider height h at what you have held your mobile (consider standard as 5ft ) or
You may use SONAR system to get height where you have held the phone or this may help you
3) Now by formula of tangent you will get distance d as shown in figure
Step 2: Calculate height
1) Incline your mobile to the top of the object and get angle B as shown in figure.
2) As you have calculated d in previous step, put the angle b and d in tangent formula you will get h1
3) Add h and h1, you will get height of the object