Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Databases in android

Options
  • 29-11-2012 1:27pm
    #1
    Registered Users Posts: 13


    Hi all
    I'm designing an app for first time. My question is in regards the design of a database in android?

    I've some knowledge of database design. Do i have to change the design concept of the tables? Do i have primary keys(i know there is no primary key in android what i mean is have same column names across different table so i can link them)?

    Do i create multiple classes using SQLiteOpenHelper for each class for the tables that i am designing?

    thanks for help


Comments

  • Registered Users Posts: 124 ✭✭shanefitz360


    There are no primary keys in android? The android DB is SQLite3 and supports all functionality you would expect from SQLite3, i.e. primary keys, foreign keys, tables etc.

    I'd recommend this tutorial.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    pdidit wrote: »
    Do i have to change the design concept of the tables?
    Design concept? I presume you mean the ERD.

    Short answer is not really. Longer answer is that SQLite is not as full featured as the databases you're probably more familiar with, so you may need to design some of it differently to get around any limitations. At the very least some of the field types you'll be using will likely differ.
    Do i have primary keys(i know there is no primary key in android what i mean is have same column names across different table so i can link them)?
    As shanefitz360 pointed out, SQLite on Android does support keys.
    Do i create multiple classes using SQLiteOpenHelper for each class for the tables that i am designing?
    Not entirely sure what you mean. You may want to split up your business logic, when interacting with the database, into different classes, but if you're using a different class per table, my first thought would be that you don't really understand the point of RDB's very well.

    Could you elaborate?


Advertisement