PeerComponent: including activity_main.xml from Android

10 views
Skip to first unread message

David Wafula

unread,
Jul 7, 2020, 5:23:14 PM7/7/20
to CodenameOne Discussions
Hi,

I am trying to use an Android native component (org.webrtc.SurfaceViewRenderer), of which am returning as PeerComponent from the native code, and I add it to the CENTER of a container with BorderLayout. But it does not display anything. 
This component, as you can imagine, displays video streams via WebRTC.

Having ported the original code from an Android Studio project, I realize they use  activity_main.xml for layout which works fine when run via Android studio. 
Is there a way I can include activity_main,xml in CN1 so that I can hopefully replicate the same layout behaviour ?

 Or any suggestions on how to get such a native component to correctly display ?

--
David W

Shai Almog

unread,
Jul 7, 2020, 11:02:47 PM7/7/20
to CodenameOne Discussions
Hi,
it seems everyone's working on webrtc including us: https://stackoverflow.com/questions/62738263/antmedia-native-interface-issues
Is the border layout container in the center of a border form?
First test that the parent container gets enough space, give it some padding and a border so you'll be able to see it. If it's tiny or invisible then that's the problem.

David Wafula

unread,
Jul 13, 2020, 5:53:58 AM7/13/20
to CodenameOne Discussions
Thanks Shai,
Been on this for a few days, I re-engineered the  workflow, and now the WebRTC component displays correctly through CN1. The issue was more on my workflow, than UI. I can confirm PeerComponent does work fine with WebRTC rendering. Of course keen to switch to native CN1 WebRTC functionality when it is available.

Thanks.





--
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-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/add717b2-6692-43a1-b3fb-3b467db1241an%40googlegroups.com.


--
David W
Reply all
Reply to author
Forward
0 new messages