Detect Android platform
-
Is there a way to detecting if the program runs on Android platform?
-
Hi,
If I am not mistaken a program built for Android cannot run on another platform so why would you need to know that ?
-
Because I have a cross platform application that has a native function.
The function on Linux uses <sys/statvfs.h>, on Windows <windows.h>. On Android there isn't <sys/statvfs.h>. I have to determine if the os is linux (include) on Android (not include). -
Then it's not a runtime detection.
Use
@#ifdef Q_OS_ANDROID@
for your android specific code