Recent

Author Topic: Javavcl editboxes and storing data to text files, Android  (Read 2326 times)

januszchmiel

  • New Member
  • *
  • Posts: 15
Javavcl editboxes and storing data to text files, Android
« on: March 23, 2018, 10:46:11 am »
Dear core developers,
I do not know, if it is possible to use commands for working with text files when working in Android compiler mode.
I have declared data type
f: TextFile;
LString : string;

    LString :=LEditName2.Text;
    dataa :=LEditName1.Text;
AssignFile(F,LString);
rewrite(F);
writeln(F,dataa);
   CloseFile(F);

But file have not been created. I have used Javavcl and various Android Free Pascal units to create GUI with two edit boxes. But I do not know, if it is possible to work with files by using previous commands when develop for Android.
My aim is to create Notepad, which will only contain two editable boxes. One for storing text, second for storing file name and The save button. That is all.
Since I do not see at all, simplicity is very important for Me.
I have tried to adapt included example Lovecalc according to my needs. I have big hope, that this programmers technique, based on Javavcl library will allow me to write nice GUi programs, since using pixel values commands argument is not necessary. And The code is simple.
I love this project, since it enable Me to access really all build in Android APIS. And GUI can be created with no need to use Java code at all, it is not approach based on Mixing Java and Pascal language. And project is fully functioning from Windows 1é X64 bit edition. Any help will be very welcomed.
I have my whole source code but uses redundant code for Love calc, I must firstly undestand its logic, remove redundant lines and then I will only have three GUI controls. Two edit boxes and one save button, nothing else. Sure, I must remove one line from .prl file to avoid using FORM about, since I do not need about button and dialog.
« Last Edit: March 23, 2018, 10:49:07 am by januszchmiel »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Javavcl editboxes and storing data to text files, Android
« Reply #1 on: March 24, 2018, 02:38:04 pm »
What's the content of LString? You may not have the permission to write to storage (internal or external, two different permissions, I believe).

januszchmiel

  • New Member
  • *
  • Posts: 15
Re: Javavcl editboxes and storing data to text files, Android
« Reply #2 on: March 24, 2018, 04:32:36 pm »
I thought that
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Is enough to enable Pascal to access internal storage. Since when ever application has started, it creates folder inside Android folder Lovecalc.
I Am afraid, that assign, rewrite and other commands are not compatible with Android Dalvik, or may be, that it is only possible to use those commands in console mode.
I Am sad, because i like Pascal so much. And It is the only one language, that I can understand and I can make changes even inside existing sources without making non sense program. The question is, if variable, with stores data from TEdit can be directly used by using file operation commands.

januszchmiel

  • New Member
  • *
  • Posts: 15
Re: Javavcl editboxes and storing data to text files, Android
« Reply #3 on: March 24, 2018, 10:50:17 pm »
So. I Am sending .zip file with project based on Javavcl to you. Source code have been reduced. I have stop to use caption property while using edit box, since it do not create Edit box label, it simply add text of The caption to The corresponding edit box. I Am wondering, if it is possible to use label of edit box, or caption will only allow to give names other GUI controls than Edit boxes. he project do not create files. But I do not get AN error. May be, that somebody will help me. Thank you very much for yours time and help.

 

TinyPortal © 2005-2018