Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8630519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:04:49+00:00 2026-06-12T09:04:49+00:00

I need to specify the location of some native libraries in my Android application.

  • 0

I need to specify the location of some native libraries in my Android application. I was accomplishing this with a hard-coded string:

public static final String DLL_DIR_STR = "/data/data/my.application.package/lib";

but wanted to get the path from Android instead. Following posts like this, I used getDir() to find the lib directory, changing

superCollider = new SCAudio(DLL_DIR_STR);

to

superCollider = new SCAudio(container.$context().getDir("lib", 0).getAbsolutePath());

Oddly, the initial libraries seem to load correctly

Trying to load lib /data/data/my.application.package/lib/libsndfile.so 0x42718d80
Added shared lib /data/data/my.application.package/lib/libsndfile.so 0x42718d80
No JNI_OnLoad found in /data/data/my.application.package/lib/libsndfile.so 0x42718d80, skipping init
Trying to load lib /data/data/my.application.package/lib/libscsynth.so 0x42718d80
Added shared lib /data/data/my.application.package/lib/libscsynth.so 0x42718d80

But when libscsynth tries to load some additional code, it’s using the wrong path:

OK, listing opendir(/data/data/my.application.package/app_lib)

Any ideas where the “app_” comes from? I thought I must be using getDir() wrong, but the initial files load fine. Could it be something in the native code? Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:04:50+00:00Added an answer on June 12, 2026 at 9:04 am

    I found the answer, quite by accident, in this post. ApplicationInfo.dataDir holds the location of the data directory, and “lib” is easily navigated to from there:

    superCollider = new SCAudio(container.$context().getApplicationInfo().dataDir + "/lib");
    

    Alternatively, nativeLibraryDir takes you directly to the lib directory, but requires API level 9.

    Thanks for your help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why we donot need to specify ; after an automatic property declaration public string
I need to specify the exact length of a string to be printed from
I don't need to specify the orientation in this case, I just need to
Why in Linq to Entities do I need to specify relationships with Include(string)? Linq
I'm working on an application where I need to maintain times from different location.
Hi I need to initialize an NSObject at a particular location that I specify(through
I have got a single file in which I need specify classes in multiple
Possible Duplicate: When do I need to specify the JavaScript protocol? for example <body
for using cout , I need to specify both: #include<iostream> and using namespace std;
Very often, it's natural to need to specify a CSS style for all elements

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.