I have Java Activity that creates a SurfaceView and I pass this to my
native creation code. I would advise that you do the same. This was
done to make sure my native app had a View hierarchy that plays nice
with the rest of the OS. If you want to use stuff like Ad Mob you will
need this. Really I don't see any benefit to using a Window directly
but having a View opens you up to using other features of the OS.
On 3/8/2013 5:01 PM, gadget wrote:
> I was just re-evaluating my NativeActivity-like wrapper that funnels
> all the lifecycle/etc calls into the native layer. I currently use a
> SurfaceView which gets turned into an OpenGL context. However, while
> browsing the NativeActivity code here
> <
https://code.google.com/p/android-source-browsing/source/browse/core/java/android/app/NativeActivity.java?repo=platform--frameworks--base>,
> I noticed that it does not use a SurfaceView, but instead
> doesgetWindow().takeSurface() to obtain a surface. Both methods
> obviously work, but I was wondering if I am taking an unnecessary
> performance/resources hit by creating a SurfaceView instead of taking
> the surface from the window?
> --
> You received this message because you are subscribed to the Google
> Groups "android-ndk" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
android-ndk...@googlegroups.com.
> To post to this group, send email to
andro...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/android-ndk?hl=en.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>