## Android XML whitepaper

By : JRL
Source: Stackoverflow.com
Question!

I am looking for resources concerning Android's use of XML - not how to's, but technical articles or whitepapers concerning the XML architecture in Android. Why were things designed the way they were, what considerations were made - all specific to the XML part.

If this is not available, I'm also interested in general use of XML in mobile computing. Does the iPhone use XML in the same way?

Can anyone point me to some good articles/websites/books/whitepapers/videos ?

By : JRL

I don't know that there's anything published or openly available on this subject. Your best option is to contact some of the Android guys at Google and see if they might feel like releasing any of their internal specs.

By : sooniln

Take the line segment from the startpoint to the endpoint. Construct a plane orthogonal to this line segment through the midpoint of the line segment. Then position the camera somewhere in this plane at an distance of more than the following from the intersection point of plane and line looking at the intersection point. The up vector of the camera must be in the plane and the horizontal field of view must be 90 degrees.

``````distance = sqrt(dx^2 + dy^2 + dz^2) / 2
``````

This camera positions will all have the startpoint and the endpoint on the left or right border of the view port and verticaly centered.

Another solution might be to write a function that takes the startpoint, the endpoint, and the desired position of both points on the screen. Then just solve the projection equation for the camera transformation.

If you make a bounding sphere of the points, all you need to do is keep the camera at a distance greater than or equal to the radius of the bounding sphere / sin(FOV/2).

For example, if you have a bounding sphere with radius Radius, and a specified Field of View FOV, your camera just needs to be at a point "Dist" away, pointing towards the center of the bounding sphere.

The equation for calculating the distance is: Dist = Radius / sin( FOV/2 );

This will work in 3D, for a camera at any orientation.