Log in or register to post comments

Capture an image and fire an event

June 21, 2011 - 11:23am #1

Hi. I have been browsing the code all day and still I haven't got a clue on where I can do this in the ImageTargets example so that instead of rendering a teapot I get an AlertDialog on Android pop up when capturing an image.

Is this possible? Thanks!

Re: Capture an image and fire an event

August 18, 2011 - 8:02pm #6

Hello. I am sorry for my English. Looked through the documentation, has not found anything about the event which is responsible for recognition Trackable. I will be grateful for the help.

Upd. Has found , TrackableBehaviour.Status.DETECTED .

Re: Capture an image and fire an event

August 4, 2011 - 6:41am #5

Hi, it is interesting, but it can be done on Unity plugin???

Not exacly this: but when marker is visible -> run gui element.

Re: Capture an image and fire an event

June 25, 2011 - 7:38am #4

I just grabbed a fresh copy of the 1.0.0 ImageTargets sample and made these changes. It works as expected. Can you tell us what sort of errors you are seeing? Try adding some LOG lines to make sure the java method is being called correctly from native, etc.

- Kim

Re: Capture an image and fire an event

June 24, 2011 - 9:48am #3

Actually this does not work. I've tried what was posted on the thread you linked and nothing has happened don't know why. Even the person posting there admited to it not working and finding a solution, but not remembering what it was. Is this the correct framework to do this sort of thing?

Re: Capture an image and fire an event

June 21, 2011 - 7:58pm #2

See this thread for some detailed code snippets that show a Toast (brief message) when a target is found: http://ar.qualcomm.at/node/2000032

You'll be using the JNI (Java Native Interface) to call a Java method from native. The main trick is that the native renderFrame() method is called from the GLThread, but you can only manipulate the Android UI from the UIThread. That's where the Handler comes in.

Start with the code in that thread, then try to adapt it to show an AlertDialog.

- Kim

Log in or register to post comments