Possible Duplicate:
How to create a file in android?
I have a game that requires the user to “login”. Instead of having to type in their username and password everytime, i would there to be a auto-login feature. So when the user starts up the app all they have to do is press a login button and it will log them in automatically so that they dont have to input their username and password everytime. I thought i could write a file containing the username and password and then the app could read from that file and then send that information to the server. How do i create a file in android? How do then write to that file? How do i read from it? I can do I/O stuff in Java so I know the basics but i dont think it is the same for android. Can someone walk me through it?
For something this simple, try a SharedPreference. Other options can be found here:
http://developer.android.com/guide/topics/data/data-storage.html