Aha, this works.. not got anything to actually *show* yet :)

public android.view.View getView()
    {
      
        return nativeAdMedia;
    }

On Tuesday, November 8, 2016 at 11:45:17 PM UTC+8, Gareth Murfin wrote:
>
> So Im now trying to return the PeerComponent, my "view" on the android 
> side is a linearlayout, returning this as a PeerComponent fails to compile, 
> I also tried returning adView.getRootView(); but again this failed, and 
> also casting my linear to a view before returning also fails to compile (View 
> cannot be converted to PeerComponent). What must I do to my linear layout 
> to get it returned as a view?
>
> On Tuesday, November 8, 2016 at 10:55:37 PM UTC+8, Gareth Murfin wrote:
>>
>> I stuck recyclerview-v7-21.0.3.aar in native/android and definied the 
>> build hint for supportV4, seems to get past the MediaView now :-D
>>
>> On Tuesday, November 8, 2016 at 9:59:16 PM UTC+8, Gareth Murfin wrote:
>>>
>>> Thanks Shai. Im almost at the point of using PeerComponents, but I have 
>>> one weird error  that appears to happen when I run   MediaView 
>>> nativeAdMedia = new MediaView(context);
>>>
>>> It says the class is not found, it seems to find the others such as 
>>> com.facebook.ads.NativeAd; but not com.facebook.ads.MediaView; any ideas 
>>> why that is?
>>>
>>> ejecting re-init on previously-failed class 
>>> java.lang.Class<com.facebook.ads.internal.i.c.e>
>>> I/art     ( 1046): Rejecting re-init on previously-failed class 
>>> java.lang.Class<com.facebook.ads.internal.i.c.e>
>>> I/art     ( 1046): Rejecting re-init on previously-failed class 
>>> java.lang.Class<com.facebook.ads.internal.i.c.c>
>>> I/art     ( 1046): Rejecting re-init on previously-failed class 
>>> java.lang.Class<com.facebook.ads.internal.i.c.c>
>>> I/art     ( 1046): Rejecting re-init on previously-failed class 
>>> java.lang.Class<com.facebook.ads.internal.i.c.c>
>>> I/art     ( 1046): Rejecting re-init on previously-failed class 
>>> java.lang.Class<com.facebook.ads.internal.i.c.c>
>>> I/art     ( 1046): Rejecting re-init on previously-failed class 
>>> java.lang.Class<com.facebook.ads.internal.i.c.c>
>>> I/art     ( 1046): Rejecting re-init on previously-failed class 
>>> java.lang.Class<com.facebook.ads.internal.i.e.c.b>
>>> I/art     ( 1046): Rejecting re-init on previously-failed class 
>>> java.lang.Class<com.facebook.ads.internal.i.e.c.b>
>>> I/MotoNetwCtrlr( 1193): onReceive: Received intent=Intent { 
>>> act=android.net.wifi.RSSI_CHANGED flg=0x4000010 (has extras) } 
>>> Action=android.net.wifi.RSSI_CHANGED
>>> I/MotoNetwCtrlr.MotoWifiSignalCtrlr( 1193): handleBroadcast: Entered: 
>>> Intent=Intent { act=android.net.wifi.RSSI_CHANGED flg=0x4000010 (has 
>>> extras) } Action=android.net.wifi.RSSI_CHANGED
>>> I/MotoNetwCtrlr.MotorolaWifiSignalController( 1193): isDirty: returns 
>>> false
>>> I/MotoNetwCtrlr.MotoWifiSignalCtrlr( 1193): handleBroadcast: Completed
>>> I/MotoNetwCtrlr( 1193): onReceive: Completed intent=Intent { 
>>> act=android.net.wifi.RSSI_CHANGED flg=0x4000010 (has extras) } 
>>> Action=android.net.wifi.RSSI_CHANGED
>>> I/art     ( 1046): Rejecting re-init on previously-failed class 
>>> java.lang.Class<com.facebook.ads.internal.i.c.c>
>>> D/AndroidRuntime( 1046): Shutting down VM
>>> E/AndroidRuntime( 1046): FATAL EXCEPTION: main
>>> E/AndroidRuntime( 1046): Process: com.raffler, PID: 1046
>>> E/AndroidRuntime( 1046): java.lang.NoClassDefFoundError: 
>>> com.facebook.ads.internal.i.c.c
>>> E/AndroidRuntime( 1046):        at 
>>> com.facebook.ads.MediaView.<init>(Unknown Source)
>>> E/AndroidRuntime( 1046):        at 
>>> com.facebook.ads.MediaView.<init>(Unknown Source)
>>> E/AndroidRuntime( 1046):        at 
>>> userclasses.nativeinterfaces.NativeFBAdvertImpl.inflateAd(NativeFBAdvertImpl.java:225)
>>> E/AndroidRuntime( 1046):        at 
>>> userclasses.nativeinterfaces.NativeFBAdvertImpl.onAdLoaded(NativeFBAdvertImpl.java:130)
>>> E/AndroidRuntime( 1046):        at 
>>> com.facebook.ads.NativeAd$1$1.a(Unknown Source)
>>> E/AndroidRuntime( 1046):        at 
>>> com.facebook.ads.internal.c.b$1$1.run(Unknown Source)
>>> E/AndroidRuntime( 1046):        at 
>>> android.os.Handler.handleCallback(Handler.java:739)
>>> E/AndroidRuntime( 1046):        at 
>>> android.os.Handler.dispatchMessage(Handler.java:95)
>>> E/AndroidRuntime( 1046):        at 
>>> android.os.Looper.loop(Looper.java:135)
>>> E/AndroidRuntime( 1046):        at 
>>> android.app.ActivityThread.main(ActivityThread.java:5343)
>>> E/AndroidRuntime( 1046):        at 
>>> java.lang.reflect.Method.invoke(Native Method)
>>> E/AndroidRuntime( 1046):        at 
>>> java.lang.reflect.Method.invoke(Method.java:372)
>>> E/AndroidRuntime( 1046):        at 
>>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
>>> E/AndroidRuntime( 1046):        at 
>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
>>> W/ActivityManager(  893):   Force finishing activity 1 
>>> com.raffler/.MyApplicationStub
>>> I/OpenGLRenderer(  893): Initialized EGL, version 1.4
>>> W/ActivityManager(  893): Activity pause timeout for 
>>> ActivityRecord{18b90b08 u0 com.raffler/.MyApplicationStub t5554 f}
>>>
>>>
>>> On Tuesday, November 8, 2016 at 1:45:11 PM UTC+8, Shai Almog wrote:
>>>>
>>>> You can use a native widget if you wrap it in a PeerComponent. Your 
>>>> native interface can return a PeerComponent and when you generate a native 
>>>> interface the Android implementation will be a View. You can then return 
>>>> the view.
>>>>
>>>> The Android XML won't work, you will need to handcode that in Java. 
>>>> Notice that every Android XML syntax can be written in Java so this should 
>>>> be possible. The alternative is to wrap this entire thing in AAR which 
>>>> might be more painful.
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/33f5f9d8-74c5-48e1-8496-4cd9733f4ef7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to