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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:23:56+00:00 2026-05-18T21:23:56+00:00

I’m using Sqlite with android to develop and app which can be customizable (for

  • 0

I’m using Sqlite with android to develop and app which can be customizable (for the dev) in the future. I have created a database with the data which is then to be used to create the database for the application. So if any changes need to be made in the future or I write an app for somebody else in the future then all I have to do is change this original database. The idea behind this is the dev’s database will set up all the UI and everything to do with the app.

I am stuck on what to do next I have the database I need in the app as the dev fully populated. My idea was to create another DBHelper class and within that reference the original DBHelper class and query within the new DB Class. So this is the second DBHelper class that i’m trying to create a database from a previous database:

public class appDbHelper extends SQLiteOpenHelper {
    private static final String DATABASE_NAME = "library.db"; //database name   
    Cursor all, tables, options, ui_type;
    SQLiteDatabase database;

    public appDbHelper(Context context) {
        super(context, DATABASE_NAME, null, 1);
        DBHandler databaseHelper = new DBHandler(context);
        database = databaseHelper.getReadableDatabase();
        all = database.rawQuery("SELECT * FROM config", null);
        tables = database.rawQuery("SELECT * FROM table_names", null);
        options = database.rawQuery("SELECT * FROM options", null);
        ui_type = database.rawQuery("SELECT * FROM ui_type", null);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        for(int i=0; i<tables.getCount(); i++){
            tables.moveToPosition(i+1);
            String sql = "";
            for(int j = 0; i < all.getCount(); j++){
                if (all.moveToFirst()) {
                    do{
                        sql = ", " + all.getString(2) + " " + all.getString(5).toUpperCase();
                    }
                    while (all.moveToNext());
                }
            } 
            Log.v("DatabaseSQL", sql);
            database.execSQL( "CREATE TABLE " + tables.getString(1) + "(_id INTEGER PRIMARY KEY AUTOINCREMENT"+sql+");");
        }
    }

But I have a feeling this is not the way to go about what I need to do. Any help will be greatly appreciated.

  • 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-18T21:23:56+00:00Added an answer on May 18, 2026 at 9:23 pm

    I think you do it wrong and to complicated. You provide a database to read data from where you could easily just create some inserts and your configuration will be implemented.

    Two solutions:

    1. From my own project: DatabaseAdapter.onCreate()

      There you should see the database setup and the filling of the database with data. The data itself are added with simple inserts which contains data based on constants. So a programmer can easily change the data by changing the constants.

      With that you don’t have to handle 2 databases, you don’t need to provide another database and read them.

    2. As android supports database locations you could also skip this all and just open an sqlite database file you provide in your res/raw or asset folder or anywhere on the sdcard.

    I recommend to do one of the two ways mentioned above.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
In order to apply a triggered animation to all ToolTip s in my app,
Does anyone know how can I replace this 2 symbol below from the string
I want use html5's new tag to play a wav file (currently only supported
I want to count how many characters a certain string has in PHP, but
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.