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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:40:56+00:00 2026-05-25T16:40:56+00:00

I think that this is rather easy question. I am too young in android

  • 0

I think that this is rather easy question. I am too young in android stuff already. I want to prepare application which will be using database. In every example I’ve shown, there is an empty database where application is firstly started and after that there are some inserts. I want to have app with rather big db so I want to have filled db when app is started. How can I prepare db and attach it to program?

  • 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-25T16:40:57+00:00Added an answer on May 25, 2026 at 4:40 pm
    1. put your filled database in Package’s Asset directory,

    2. at application runtime just copy that database to application’s internal storage like
      data/data/<package name>/database directory.

    3. then use it.

    EDIT: this for copy database from asset directory to database directory,

    private void copyDataBase() throws IOException {
    
            try {
                // Open your local db as the input stream
                InputStream myInput = myContext.getAssets().open("your Database file name");
    
                // Path to the just created empty db
                String outFileName = "/data/data/<package name>/databases/";
                OutputStream myOutput = new FileOutputStream(outFileName);
    
                // transfer bytes from the inputfile to the outputfile
                byte[] buffer = new byte[1024];
                int length;
                while ((length = myInput.read(buffer)) > 0) {
                    myOutput.write(buffer, 0, length);
                }
    
                // Close the streams
                myOutput.flush();
                myOutput.close();
                myInput.close();
    
            } catch (Exception e) {
    
                Log.e("error", e.toString());
    
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Searching here I found that this question was already asked , but I think
I think that this problem can be sorted using reflection (a technology which I'm
Hopefully this question won't be too convoluted or vague. I know what I want
I don't think that this is specific to a language or framework, but I
I don't think that this could be done in C#, but posting this just
I don't think that this is doable, but wanted to throw it out to
I'm familiar with some mnemonic/memorization techniques for about a year. I think that this
sed 's/^\(\h*\)\(.*\)$/\1<!-- \2 -->/' web.xml I think that this should take this xml: <a>
Do you think that C# will support something like ??= operator? Instead of this:
This is the URL. http://www.tumblr.com/ I think that its based on prototype, and is

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.