Android development match network packet to app

  android, local, vpn

I am trying trying to make an app that monitors wifi activity of apps. So far I have implemented a local VPN service and I can see the packets and their destination ip but I cannot match them to the app that is sending or receiving the packet. Any help would be much appreciated.

Source: Android Questions