I've been doing quite a few programs in VBA
epecially for EXCEL
. Now I'm trying to do one for my android phone.
I usually have it so you can choose your own language. If I do it like I did it in VBA
it would probably look like something below.
But where do I put it? A class by itself or in my main class?
It is important that it is accesible from all classes as well as runnable threads/handlers and so on. Suggestions ?
int language = 2; //2 For swedish
Button cancelButton = (Button) findViewById(R.id.button04);
cancelButton.setText(getTranslation(1, language));
public String getTranslation(int textItem, int language) {
String returnValue;
String dictionary="01Cancel@Avbryt@Cancelado@02Yes@Ja@Si@03No@Nej@No@04Continue@Fortsätt@Continuar@"
// Code to extract Stringnr 'textItem' of the language 'language'
return returnValue;
}