Wednesday, May 22, 2013

[android-developers] Re: Android native libraries: How can they be used?



On Wednesday, May 22, 2013 2:42:30 PM UTC-5, Ishan Sharma wrote:
Hello!

I have been reading Android architecture for some time and have some questions pertaining to the native libraries.
a) Are the native libraries used by the Application Framework? 

Yes.

 

b) There are some libraries like media framework which provides media codecs etc. Does this mean that when I use the  Android API (core libraries) to play media files, the API interacts with the media framework in the native library.

Most likely. Here is code for playing a media file:

    /**
     * Starts or resumes playback. If playback had previously been paused,
     * playback will continue from where it was paused. If playback had
     * been stopped, or never started before, playback will start at the
     * beginning.
     *
     * @throws IllegalStateException if it is called in an invalid state
     */
    public  void start() throws IllegalStateException {
        stayAwake(true);
        _start();
    }

    private native void _start() throws IllegalStateException;

As you can see, the code calls a native function ( _start )

 

c) Is NDK the only way I can use the native libraries?


No.  You can use the Java SDK, which uses the native libraries indirectly.

Thanks.


 

Thanks

--
--
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+unsubscribe@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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment