Hello all!
Hello all!
In a try to create an Android application with FMX , I noticed that opendialog does not respond. So after a research on the internet I used the code from this link: http://bluexmas.tistory.com/427 . Now I want to load the text from the selected file to a TMemo but it does nothing!
I believe that the conflicts i related with the way that I select the file because when I run this with TOpenDialog in Windows it runs successfully. Any ideas?
In a try to create an Android application with FMX , I noticed that opendialog does not respond. So after a research on the internet I used the code from this link: http://bluexmas.tistory.com/427 . Now I want to load the text from the selected file to a TMemo but it does nothing!
I believe that the conflicts i related with the way that I select the file because when I run this with TOpenDialog in Windows it runs successfully. Any ideas?
Some example code might help
ReplyDeleteI use JFileDialog that the link says (JIntent in Androidapi.JNI.Interfaces).
ReplyDeleteSo when the filemanager opens , you select the file which is supposed to be kept by command:
filename := JStringToString(Data.getStringExtra(StringToJString('RESULT_PATH')));
After that I use MemoRecord.Lines.LoadFromFile(filename); to load the text of the file inside the memo.
Nothing appears... :(
What ends up in the filename variable?
ReplyDeleteI've had a look at the code for their implementation - having a completely separate activity seems like major overkill, not to mention that it looks atrocious. I'm surprised that there isn't already some implementation completely in Delphi code
ReplyDeleteDavid Nottage me too!! I searched everywhere! Even in the embarcadero forum they say you should create alone your code for android file manager...
ReplyDeleteproblem solved! the issue was in the command MemoRecord.Lines.LoadFromFile(filename) which does not work properly! (how awful!)
ReplyDeleteWe replaced it with MemoRecord.Lines.Add
LoadFromFile works fine for me on Android (v 7.1.2), using Tokyo. Did you use the debugger to find out where exactly it is failing?
ReplyDeleteI've posted a test project here:
ReplyDeleteforums.embarcadero.com - Embarcadero Discussion Forums: Memo LoadFromFile ...
Yes! Debugger showed me that this was the one that crashed the app.
ReplyDeleteAs you have tried coding in android app, I wanted to ask you if you have tested similar code for ios. Becase I can not find file manager or an easy way to connect to iCloud.
The test project works for me in all platforms. Make sure you add the test.txt file to the project deployment
ReplyDeleteTMS have iCloud functionality in their iCL product:
tmssoftware.com - TMS Software
I just noticed our difference in code! You are right!
ReplyDeleteAbout TMS ad iCL, I can not find something related in the samples. In example, how to connect to iCloud drive...