Search code examples
androidiosmobilexamarinvideo-capture

Capture phone direction / location whilst recording video


I need to build a prototype for a mobile app that will allow a user to record video and at the same time capture data about the phone such as, the direction the phone is pointing, i.e. x,y,z coordinates and geolocation.

Ideally I'd like to be able to capture this data every 2 seconds that the user is recording their video.

Can anyone out there tell me whether this is doable. Can Xamarin or other cross platform technologies capture that kind of data?

Any links to articles would be most appreciated...

Thanks

Richard


Solution

  • Here is a blog about using the Geolocator plugin: https://blog.xamarin.com/geolocation-for-ios-android-and-windows-made-easy/

    And the Geolocator NuGet package: https://www.nuget.org/packages/Xam.Plugin.Geolocator/

    This will get you location only, not the direction the user is facing (or rather the phone is facing). For that, try the Compass plugin: https://github.com/JarleySoft/Xamarin.Plugins/tree/master/Compass

    On Nuget: https://www.nuget.org/packages/Plugin.Compass

    Disclosure: I am a xamarin support engineer. the above plugins are partially created by a Xamarin evangelist, James Montemagno.