I have simple game with 2 variables to store the score and best score:
int HightScore, CurrentScore;
I save the socre by SharedPreferences
static SharedPreferences app_preferences;
//Save hight score example
SharedPreferences.Editor hightScore = app_preferences.edit();
hightScore.putInt("HighScore", temp);
hightScore.apply(); // Very important
On Android OS, there are alot of memory editor tools, such as: GameCIH, DaxAttack, HaXplorer, SB Game Hacker, GameGuardian (working on Android version up to Kikat 4.4) and Game Killer (fully compatible with android Lollipop)
I hope some one help me figure out some strategies to prevent my variable form being modified by those tools?
I'm really appreciate your helps. Thank you very much in advanced.
Generally, I don't really know any tools or anything for that.
But as a temporary solution, if you REALLY want to get it prevented under any circumstances, why not create two variables which have to be added to be the new highscore?
But you would always have to work with these two values together then. I wouldn't recommend it.
ALSO, it could happen that the compiler notices the two variables being added all the time and it creates one variable out of it after all.
You can also check for installed packages.
That's probably the best way.