I suggest you read this ...
From what you're asking, I think Shared Preferences are the way to go, since it looks like you just want to store an int value.
Question
Following are the requirements for creating a file in my Android application
1.File will be created when the application is launched at first time and write 0 to the file
2.whenever the application is opened, first read from the file and then based on that value a new value will be written to the file.
please help me.
Solution
I suggest you read this ...
From what you're asking, I think Shared Preferences are the way to go, since it looks like you just want to store an int value.