diff --git a/src/porting.cpp b/src/porting.cpp
index 219e1647dc2fa9337826e9e10db322f8cffb09d2..885b36e21a341e478bbc0996f67afb210c99f1ff 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -575,6 +575,7 @@ v2u32 getWindowSize()
 	return device->getVideoDriver()->getScreenSize();
 }
 
+#ifndef __ANDROID__
 #ifdef XORG_USED
 float getDisplayDensity()
 {
@@ -609,7 +610,6 @@ float getDisplayDensity()
 }
 #endif
 
-#ifndef __ANDROID__
 v2u32 getDisplaySize()
 {
 	IrrlichtDevice *nulldevice = createDevice(video::EDT_NULL);