I have 2 separate Android app (apk).
App 1 creates SurfaceView
inside it and should provide AIDL methods for other apps to obtain an instance of SurfaceHolder
for such SurfaceView
. So the other apps will be able to draw on that view, displayed inside app number 1.
I was able to transfer Surface
itself via aidl easily, since it implements Parcelable interface.
// IMainService.aidl
package com.commonsware.cwac.preso.demo.service;
import android.view.Surface;
interface IMainService {
Surface getSurf();
}
But 3-rd party sdk need SurfaceHolder
to draw on. So the question is - how can I create SurfaceHolder
for a given Surface
instance, or how can I transfer SurfaceHolder
via AIDL. Is there any examples of how I can implement Parcelable for SurfaceHolder
?
My use-case (if its matter): App 1 starts as a Service
and draw UI on Presentation Screen. And I need a way to get another apps display Navigation Data via Nokia Here Mobile SDK inside app 1. I need SurfaceHolder
in order to use this api.
Any help will be appreciated.