简体   繁体   English

如何将数据库连接到 Android 应用程序?

[英]How do I connect a database to an Android app?

I am new to Android development and I am working on building an app.我是 Android 开发的新手,我正在构建一个应用程序。 I am currently stuck on the log-in screen because there are no up to date tutorials that can walk me step by step into creating and linking a database.我目前卡在登录屏幕上,因为没有最新的教程可以引导我逐步创建和链接数据库。

I would like to have a database so that when the register button is pressed, the information is stored into a database.我想要一个数据库,以便在按下注册按钮时将信息存储到数据库中。

I currently only have activity_main.xml and MainActivity.kt, the basics of creating a blank activity.我目前只有 activity_main.xml 和 MainActivity.kt,这是创建空白活动的基础知识。

There are up to date tutorials for everything if you just do a quick google search.如果您只是进行快速的谷歌搜索,那么所有内容都有最新的教程。 There are a number of different techniques.有许多不同的技术。 Here are a few up to date things provided by Google that I will encourage you to learn and experiment with:以下是 Google 提供的一些up to date内容,我将鼓励您学习和尝试:
Room Persistence Library 房间持久化库
Android Room with a View - Kotlin Android Room with a View - Kotlin
Using Room Database | 使用房间数据库 | Android Jetpack 安卓喷气背包

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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