Hii All,

I am facing a problem in my Android app which is calling native
functions through JNI. So thought somebody in this group can help me
to resolve this.

The current code :

1.      Create an array in JNI layer ( by NewIntArray()) which can be used
by both Java & C.
2.      we can name that array as type ‘jintArray arrayX’.
3.      We call GetIntArrayElements() on this ‘arrayX’ to get its elements
i.e, int * elementsX.
4.      This ‘elementsX’ would be used by a native call which will set it
to some value.(project specific* : may not need interest for this
issue)
5.      We now get the updated value of ‘elementsX’. And copy it back to
‘arrayX’ using ReleaseIntArrayElements() .
6.      We use ‘arrayX’ in bitmap/canvas class of Java layer to display on 
screen.

The whole procedure is followed for (480x640) times. And so there is a
redundant creation of the array for every frame display.

Is there any way to avoid this creation of array for each frame. Any
better solution to achieve the above?

I am not getting a way out of this & the performance of my app has
gotten very low too:(

Any JNI code snippets to modify steps (1 to 3 & 5) would be of great help to me.

Appreciate your suggestions on this.


thanks,
Latha.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to