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 8353981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:25:20+00:00 2026-06-09T09:25:20+00:00

Here’s our situation: We have some native code that scans user-defined directories at certain

  • 0

Here’s our situation:

We have some native code that scans user-defined directories at certain times. The goal is to collect data about specific types of file and build an SQLite database from it. There could be tens of thousands of files to query.

The problem is that each time a file is found, the data collected about that file must be ushered across the JNI boundary to Java-land before being comitted to the database via the SQLite classes provided by the Android SDK. This takes far too long.

The proposed solution is to download the SQLite source code, link it into our project and build the database natively as described here: SQLite with Android NDK. This would eliminate the time taken to pass the data from the C++ layer to the Java layer entirely.

The question is: if this is done, can the Android SDK (Java layer) still be used to open the database, obtain Cursor objects etc. as normal? We can keep the database extremely simple; no foreign keys, triggers, constraints etc. Although indexes are very desirable.

We have considered pipes and sockets to move the data across the JNI boundary. However, named pipes are not supported on Fat32 file systems (so this is not useable incase the user moves the application to a Fat32 formatted SD card). Sockets are also not usable because we will have to include internet permissions in the manifest which we feel would look suspicious.

If anybody has any information on this, we’d love to hear from you.

Many thanks,
P.

  • 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-09T09:25:21+00:00Added an answer on June 9, 2026 at 9:25 am

    Just to follow up, we took the plunge and threw together a test application that compiled the latest SQLite Amalgamation (3.7.13) source code. We have found that we are indeed able to interface with the natively created database via the Android Java SDK.

    Performance wise, this was a great leap! By inserting our records at the native layer we found a massive performance increase. Previously, inserting 20,000 records into a non-complex database took approximately 4 minutes. Some simple profiling showed that pretty much the entire 4 minutes was spent passing the data from the native layer to the Java layer.

    Now, the insertions take between 4 and 6 seconds. We are also able to open, query etc. the database with the Java API as per normal.

    Performance tweaks to note are transactions and moving the journal to memory using:

    pragma journal_mode=memory;
    

    We decided not to turn off the synchronisation for stability reasons, plus we were more than happy with the performance we had already achieved.

    Hopefully, others will find this advice useful.

    P

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

Sidebar

Related Questions

Here is my code (Say we have a single button on the page that
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here is the problem that I am trying to solve. I have two folders
Here is my code...I have two dimensional matrices A,B. I want to develop the
Here's the flow that I am trying to achieve: 1) User uploads an audio
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here's my situation: I have a Data Template set up which contains a ToggleButton
Here's the thing: I want to add some images programmatically. The images should have
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>

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.