How to get packet loss ratio in an application like YouTube(3rd party library) when deployed on a android device

Hello everyone,
Is there any way such that i can find the number of packets lost in an android device. Iam trying to build an application which monitors the QOS params of youtube on mobile .