Native component is not rendered properly on Andorid

40 views
Skip to first unread message

horky...@gmail.com

unread,
Apr 29, 2014, 3:39:37 AM4/29/14
to codenameone...@googlegroups.com
Hello,

I am trying to incorporate qr reader into our application (i.e. to have a small camera window inside tha app that is able to read qr code) - so the only posiibility is to have a native implementation for this.

1) My suggestion was to create a View (especially SurfaceView) inside android implementation and send it to codename one as PeerComponent which can be placed and sized as needed in terms of codename1 code. Will it work?

2) By that I tried the native demo which sends a button through native interface, but it doesn't work properly on new andorid (Nexus 7 - android 4.4.2). When I click the button to display another (the native) button nothing happens. When I click it many times some time in future many buttons appear. It looks like revalidate() does not refresh the natively-added components - maybe different threads?

When I'm adding CN1 button, it works. I also tried android.asynPaint=true and it's same.

Thank you very much for any hints.

Great work, Adam

Shai Almog

unread,
Apr 29, 2014, 2:06:18 PM4/29/14
to codenameone...@googlegroups.com, horky...@gmail.com
Hi,
we have a builtin QR reader API but it won't work in a small window.

We haven't tested the native demo in a while so maybe something there is broken. However, peer components do work. See: http://www.codenameone.com/3/post/2014/03/mapping-natively.html
The Map is literally a heavyweight native component placed into the UI. So your approach should generally work.
Reply all
Reply to author
Forward
0 new messages