How can I create global variable keep remain values around the life cycle of the application regardless which activity running.
If possible, you should declare the variables that you need to keep alive that haven't been clear by Garbage Collector or Unload by OS in file .so To do it, you must code by C/C++ and compile to .so lib file and load it in your MainActivity.