Log in or register to post comments

LOCAL_MODULE:= ImageTargets

October 17, 2012 - 5:08am #1

Hi guys

i am working with sample project of ImageTargets.  I want to change the LOCAL_MODULE:= ImageTargets in android .mk file in jni folder but when i change it and build  and run it crashes but with this name ,rebuild and run,it  works fine. how can i rename  the ImageTargets to any other name. 

Thank you

 

 

 

LOCAL_MODULE:= ImageTargets

October 19, 2012 - 3:02am #5

You're welcome.

LOCAL_MODULE:= ImageTargets

October 18, 2012 - 10:33pm #4

Thank you AlessandroB

LOCAL_MODULE:= ImageTargets

October 17, 2012 - 1:26pm #3

One additional note:

in case your goal is simply to change the name of the App as it appears to the users, it will be sufficient to just go to the /res/values folder of your project, open the strings.xml file with a text editor and change the app_name in this line:

<string name="app_name">ImageTargets</string>

 

LOCAL_MODULE:= ImageTargets

October 17, 2012 - 1:19pm #2

Hi, if you change LOCAL_MODULE value, then you must be aware that the library generated by the build process (ndk-build) will also change its name (check and see under the libs/armeabi folder); for instance, for "ImageTargets" the library generated is called "libImageTargets.so",

but if you change the LOCAL_MODULE  name to (for example) "MyApp", the library produced will be called "libMyApp.so";

as a consequence, you need to adapt the Java source code that loads the native library (see the string NATIVE_LIB_SAMPLE in ImageTargets.java, which is used by the function loadLibrary()), otherwise at runtime the app will try to load a native library with the wrong name.

 

Also, be aware that chaging the LOCAL_MODULE in the android.mk file only impacts the name of the native library, but not the name of you application; 

if you want to change the name of your App, you should look at renaming the main activity and changing the activity name also in the manifest.xml.

 

 

Log in or register to post comments