Detect Android platform
General and Desktop
4
Posts
2
Posters
2.5k
Views
1
Watching
-
wrote on 7 Aug 2013, 19:05 last edited by
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 ?
-
wrote on 7 Aug 2013, 19:54 last edited by
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
4/4