I have a few questions about debugging.
I would like to create different preferences to use when the application runs on the phone (release) and when it is being tested. For example the URLs for the API or the passwords or the UserId which can be different during the test phase.
To do this I'm thinking of setting everything inside sharedPreferences and then if the application is debugging or not, take the right variables.
I also thought of saving everything up in config files, but for now I have not understood if it is possible to do it or not (I am studying) and if it is convenient
The sharedPreferences I understood how it works.
1) I would like to know if there is a method that returns a value if the application is debugged or not.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
if (BuildConfig.DEBUG) {
toast("debug")
}
}
but even when I install the application on the phone it tells me that it is always debugged
In the future I would also like to look for automatic testing systems (which I don't know). I read that there is Appium (but certainly others too) that allows you to test the application but for now I have not gone into this yet.
2) Eventually then there is a method to understand if you are in the test phase, I don't know if these utilities run the app in test or real mode.
3) Do you know of other test systems?
Thanks