Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Databases in android

  • 29-11-2012 01:27PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 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