61686

loading library (.so file) in android [duplicate]

Question:

<blockquote>

<strong>Possible Duplicate:</strong><br /><a href="https://stackoverflow.com/questions/4882167/creating-a-product-sdk-how-do-i-add-a-native-lib-so-and-a-jar-with-the-sdk-i" rel="nofollow">Creating a product SDK: How do I add a native lib (.SO) and a jar with the SDK I am creating?</a>

</blockquote>

I'm new to Android development and jni, so bare with me.

I'm trying to use com.android.SystemClock in an app, which calls a native method. I need to load the library that this native method belongs to (i.e. System.loadLibrary(...)). The method is defined in the file: frameworks/base/core/jni/android_os_SystemClock.cpp. How do I figure out which library this belongs to and load it as well?

Thanks

Answer1:

Inspect the make files and find out what libs it builds. Look for LOCAL_MODULE. That said, it is probably in libandroid_runtime.so.

And then again, if it is not part of the public SDK, you shouldn't be using it. It may change, break, not work on some devices, etc.

Recommend

  • Set GIF on Background of button
  • Android error signal 11 when a movie draws into a canvas
  • Android timer that counts when app is closed
  • How to detect headset button double click in HTC phones with broadcast receiver?
  • Copy a file from PDA to PC via USB in java
  • Why do I need to force git to sync my remote repository?
  • NewGlobalRef of a weak reference still prevent a object from garbage collected
  • How to use JNI to call a “main” function that takes an array of character pointers?
  • Multiprocessing in Python: how to implement a loop over “apply_async” as “map_async” using a callbac
  • WCF REST Service returns HTTP 400 Bad Request
  • Singular Value Decomposition Implementation
  • Create child Window of another process's HWND? (e.g. screensaver preview)
  • LatLong falls within a given polygon in D3 + Leaflet
  • How to make a local git repository that mirrors an upstream repository?
  • opengl window freezing during move/resize
  • Salesforce Different WSDL files and when to use
  • debug library loaded with ctypes using gdb
  • Combining SpatialPolygonsDataFrame of two neighbour countries
  • Unity3D & Android: Difference between “UnityMain” and “main” threads?
  • Disable Enter in editText android
  • Cannot resolve symbol 'MyApi'
  • If I include Java 8 in my Android app does that affect which devices it will work on?
  • req.body is undefined - nodejs
  • Does CUDA 5 support STL or THRUST inside the device code?
  • Trying to switch camera back to front but getting exception
  • Symfony2: How to get request parameter
  • Release, debug version and Authorization Google?
  • Timeout for blocking function call, i.e., how to stop waiting for user input after X seconds?
  • Why winpcap requires both .lib and .dll to run?
  • Akka Routing: Reply's send to router ends up as dead letters
  • Is there a mandatory requirement to switch app.yaml?
  • PHP: When would you need the self:: keyword?
  • Windows forms listbox.selecteditem displaying “System.Data.DataRowView” instead of actual value
  • Proper folder structure for lots of source files
  • Free memory of cv::Mat loaded using FileStorage API
  • Angular 2 constructor injection vs direct access
  • How does Linux kernel interrupt the application?
  • How to get Windows thread pool to call class member function?
  • Programmatically clearing map cache
  • reshape alternating columns in less time and using less memory