Jump to content

Recommended Posts

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

Basic rule:
put your code here. Otherwise they can't help you.

Share this post


Link to post

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 by Piotr0603
including screenshot

Share this post


Link to post
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 by Brian Evans

Share this post


Link to post

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×