Android Question Run code only once

Munir Mehta

Member
Licensed User
Longtime User
Hi,
I am little new to the development and started working very recently .
I have one doubt, how to run code once in the life cycle of application.
I am trying to create an application and i just want to run the entire database set up. So that code only needed to run once after that i ll be just updating values.

One way i was thinking was to create a table and checking the value, if the value is true then i would not run the code.
Is this the way or any other way which i am unaware of..

Thank you in advance
 

MaFu

Well-Known Member
Licensed User
Longtime User
So the code should run one time after app installation regardless how often the app will run?
You say the code takes a database setup. After that exists a new database file in File.DirInternals?
If so then you only check if the file exists.
 
Upvote 0

Munir Mehta

Member
Licensed User
Longtime User
Yea... I just want to run code only once regardless how often app should run.
I guess your solution should work.
Will check the file in DirInternals...
Thanks MaFu
 
Upvote 0
Top