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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:33:36+00:00 2026-05-28T03:33:36+00:00

In my application I am creating many tables in the sqlite database but in

  • 0

In my application I am creating many tables in the sqlite database but in that one table contains more than 100k rows I get data from server using http connection. Getting this kind of many records causing much more time for me so to avoid this problem I want to connect my tablet through PC and I want to place txt file(which has insert statements) in the tablet.

Now how can I access that txt file in my application and how can I insert data in my table using that txt file and into which location I have to copy this txt file to access it from my application.

My DB file size also 273 MB, so I don’t think it’s possible to place it in the assets folder

  • 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-05-28T03:33:36+00:00Added an answer on May 28, 2026 at 3:33 am

    you can copy the file to assets folder

    code example:

    private void initDatabaseData(SQLiteDatabase db) {
        BufferedReader br = null;
        try {
            br = new BufferedReader(new InputStreamReader(context.getAssets().open(file_name)), 1024 * 4);
            String line = null;
            db.beginTransaction();
            while ((line = br.readLine()) != null) {
                db.execSQL(line);
            }
            db.setTransactionSuccessful();
        } catch (IOException e) {
            Log.e(LOG_TAG, "read database init file error");
        } finally {
            db.endTransaction();
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                    Log.e(LOG_TAG, "buffer reader close error");
                }
            }
        }
    }
    

    above code require the every line of the txt file is a sql sentence

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

Sidebar

Related Questions

I understand that creating too many threads in an application isn't being what you
I've creating a Java Swing application and I realized that I have many many
I am creating a master database using SQLite. This single file contains a dozen
In my Rails application, I have a variety of database tables that contain user
I'm creating a self-help FAQ type application and one of the requirements is that
i'm Creating an application that will be working off a User table, the user
I really need a sqlite database file for studies. I'm creating an application in
I am creating an application which involves so many web-service calls. I am using
I'm creating an application that will store a hierarchical collection of items in an
I am creating an application that manages multiple instances of an external utility, supplying

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.