How to access the assets?

Hello and Happy New Year,

Sorry to bother you but I have a problem with my app and I don’t know who can help me.

I have several files in assets and I want to be able to access them but when the app is installed I don’t know where they are.

I have visited various forums and have seen that they are supposedly in: //mnt/sdcard/Makeroid/assets/ but I cannot find the path in either internal or external storage.

If I create the route manually, if the app runs correctly but my intention is that whoever installs the app can install those documents without having them in the cloud.

They are pdf’s and Word documents and they don’t take up much, so I don’t think it’s necessary to upload them to the cloud.

Thank you very much for all the help.

/storage/emulated/0/Makeroid/assets/
ur assets are here always remember

/mnt/sdcard/ = /storage/emulated/0/

also change ur topic title to assets access something like it

I don’t know much but they should be in your ASD app specific directory.

I have the application installed and I do not have the directory created by Makeroid. I’ve done a search for “assets” and they don’t appear.
When I run the application with the emulator it works perfectly but the application on the device does not work.
I don’t know if the app has any bugs but doesn’t install assets, I have to create Makerois / assets directory for it to work.

Thaks a lot

The assets are only stored in the external storage while testing using the companion, the assets get bundled with the app while compiling as apk.

It depends on which component you would use, normally, you would use the asset name for using the asset with components such as the image , player, video player,screen , button , canvas background images,etc… When reading files using the file component , you should prefix the file name with two slashes //.

2 Likes

They are, above all, pdf and pptx files.

I´m going to try to do this.

It doesn´t work it. I share the AIA for chek it but I think that all is correct.

I’m really sorry but I’m a newbie and I don’t have much programming knowledge.

Thanks

AIA: Patria – Google Drive

What doesn’t work?

Your app has 17 screens. That is the first problem. Show the relevant blocks where you have problems accessing the assets.

Hello Anke,

The problem is in that I can´t open the docs (pdf and pptx) in the Activity Starter of the List Picker in the Screen1. The others 16 Screen will have the same problem, when I finish them.

I have the app installed. I know that if i want that the app run with the emulator the Activity Starter must be this:

When the app is intalled, I don´t know how to open a file from the assets.

Thank you very much for all your answers

As far as I know it is not possible to access files from the assets with the Activity starter. You have to copy them first to the external storage (best: ASD, because no WRITE permission is needed) and access them from there.

The Blocks with /.../Makeroid/assets/... will work with Companion, because these files are already in the external storage. As @Mohamed_Tamer said, the assets are in the internal storage (appPackage) after compiling the app (APK).

See also here:

https://puravidaapps.com/snippets.php#2pdf

Of course, thanks Anke.

In resumen:

  1. Once the App is installed, the files in the “assets” folder cannot be accessed, unless you are Root.
  2. To be able to access them, you either have them in the cloud or you download them.
  3. You access them with a double slash “//.file.txt”.
  4. That was the answer to my question.

Trank you very much to everybody for your time.

correct

you should copy them to the internal (emulated) sdcard and access them from there
but not to the ASD, because that directory is only accessible by your app itself, however there are a few exceptions like file manager apps, which are also able to access the ASD of your app

Taifun

1 Like

That’s exactly what I said.

As I already described in my guide

there is an → internal storage and an → external storage. The emulated SDcard is in the external storage.

Yes, that’s true, but there is no reason (mentioned here) not to use it.

1 Like

sorry, I just repeated it with other words… :crazy_face:
yes, I’m very familiar with your guide… excellent…

Taifun

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.