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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:44:10+00:00 2026-06-10T20:44:10+00:00

I have successfully Create a database program. Basically i am dealing with a little

  • 0

I have successfully Create a database program.
Basically i am dealing with a little complex database, So need to make database in SQLITE MANAGER and Import/link that Database with my android code.
Please suggest me Tutorial to do this. Or any other Piece of code that help me.
Thanks

here Is my code for database now i want to Import mYdataBase.sqlite file in that.

public class DatabaseHandler extends SQLiteOpenHelper {
    private static final int DATABASE_VERSION = 1;
    private static final String DATABASE_NAME = "contactsManager";
    private static final String TABLE_CONTACTS = "contacts";
    private static final String KEY_ID = "id";
    private static final String KEY_NAME = "name";
    private static final String KEY_PH_NO = "phone_number";

    public DatabaseHandler(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    // Creating Tables
    @Override
    public void onCreate(SQLiteDatabase db) {
        String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_CONTACTS + "(" + KEY_ID + " INTEGER PRIMARY KEY," + KEY_NAME + " TEXT," + KEY_PH_NO + " TEXT" + ")";
        db.execSQL(CREATE_CONTACTS_TABLE);
    }

    // Upgrading database
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // Drop older table if existed
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_CONTACTS);

        // Create tables again
        onCreate(db);
    }
  • 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-10T20:44:11+00:00Added an answer on June 10, 2026 at 8:44 pm

    if you want import your database file from asset folder than below code can help you

    void checkDB() throws Exception {
            try {
                SQLiteDatabase dbe = SQLiteDatabase
                        .openDatabase(
                                "/data/data/com.yourpackagename/databases/yourfile.sqlite",
                                null, 0);
                Log.d("opendb", "EXIST");
                dbe.close();
            } catch (Exception e) {
    
                AssetManager am = getApplicationContext().getAssets();
                OutputStream os = new FileOutputStream(
                        "/data/data/com.yourpackagename/databases/yourfile.sqlite");
                byte[] b = new byte[100];
    
                int r;
                InputStream is = am.open("yourfile.sqlite");
                while ((r = is.read(b)) != -1) {
                    os.write(b, 0, r);
                }
                Log.i("DATABASE_HELPER", "Copying the database ");
                is.close();
                os.close();
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to create an ASMX Web Service in Visual Web Developer.I have successfully
I'm trying to create a NuGet package from a .csproj. I have successfully compiled
I have created an sqlite table using the following statement: CREATE TABLE IF NOT
I have managed to create a connection to the database and am able to
I have successfully uploaded files into my SQL Server database. I can bring back
So I have this program that searches the SEC Edgar database for annual reports
I have successfully created Web Services from MySQL Database using Netbeans tutorial . However,
My goal is to create a sqlite database and fill it with data (probably
I have successfully created a database and performed my first migration using: class CreateUsers
I have a VB6 program that adds a column to an MS Access database

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.