views:

50

answers:

1

Hi,

I'm developing a library in c++ using the android NDK. Actually i created my project in android with both java and c++ sources. I can compile and run my project and all works fine.

Now i would like to force eclipse to reinstall the apk on the phone even if the java code is unchanged but something changed on the c++ side. Infact if i just change my c++ code and i launch the application the new library is not uploaded on the phone.

Do you know how i could achieve the result?

Thanks a lot!

+1  A: 

I have encountered this problem too.

To solve this, you could touch a random java file in your project each time you compile the NDK project (easiest is to add it to the NDK makefile).
This way Eclipse is "fooled" into re-creating the APK. Make sure you set "Auto-refresh workspace" in your Eclipse preferences so that it notices that a file was changed in the filesystem.

adamk
hi adamk, thanks for your reply!I didn't understand what you mean with "touch"..how could i do that in the makefile?
hara
`touch` is a Unix utility which changes the timestamp of a file to the current time (it's also available under Cygwin). It causes Eclipse to believe that a file was recently edited, although it wasn't actually changed.
adamk
I tried to touch both .java and .class file in my project but eclipse still doesn't refresh my apk..it says "Application already deployed. No need to reinstall."...i post my custom eclipse builder on the question...
hara
Did you enable Window->Preferences->Workspace->Refresh Automatically?
adamk
Thanks a lot! It works!
hara