ImageListView not taking Image from Assets

Hi Team

I am using ImageListView Component in Appzard. I have uploaded image in assets of my project and placed Image in add item block. But image is not displaying in app. I have tested in companion and APK as well. Please see the blocks mentioned below.

I have also added DefaultFileScope to Asset.

Thanks
Nikhil Kumar

1 Like

This is a workaround that works on both companion and APK:


Of course, the file component shouldn’t be required, we will fix this in the next update.

2 Likes

Thanks for your response. The blocks are working fine

1 Like

However, it is strange (at least for me) that this path to the assets works with the APK (for an image):
file:///android_asset/image1.png
:astonished: :thinking:

Of course, with Companion it’s clear that it works.
file:///storage/emulated/0/Android/data/com.appzard.companion/files/assets/image1.png

1 Like

Yes, but the ImageListView component uses an external library (Picasso) to load images asynchronously which requires URIs such as file://android_asset/ for assets, file://path/to/file or even https://somesite.com/image1.png.
Btw, another solution to use assets in the image list view component is to prefix the asset name with //, it would work in APKs but not supported in the companion.

2 Likes

Thanks for the explanation! :ok_hand: :+1:

1 Like

But http://localhost/image1.png doesn’t seem to work (as it does with WebViewer).

1 Like

Not sure that way it will work or not. But the correct url should be

http://localhost:8888/image1.png

No, this (http://localhost:8888/test.html) also doesn’t work with the WebViewer.

works with the WebViewer.

1 Like

It should now be possible to use // as a prefix for assets in the ImageListView component and it would work in both APK and the companion with the latest release:

2 Likes

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