You cannot link a static native library into a Java application; your only option is a shared object (.so). Fortunately though, shared objects can have static libraries linked into them; you'll just need to provide exports to give access to the items you want Java to access.
On Apr 30, 3:10 am, FrankG <frankgru...@googlemail.com> wrote: > Hello Ravi, > > Thanks for the example .. but it is an example for a dynamic linked > lib ( *.so ) not > for using any existing code as a static lib ( *.a ). > > Nevertheless thanks for your efforts and to everybody who provides > examples,details and comments. > > Frank > > On 29 Apr., 19:32, ravindra singhai <singhai.ravin...@gmail.com> > wrote: > > > > > Hi Josh, > > > I've attached a sample application > > athttp://www.naresh.se/phpBB/viewtopic.php?f=10&t=19&p=33#p33 > > > Attached is a very basic sample application ( SimpleJNI.zip) which will > > guide you to use C/C++ static library ( .so ) file from android java file. > > > Steps are also mentioned to create C/C++ static library using NDK. > > > Note: Attached SimpleJNI.zip is a bit modified from the one which is > > available with android open-soruce code. > > > Try this and feel free to ask if it doesn't work :) > > > Cheers !! > > Ravi > > > On Thu, Apr 29, 2010 at 12:21 PM, FrankG <frankgru...@googlemail.com> wrote: > > > Hello Kelly, > > > > I would not say this can be so easy at the end. > > > > Josh says he want to use a static library, but with JNI > > > he need to use a dynamic one or at least a dynamic lib which "wraps" > > > the static one. And even with this wrapper he can run into linker > > > problems > > > not finding all symbols. It can be a nightmare at the end, > > > but it depends from the complexity of his C++ stuff. > > > > Good luck ! > > > Frank > > > > On 28 Apr., 19:41, Kelly <senor...@gmail.com> wrote: > > > > Download the android NDK and see how they use libraries. Just reverse > > > > engineer their very simple JNI projects and you can build yours no > > > > problem. > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to android-developers@googlegroups.com > > > To unsubscribe from this group, send email to > > > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > > > 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 android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > > For more options, visit this group > > athttp://groups.google.com/group/android-developers?hl=en-Zitierten Text > > ausblenden - > > > - Zitierten Text anzeigen - > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group > athttp://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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en