JNI and Global variables.

Put your problem here if it does not fit any of the other categories.

JNI and Global variables.

Postby r3dknight » Mon Mar 22, 2010 5:26 pm

Ok.
somehow I can't have a C like global variables

for example in a C file I've an global variables



Syntax: [ Download ] [ Hide ]
  1.  
  2.  
  3.  
  4. JNIEXPORT int 
  5.  
  6. Java_project_codes_Android_GL_GL_Score; // global variable 
  7.  
  8.  
  9.  
  10. JNIEXPORT void 
  11.  
  12. Java_project_codes_Android_GL_GL_SetScore(int Score) 
  13.  
  14.  
  15. Java_project_codes_Android_GL_GL_Score = Score; 
  16.  
  17. }  
  18.  
  19.  
  20.  
  21. JNIEXPORT int 
  22.  
  23. Java_project_codes_Android_GL_GL_GetScore() 
  24.  
  25.  
  26. return Java_project_codes_Android_GL_GL_Score;  
  27.  
  28.  
  29.  
  30.  


And result of GetScore is always garbage if I use it java

any tips on how to fix this?
r3dknight
Freshman
Freshman
 
Posts: 7
Joined: Wed Mar 10, 2010 11:45 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 10 guests