By Laxmikantyadav1988
on Tue, 04/23/2013 - 04:41
hi all i want to convert jstring to int in cpp file of videoplayback sample.I got the name of iamge targets as number like 1, 2, and so on.now i got the image name in jstring which value is 1 for suppose.
jstring str=env->NewStringUTF(imageTarget.getName()); /// this value will be 1
now i want to set this value to int currentTarget inside the render frame method.
how can i convert jstring to int in videoplayback cpp file
Hi, have you tried with "atoi" function ?
int i = atoi( imageTarget.getName() );
(and probably you need to include <stdlib.h> )
how can i convert jstring to int in videoplayback cpp file
Thanks It worked for me. :)
how can i convert jstring to int in videoplayback cpp file
Great! you're welcome.