Using getExternalStorageDirectory under LazToApk. lazarus / 43-Android ---------------------------------------------------------------------- olesio · 2015-03-19 16:33 Hello. I am totally Newbie in LazToApk. I try to prepare simple application to use under Android KitKat on my Lenovo Yoga 2 Tablet. I want to crate application which read KODI log files and extract urls from them. I can do something like that Code: [Select]if FileExistsUTF8('/sdcard/Android/data/org.xbmc.kodi/fi les/.kodi/temp/kodi.log') then //....But that "/sdcard/" or other begin of path may be different on different devices, so I need to use something universal. And I found in Google there is function named getExternalStorageDirectory. But I do not know how to use it without compile errors. I see that function is in source file in: Code: [Select]C:\LAZTOAPK\downloads\laz4android\fpc\2.7.1\source\rtl\a ndroid\jvm\androidr14.pasBut when I add androidr14 to uses section it was not seen by Lazarus IDE under LazToApk. So I added this file in Project Inspector. But I got compile errors on lines like... Code: [Select]JLStringBuffer = class external 'java.lang' name 'StringBuffer';Etc. And I do not know how to fix it. Please explain me step by step how to be able to use getExternalStorageDirectory in my code or other units. I have only customdraw package included and installed like in pdf file manual with LazToApk installation guide. Thanks for help in advance and sorry for my bad English. Best regards - olesio. ---------------------------------------------------------------------- OldSchoolProgrammer · 2015-07-26 07:33 My suggestion is to use... GetEnvironmentVariable('EXTERNAL_STORAGE') On my cell phone (LG Optimus running Gingerbread 2.3.4) and in the emulator (targeting API 10) the string returned is... '/mnt/sdcard' Test it on a wide variety of devices and see it's what you were hoping for. ---------------------------------------------------------------------- olesio · 2015-07-26 23:56 Thank you for reply. I wrote app in XE 8 anyway, but it take much free space and debug apk have big size about 7 MB. Anyway, I hope after update on my Tablet to Lolipop apps in LazToApk still will be work fine, because some from XE 8 wont. ---------------------------------------------------------------------- DelphiFreak · 2015-08-02 10:10 Hello olesio, I just would like to explain, what laztoapk is. It is a helper tool & setup which tries to make the configuration of all this SDK,JDK,NDK,lazarus,FPC,customdrawn stuff a little simpler. ( actually it generates batch-files ) The real hard work is done by FPC/laz4android. It compiles your app into a .so file. So if some functionality is available or not, does not depend on the laztoapk. It has more to do with laz4android/FPC/customdrawn.  Have fun, Sam