Piotr0603 0 Posted June 23, 2022 Hi, I am new in Delphi (10.4 Community Edition) developing on Android devices. I want to add a little text file to my apk on Android device. I do all what is described in https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Deployment_Manager: (Alexandria or 10.4 - the diffirence does not matter I think) 1. choose file in my laptop (Windows 10) - file is shown in Deployment Manager with the same name 2. in column "remote path" write the name of directory on Android device: .\assets\internal\Android\data\com.android.Tuczarnia\files\ (Tuczarnia is the name of apk) 3. build the apk 4. my file can't be found on folder ..internal\Android\data\com.android.Tuczarnia\files\ 5. I noticed that 'Connect" button in Deployment Manager is not active and all files have status "Not Connected", but it seems (after reading help of Deployment Manager) that this works automatically for Android 6. and I noticed, after unzipping the "apk" file, that my file is present in "assets/internal/Android/data/com.android.Tuczarnia/files/" inside that file 7. so it seems to me, that file is lost during the process of installing the apk - WHY? I use and have 1. Windows 10 2. Delphi 10.4 Community Edition 3. phone Xiaomi Redmi 8 with Android 10 Important: my application works fine without adding this file, application has over 10 screens and uses SQLite with no problems. So only one and new problem is adding new file. Thanks in advance to everyone piotr0603 Share this post Link to post
Dave Nottage 557 Posted June 23, 2022 You should read this part: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Creating_an_Android_App#Loading_and_Deploying_Files Share this post Link to post
Piotr0603 0 Posted June 23, 2022 I did read and have no idea what I did wrong Share this post Link to post
Stano 143 Posted June 24, 2022 Basic rule: put your code here. Otherwise they can't help you. Share this post Link to post
Piotr0603 0 Posted June 24, 2022 (edited) There is no code. There are only settings in Deployment Manager. I want include file while installing application on Android device, not at runtime, just "within" the process of installing it. deployment manager.bmp Edited June 24, 2022 by Piotr0603 including screenshot Share this post Link to post
Brian Evans 105 Posted June 24, 2022 (edited) 14 hours ago, Piotr0603 said: I did read and have no idea what I did wrong Did you notice the target shown as assets\internal in the help section linked? Try it with just what the help suggests to start with. Usually prefer .\ vs an empty directory string as well. Edited June 24, 2022 by Brian Evans Share this post Link to post
Piotr0603 0 Posted June 29, 2022 I read help concerning Deployment Manager and saw target "assets\internal" and tried to do what is described there. I simply don't know where is my mistake. My application creates several files in it's own folder, which name got by System.IOUtils.TPath.GetDocumentsPath is "/data/user/0/com.Android.Tuczarnia/files" (Tuczarnia is the application's name) I can create, modify and delete files there at runtime of my application. Here is extract of the tabel in Deployment Manager. I want the file "SkryptListy.txt" to be located and be seen by my application in it's own folder. local path local name type Configuration Platforms remote path remote name SkryptListy.txt File debug [Android] assets\internal\ SkryptListy.txt the file "Skryptlisty.txt" is put in project's path. I tried to replace remote path "assets\internal\" by 1. .\assets\internal\ 2. assets\internal\Android\data\com.Android.Tuczarnia\files\ 3. .\assets\internal\Android\data\com.Android.Tuczarnia\files\ .. and does not work. "Redmi 8\Wewnetrzna pamiec wspoldzielona\Android\data\com.Android.Tuczarnia\files\" is what sees my laptop after connection with the phone. "Wewnetrzna pamiec wspoldzielona" is the name (I think) of "internal storage" in english version of Android. "Redmi 8" is my phone's name Share this post Link to post