Hello,I'm trying to glue AdMob and NativeActivity based app. I can send requests through my JNI bridge from native code to Java but since NativeActivity doesn't use view hierarchy for rendering, it's of no use. I've spent two days trying to somehow go around this, I figured it's time to ask - is there any way to use AdMob with NativeActivity? Or is there no hope for me?Regards,Marcin--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/O87DLkFTsiQJ.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Hello,I'm trying to glue AdMob and NativeActivity based app. I can send requests through my JNI bridge from native code to Java but since NativeActivity doesn't use view hierarchy for rendering, it's of no use. I've spent two days trying to somehow go around this, I figured it's time to ask - is there any way to use AdMob with NativeActivity? Or is there no hope for me?
Hi,I did managed to get PopupWindow showing Ads on a pure native game. This thread is quite old, but if there are still interest I will write a little article about it.Best Regards.
Il giorno domenica 21 ottobre 2012 22:43:53 UTC+2, Marcin Jakubowski ha scritto:
Hello,I'm trying to glue AdMob and NativeActivity based app. I can send requests through my JNI bridge from native code to Java but since NativeActivity doesn't use view hierarchy for rendering, it's of no use. I've spent two days trying to somehow go around this, I figured it's time to ask - is there any way to use AdMob with NativeActivity? Or is there no hope for me?
Regards,Marcin
That would be very interesting.
--
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.
You pinned the issue: there is no view hierachy, thus there is no way to display something else but the native surface view.
The same goes for events (touch) dispatching...
--
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.
I have 2 cents to offer. I ported my game engine to the NDK and decided to go with NativeActivity. So now my engine can cross compile to PC, Android, iOS and BB10. Life was good and the people rejoiced. Started to hook up AdMob on Android and spent a day annoying anyone who would listen (poor wife). I have to say that I assumed that AdMob support would be there for any type of Android app as I thought it was in Google's interest. Either way, it doesn't really matter.
The next day I tried various hacks that stunk up the code and introduced new dragons that I knew would come back to burn me. Then I started to think about other stuff like in app purchases and other features of the market. I switched off just get it done mode. The solution? Write your own glue code somewhat like NativeActivity. I tend to wonder if it's really meant to be used in shipping code. Spend a couple days tracing through how they do stuff. Basically learn how Android manages Java and C++ together just like how on iOS you have to learn the Obj-C crap to C++. Actually be happy it's Java and not Obj-C.
The Android platform is Java and that is all there is to it. Learn JNI on Android and your app will be much better off IMHO.
On 2/5/2013 3:38 AM, Philippe Simons wrote:
I'd really like to see a example for this.
On Tue, Feb 5, 2013 at 3:45 AM, Dianne Hackborn <hac...@android.com <mailto:hac...@android.com>> wrote:
On Mon, Oct 22, 2012 at 12:55 AM, Philippe Simons
<simons....@gmail.com <mailto:simons.philippe@gmail.com>> wrote:hac...@android.com <mailto:hac...@android.com>
You pinned the issue: there is no view hierachy, thus there is
no way to display something else but the native surface view.
The same goes for events (touch) dispatching...
I just noticed this now, and want to point out that this isn't
really true. NativeActivity is just an activity that gives you an
easy way to associate native code with it. Your native code can
completely take over drawing into the window, or it can not, that
is up to you. If you need to mix regular views with OpenGL
drawing, then you can do things like use a GLSurfaceView inside of
the view hierarchy of a NativeActivity. The two work fine
together, you just need to do your drawing in to the surface
view's surface instead of getting to take over the surface of the
activity window.
-- Dianne Hackborn
Android framework engineer
Note: please don't send private questions to me, as I don't have
time to provide private support, and so won't reply to such
e-mails. All such questions should be posted on public forums,
where I and others can see and answer them.
-- 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+unsubscribe@googlegroups.com
<mailto:android-ndk%2Bunsu...@googlegroups.com>.
<mailto:android-ndk@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.
--
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+unsubscribe@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.
--
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+unsubscribe@googlegroups.com.