Hi everyone, i'm developing a software that need's to run on windows, linux and android, since i don't want to make a version depending on the OS, i'd like to know if there is a way to automatically use a librarie, e.g. for android i've to use the following line to toggle on the keyboard:
void showSoftKeyboard() {
android.view.inputmethod.InputMethodManager imm = (android.view.inputmethod.InputMethodManager) getActivity().getSystemService(android.content.Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(getActivity().getCurrentFocus(), 0);
}
the part "android.vie.in......." doesn't allow me to compile for windows (which makes sense, since it's for android) but i think there is a way to makeit depend on the OS to use it or not. To recognice the OS i would use:
String os=System.getProperty("os.name"), vendor = System.getProperty("java.vendor.url");
where the OS in android reports as "Linux" but in vendor says "www.android.com", so i know wich OS i'm running.