I'm coding an Android application. I need to store the id of a user in local in order that he doesn't have to rewrite its name, surname and password every time he uses the application. What is the best way to do this?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
You can Use Shared Preference;
Check this tutorial.
You can use Shared Preferences to store id
Hope this will help you
There are 4 ways Some of the below methods are useful if you want to save more complex data.
1.Shared Preferences-best for your use case
Find the tutorial here
2.SQLite-a database used for android
Check this tutorial to get through SQLite
3.Content providers, if you want to share the same local data to other applications of your choice
Find the tutorial here
4.ORM mapping libraries
a.GreenDao
my favorite-Documentation and HowToDo
b.DBFlow
little complex but fast-Documentation and HowToDo
c.ORMLite
Very good documentation and support over the internet-Documentation and How to do
d.Realm
New but heavily used by tech giants-Documentation and how to do