Hi Ranjeet,

although I'm not the Android Dev Team i can tell you what ive been
told last weeks about this topic: JNI is currently not supported in
SDK 1.0. The reason is not quite clear, some say cause it may not work
at all, or may break in the (near) future. Plus your app wont be
portable and needs special versions for every hw platform. Actually i
bet Android Dev Team will just tell you: "native libs and JNI is not
supported!".

On the other hand JNI is working and Android uses it internally a lot
[google talks]. But you may have problems to link against the stripped
down libc they are using, or may run into other problems you cannot
resolve. Plus please keep in mind there is no real solution to deploy
your app on real phones, because /system/lib is read only. You might
add your .so into the apk as a raw resource and extract it into your
app writable directory under /data. Loading the .so works for me using
System.load(). But this way the .so is stored on your phone in 2
locations, using a lot unnecessary space.

Currently for a real world app on real phones i would'nt use JNI and
native libs at all due to those problems. Either wait for JNI support
in future SDK versions or port your library to Java.

Regards
Volker

On Oct 1, 4:02 am, Ranjeet <[EMAIL PROTECTED]> wrote:
> Dear Android Dev Team,
>
> My apologies if I am asking a question that's already been answered.
> Unfortunately I haven't been able to find any documentation within
> Android's reference that officially states Google's position on usage
> of JNI/SharedObjects (written in C++ and compiled via a cross
> compiler) from within Java ui code.  To clarify what I am trying to
> accomplish, we are building an application with the user interface
> completely written using the java/android classes/controls and it
> would use the shared library thats written in C++. There is just so
> much effort gone in to making that library that it would be a LOT of
> effort on our side rewriting it in Java. The library connects to our
> backend web server to fetch XML files over HTTP, stores some of the
> information from it on disk in files, and exposes the features via
> methods.
>
> Is this currently "officially supported" in Android(I have seen hello
> world C++ apps that run on the emulator with some security/chmod
> tweaks).
> Any information is sincerely appreciated.
>
> Thanks,
> -Ranjeet
--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to