Xamarin camera access in a shared project - c#

I'm building a shared project and I want to access the camera. For now i'm just trying to get this to work on android.
I found this here in stackoverflow and it works but I'm not being able to put this to work in my project becouse I want to call the camera in a ContentPage and not in my Class App : Application.

I would recommend this library for that: http://components.xamarin.com/view/xamarin.mobile

Related

Importing 3D model in Xamarin.iOS

I'm working on a Xamarin.ios app that requires a 3d model to be displayed throughout the app's runtime.
I'm hosting the model online, but it's not responding when I call it using its URI. I tried hosting it on Google Drive and glitch, but it still wouldn't let me use it.
Is there a method to bundle the model in the app and try to implement it? I know it can be done in Swift with NSBundle, but I'm using Xamarin in C#.

Embed Unity3D Player inside Xamarin.Forms App

Is it possible to embed a Unity3D Player inside my Xamarin.Forms project? So I would like to create a little Unity project, add some Models / interactions / scenery, and finally embed it inside my App. I could imagine doing this with a WebView, but I think this will be relativly slow. Does anyone knows a good solution for this?

How to use Xamarin Forms and Google Direction API android

i m new to Xamarin Forms, While Creating an Android Application using Xamarin Forms, I encountered a problem, I like to use Google Direction API , I can create Map using Xamarin Forms on Android but to use HTTPURLConnection and json Parsing, do i have to create Custom Renderer Class and then access in Android Dir and Code there, Or i can create a Class for HTTPURLConnection, Json Parsing and then pass to Xamarin Forms map as class object. Please Help !!
The Google direction APIs are not exposed in Xamarin.Forms because they are not available cross-platform. Baked into Forms is only the basic mapping support which abstracts away the differences between Google Maps, Apple Maps and Bing Maps.
For anything more specialised/more platform specific you will have to create a custom renderer and/or use some architectural design to connect your shared code and the platform code (you could use the DependencyService - https://developer.xamarin.com/guides/xamarin-forms/dependency-service/).

Export UnityProject inside Android Studio's existing project

I am new to the Unity3D, but I have made a small Unity project with a humanoid gameobject. I can move this humanoid with the demo data but I want to move it with the quaternion data which I am already getting inside the android app.
I have searched on the internet, but everyone just tells about the android plugin that we have to make for the unity, and that way we can use the JNI to send or receive the data (I need to access the c# scripts from the android).
But, I wanted to import the unity project inside the android project so that I can(access the c# scripts from android and send the quaternion data to the Quaternion variable of the gameObject and make it move) make changes to the android app and test it instantly!! (Also I don't need to make further changes inside the unity project but I need to make further improvements to the data inside the android project).
Please help and provide a guide for the android studio.
Thanks.

Xamarin Forms: how to implement platform specific code

I do have a Xamarin Forms project where I want Android, iOS and WinPhone as targets. (Right now I only look at Android.)
I am having trouble playing Audio and think I will need to implement it differently on each device.
I started with adding this code in the app.cs of the shared project
#if __ANDROID__
MediaPlayer _player;
_player = MediaPlayer.Create(this, Resources.Raw.bear); // "Resources.Raw.bear");
_player.Start();
#endif
but found that I cannot really reference the bear.wav, so I think I have to add the bear.wav for each project/platform and also handle the playing code separately. (See also http://developer.xamarin.com/recipes/android/media/audio/play_audio/ )
Unfortunately, I could not find a sample - or any documentation - on how to do this.
http://developer.xamarin.com/guides/cross-platform/xamarin-forms/custom-renderer/ is the closest I could find, but it seems to be highly focused on renderers.
What I thought I would do would be to define an abstract class in the shared project (some simple class, just with a void play method), and use it, and have the specific implementations in each platform-project. How to go about this?
It looks like
Write device platform specific code in Xamarin.Forms
answers the question - which is not so much a Xamarin Forms question as a Visual Studio shared project question and can be solved by creating an interface/abstract class and then implementing that for each platform and injecting the implementation.

Categories

Resources