i want to save a variable to be global variable on all screens i have, for example, for every connect to the localhost i am using 10.0.2.2 so i have to write that ip on every connect,and when i want to try my application on my mobile device i have to go to code and replace all the 10.0.2.2 with my system static ip 192.168.1.101 ,is there any way to say that ip on a global variable? i read that i have to used string on android but i don’t know how, any help please
i want to save a variable to be global variable on all screens i
Share
Use SharedPreferences to store and retrieve it: http://developer.android.com/reference/android/content/SharedPreferences.html
Example: http://developer.android.com/guide/topics/data/data-storage.html#pref