Hello UnityAnswers!
I'm building an Android app with Unity and a custom Activity. This Activity is already working well with a UnityPlayer and a CameraPreview. (The CameraPreview extends SurfaceView and implements SurfaceHolder.Callback and Camera.PreviewCallback to draw the camera view behind Unity.)
Now I want to do something similar with a MapView behind Unity. According to the Android docs, "A MapView can only be constructed (or inflated) by a MapActivity," so my plugin Activity is now a MapActivity. The trick here appears to be that the Activity's MapView must be an android.maps.MapView, so it can't also be a SurfaceView.
My question is, how can I get the effect of having Unity "punch through" the MapView as it does with the CameraPreview, while I can't make the MapView a SurfaceView as I have done with the CameraPreview? If the same technique can't be applied for a MapView, then is there some way to "scrape" the MapView and draw it onto a Plane in Unity?
Thank you in advance for any assistance!
Terrance Cohen, Ogmento, Inc.
Here's a bit of code for reference:
public class MyActivity extends MapActivity
implements VideoUser
{
private CameraPreview cameraPreview;
private UnityPlayer unityPlayer;
MapView mapView;
...
class CameraPreview extends SurfaceView
implements SurfaceHolder.Callback, Camera.PreviewCallback
{
SurfaceHolder surfaceHolder;
Camera camera;
VideoUser videoUser;
...