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?

Comments

  1. I use JFileDialog that the link says (JIntent in Androidapi.JNI.Interfaces).
    So 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... :(

    ReplyDelete
  2. What ends up in the filename variable?

    ReplyDelete
  3. I'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

    ReplyDelete
  4. David Nottage me too!! I searched everywhere! Even in the embarcadero forum they say you should create alone your code for android file manager...

    ReplyDelete
  5. problem solved! the issue was in the command MemoRecord.Lines.LoadFromFile(filename) which does not work properly! (how awful!)
    We replaced it with MemoRecord.Lines.Add

    ReplyDelete
  6. 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?

    ReplyDelete
  7. Yes! Debugger showed me that this was the one that crashed the app.
    As 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.

    ReplyDelete
  8. The test project works for me in all platforms. Make sure you add the test.txt file to the project deployment

    TMS have iCloud functionality in their iCL product:
    tmssoftware.com - TMS Software

    ReplyDelete
  9. I just noticed our difference in code! You are right!
    About TMS ad iCL, I can not find something related in the samples. In example, how to connect to iCloud drive...

    ReplyDelete

Post a Comment