简体   繁体   中英

Android connect to database with password authentification using Kotlin

I'm trying to program a simple android app with database connection, however I've only recently started with Kotlin and so far, even after several hours of searching, I haven't found an understandable tutorial that shows how to enter/read something into a database via Kotlin.... Can anyone help here or has a good tutorial?

I've tried SQLiteOpenHelper so far, since I haven't found an alternative for MySQL (both MySQL and SQLite are installed and set up on my server). However, with SQLiteOpenHelper, I can't seem to specify a password to authenticate with the database....

You should go for Room Database

As per android developer docs :

The Room persistence library provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.

Room Database is the best.

Also, has support for RxJava as well as LiveData and Flows. I recommend using Flows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM