Please look at the docs and samples bundled with the NDK.

You can also read an overview here:
http://developer.android.com/sdk/ndk/1.6_r1/index.html

If you have more specific questions regarding the ndk, you should post
on the android-ndk Google Group.


Xav

On Thu, Nov 5, 2009 at 4:48 PM, cvance383 <[email protected]> wrote:
> i downloaded and installed the ndk but how do i recompile the fast md5
> library? do i also need a line within my project like...
>
> static
> {
>        System.loadLibrary(x);
> }
>
> ?? thanks for all your help so far.
>
> On Nov 5, 3:57 pm, Xavier Ducrohet <[email protected]> wrote:
>> ah I understand now.
>>
>> Here's what happens:
>>
>> fast-md5.jar is not 100% java and has a native component to it. That
>> native component is in multiple form for different os
>> (linux/mac/windows) and architectures (x86/ppc).
>>
>> Just this is going to not make it work. You would have to make sure to
>> recompile the native library with our NDK, and make sure it's packaged
>> properly with the apk (NDK does this for you) and make sure the java
>> code of the jar loads it like other NDK libraries.
>>
>> The problem that you are seeing is that packaging 3rd party jar files
>> has 2 steps:
>> - take the .class files inside the jar file and dex them into
>> classes.dex with the other code from the project (or other jar files)
>> - take the non .class files from the java and put them into the apk
>> (which is a zip file like jar files), with the same folder structure
>> so that Java code accessing resources through
>> Class.getResourceAsStream() (or similar) can find and load those
>> resources
>>
>> So it looks like fast-MD5.jar contains lib/arch/darwin_x86/MD5.jnilib
>> and other libraries. The problem is that this conflicts with where the
>> NDK libraries are supposed to be and the package manager on the device
>> complains.
>>
>> Note that in 1.5 this check is not there but the app will only work if
>> it doesn't call into method of this jar file that uses native
>> implementation.
>>
>> On our side we should definitively check this during packaging and
>> generate a warning/error when we detect a potential conflict.
>>
>> Xav
>>
>>
>>
>>
>>
>> On Thu, Nov 5, 2009 at 10:54 AM, cvance383 <[email protected]> wrote:
>> > when i extract the apk, in the lib/arch/darwin_ppc/ is a file:
>> > MD5.jnilib . In my project the files in my lib folder are commons-
>> > httpclient-3.1.jar ,  fast-md5.jar, gson-1.2.3.jar . Is this where my
>> > problem is stemming from?
>>
>> > O Nov 4, 8:44 pm, Xavier Ducrohet <[email protected]> wrote:
>> >> what is all that lib/arch/darwin_ppc/ stuff?
>>
>> >> It looks like you're putting native code compiled for
>> >> mac/linux/windows in your apk?
>>
>> >> It works on 1.5 because the package manager back then didn't check for
>> >> native code.
>> >> Starting with 1.6, it only accepts an apk if the native code packaged
>> >> in the apk match the device. The emulator emulates a basic ARMv5
>> >> device and expects native code to be in lib/armeabi/libfoo.so
>>
>> >> Do you happen to have a libs folder in your project that contains this
>> >> "arch" folder (and subfolders)?
>>
>> >> Xav
>>
>> >> On Wed, Nov 4, 2009 at 5:08 PM, cvance383 <[email protected]> wrote:
>> >> > correction it works fine on 1.5, but not 1.6 or 2.0 , im thinking this
>> >> > is an sdk issue, but i still dont know. any help is greatly
>> >> > appreciated.
>>
>> >> > On Nov 4, 7:51 pm, cvance383 <[email protected]> wrote:
>> >> >> it prints out all the drawable files and this
>>
>> >> >>  2540  2009-11-03 19:26   AndroidManifest.xml
>> >> >>     61100  2009-11-03 18:57   resources.arsc
>> >> >>    719304  2009-11-03 19:26   classes.dex
>> >> >>       453  2009-11-03 19:26   assembly-descriptor.xml
>> >> >>     12580  2009-11-03 19:26   lib/arch/darwin_ppc/MD5.jnilib
>> >> >>      9040  2009-11-03 19:26   lib/arch/darwin_x86/MD5.jnilib
>> >> >>      7346  2009-11-03 19:26   lib/arch/linux_x86/MD5.so
>> >> >>     13312  2009-11-03 19:26   lib/arch/win32_x86/MD5.dll
>> >> >>     25714  2009-11-03 19:26   META-INF/MANIFEST.MF
>> >> >>     25767  2009-11-03 19:26   META-INF/CERT.SF
>> >> >>       980  2009-11-03 19:26   META-INF/CERT.RSA
>> >> >> ---------                     -------
>> >> >>   1955356                     303 files
>>
>> >> >> ... btw this is the first time i have had a problem installing the
>> >> >> apk, if i switch back to 1.5 or 1.6, there isnt any issues.
>>
>> >> >> On Nov 4, 7:09 pm, David Turner <[email protected]> wrote:
>>
>> >> >> > hmm, can you tell us the content of your .apk, i.e. what does 
>> >> >> > running "unzip
>> >> >> > -l <yourapplication>.apk" prints out ?
>> >> >> > (feel free to obfuscate names if needed, but the first four 
>> >> >> > characters of
>> >> >> > each line are important).
>>
>> >> >> > thanks in advance
>>
>> >> >> > On Wed, Nov 4, 2009 at 3:17 PM, cvance383 <[email protected]> 
>> >> >> > wrote:
>> >> >> > > downloaded the new 2.0 sdk the other day, and tried testing my app 
>> >> >> > > on
>> >> >> > > 2.0 via the emulator. I am using eclipse, and when i click run, the
>> >> >> > > new emulator runs with my 2.0 avd. but when eclipse tries to 
>> >> >> > > install
>> >> >> > > it i get this in the console...
>>
>> >> >> > > Installation error: INSTALL_FAILED_CPU_ABI_INCOMPATIBLE
>> >> >> > > Please check logcat output for more details.
>>
>> >> >> > > the log has this
>> >> >> > > 11-04 18:16:01.818: ERROR/PackageManager(53): Package com.
>> >> >> > > (package).android has mismatched uid: 10025 on disk, 10026 in
>> >> >> > > settings; read messages:
>> >> >> > > 11-04 18:16:01.818: ERROR/PackageManager(53): Read completed
>> >> >> > > successfully: 41 packages, 6 shared uids
>>
>> >> >> > > 11-04 18:16:01.906: WARN/PackageManager(53): Install failed: .apk 
>> >> >> > > has
>> >> >> > > native code but none for arch armeabi
>> >> >> > > 11-04 18:16:01.932: WARN/PackageManager(53): Package couldn't be
>> >> >> > > installed in /data/app/com.(packagename).android.apk
>>
>> >> >> > > I can not figure out why it does this. I have searched aimlessly 
>> >> >> > > for
>> >> >> > > answer and this is one of my last resorts. Thanks for any help
>>
>> >> >> > > --
>> >> >> > > You received this message because you are subscribed to the Google
>> >> >> > > Groups "Android Developers" group.
>> >> >> > > To post to this group, send email to 
>> >> >> > > [email protected]
>> >> >> > > To unsubscribe from this group, send email to
>> >> >> > > [email protected]<android-developers%2Bunsubs
>> >> >> > >  [email protected]>
>> >> >> > > For more options, visit this group at
>> >> >> > >http://groups.google.com/group/android-developers?hl=en
>>
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups "Android Developers" group.
>> >> > To post to this group, send email to [email protected]
>> >> > To unsubscribe from this group, send email to
>> >> > [email protected]
>> >> > For more options, visit this group at
>> >> >http://groups.google.com/group/android-developers?hl=en
>>
>> >> --
>> >> Xavier Ducrohet
>> >> Android SDK Tech Lead
>> >> Google Inc.
>>
>> >> Please do not send me questions directly. Thanks!
>>
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Android Developers" group.
>> > To post to this group, send email to [email protected]
>> > To unsubscribe from this group, send email to
>> > [email protected]
>> > For more options, visit this group at
>> >http://groups.google.com/group/android-developers?hl=en
>>
>> --
>> Xavier Ducrohet
>> Android SDK Tech Lead
>> Google Inc.
>>
>> Please do not send me questions directly. Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.

Please do not send me questions directly. Thanks!

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

Reply via email to