Get application folder of current app
-
Hi,
i wrote an application for an android device using qt 5.2. In order to copy some library that should be loaded at runtime i need to transfer them from the sdcard to the internal storage.
Therefore it is proposed to use
@
PackageManager pm = context.getPackageManager();
String dataDir = pm.getApplicationInfo(context.getPackageName(), 0).dataDir;
@
But how to achieve using QTAndroidExtras? There is no static function that provides the context. Is there a built in solution for that?Thank you!
Kind Regards
-
That is what you get for thinking too complicated...
QDir provides two static functions returning a folder with write permissions for the application:
@
QString homePath()
QDir home()
@
Now everything works, i copy the libraries from the sdcard into this directory and load them afterwards.Regards