Florina Muntenescu introduces Room, the database persistence library for Jetpack. Room allows you to:
* write less boilerplate code
* map query results to objects automatically
* provide compile-time checked queries
* test database operations, including migrations, more easily
* avoid performing any database operations on the main thread

Take a look at the resources below for more information!

Google I/O Room Talk →
Room persistence library guide →
Architecture Components code samples →
Persistence Codelabs →
Incrementally migrate from SQLite to Room →
7 Pro-tips for Room →
Room with a View codelab →

Watch more Android Jetpack videos here →

Subscribe to the Android Developers channel here →

#jetpack #featured

Nguồn: https://u-os.org

Xem thêm bài viết khác: https://u-os.org/cong-nghe

Author

25 Comments

  1. D'Angelo Barksdale Reply

    I'm gonna ask you this one time, where is database builder? i'll do one better, who is database builder? and I'll do one better more, why is database builder?

  2. Troll Berserker Reply

    Can user dynamically create and delete tables from a database using Room?

    It seems like it works only with a predefined set of tables hardcoded by developer.

  3. Sonic The Hedgehog Reply

    Android is Awesome And Cool i Got Samsung Galaxy Express Prime 3 from At&t it Got Android 9 pie now

  4. Micheal Andretis Reply

    You guys need to clarify your relationships documentation. It's misleading and barely comprehensible. Room is supposed to reduce "boilerplate code" but a single join query requires way too much complex code.

  5. Carlos Bedoy Reply

    The really tricky part is when you want to use on your custom objects and relationships.

  6. make a video to explain @Relation and @Embedded annotations. They are very confusing.

  7. Htop Skills Reply

    Any official programming language for Android (Including Java) deserve a video like this

  8. Seems like Google is anti-boilerplate when it comes to just about anything. Seriously, I have no issues with boilerplates.

  9. Thankyou Sister for your tuto!Can you help me i have this error:cannot access database on the main thread since it may potentially lock the UI for a long time.I use arch components.in the Dao class:@SuppressWarnings(RoomWarnings.CURSOR_MISMATCH)

    @Query("SELECT * FROM user_table WHERE email=:email AND mdp=:mdp AND role=:role")

    User getUser(String email,String mdp,String role);
    ,the repository class:public User getUser(String email,String mdp,String role)

    {

    user=this.userDao.getUser(email,mdp,role);

    return user;

    } and the viewmodel this:public User getUser(String username,String mdp,String role)

    {

    return userrepository.getUser(username,mdp,role);

    } an i want use it for call it in the mainActivity like this:user=userViewModel.getUser(login,mdp,item);Thankyou!

  10. Nicolas Maldonado Reply

    There is typo:
    The method It's not called fallbackToDestructiveMigrationsFrom() but fallbackToDestructiveMigrationFrom()

    Without an S in Migration

  11. Kathiriya Harshadbhai Reply

    Any ideas about export roomdb data into external Sdcard?

  12. How can i use a predifined sqlite.db with room? I have search the last hours but i can not find any solution. I think that this must be solved from google except if you already did it and i can not find it!

  13. Vladislav Syrgashev Reply

    Hi Florina!!! As i see You are a pretty good at Room stuff in the whole world. Could you please help me understand one aspect of it. I am new at programming Android. So this is my kind of problem i got stuck with. I pretty much understand how this Room works. Anyway, I've got SQLite database file with 1000's of rows of data. And i want my project to fetch data from this .db file and populate RoomDatabase. But all solutions on Stackoverflow seem to fail. Can you show me the way to do it, please? Thank you.

  14. Flawless Saturation Reply

    Well, she's Romanian.. But however she's good on English, and you can easly understand, what does she wants to tell to us, and of course I have watched this video not for learning but to impress myself that she is a Romanian and she became a Android Developer and presentator of Google Developers, Yeah she's earning a lot, but i don't take care about it, i also want to become an Android Developer not for money, but to show to people that i can break the ice, i have only 12 years and still understanding this, but however i'm learning everyday a little bit, and with this tempo i will know perfectly java language for android. So if you are an android beginner developer, don't worry about this, everyone was like you when they wanted to start this, soo don't take the Android Studio yet, because it will be hard to understand for you, just go to your phone and download Sketchware from Google Play, (In case that you are a beginner) . In this app you will develop your app also like android studio, but there codes are blocks, and every specific block is an code, but is much easier to understand, soo guys please leave a like on this comment, i hope that i helped you, Thanks

  15. Victor Gradinescu Reply

    Good job on improving your pronunciation. Keep up the good work!

  16. Tobias Preuss Reply

    Where has version 2.0 been published? The Google Maven repository only lists androidx.room 2.0.0-alpha1. Release notes are missing, too.

Write A Comment