Measuring speed and altitude from personal phone midflight
Depending on the reliability of the sensors in your phone, yes that sounds completely possible. Most modern aircraft use GNSS for navigation, and your phone relies on the exact same technology.

Be aware that you will get the ground speed - see this question for further details: Why is there a difference between GPS Speed and Indicator speed?