Possible Duplicate:
How to determine if my app is running on Android
I am going to write a library which will be imported in both desktop and android system.
I would like the library to use different class depending on the system.
I am pretty sure there is a way to check it, but couldn’t find.
Any help will be appreciated.
You can try to look for
android.app.Activityclass through reflection. If it is present – Android system libraries is in your classpath and, thus, you are in Android.