- This topic has 4 replies, 3 voices, and was last updated 11 years, 7 months ago by alonso100.
-
AuthorPosts
-
alonso100MemberHello,
I have an image widget which displays the flag of a selected country on the screen. It works fine everywhere except when I generate the .apk file and install it in my smartphone. From around 220 flags some 45-50 are not displayed and I think that the images are not being copied into the executable file.
I marked the checkbox for selecting the image subdirectory when creating the .apk and also double-checked that all images in the subdirectory are marked. I then used JS Alert for displaying the path and file name to select; it is Ok. This is my code:
function HandlerCountry2(transaction, results){ var tot_recs = 0; var path_flag=""; var icon_name = new String(); tot_recs = results.rows.length; if (tot_recs >= 1){ for (var i=0; i<tot_recs; i++) { var row = results.rows.item(i); icon_name = row['Icono']; icon_name = icon_name.toLowerCase(); path_flag = 'Banderas/' + icon_name + '-flag.jpg'; alert(path_flag); $('#m1-Country-Flag').attr('src', path_flag); } } }
How can I know that the images are being copied ?? If it ever helps, the last android build is 1581046.
Thanks.
BrandonMemberYou will need to add them to the project using the Additional Files dialog for the screen on the bottom right hand side. Sadly, you have to do each file as it wont allow multiple files or directories
alonso100MemberI know that, I did that and that is precisely what I tried to explain in my opening posting. As I wrote, most of the files must be available in the .pak file but some are not. I wrote that there are aroung 220 image files in my subdirectory, 45-50 out of it are not available once the file has been installed.
support-octavioMemberHi Alonso,
My first thought is that the format of that images that are not copied is not compatible with android. Can you run the next experiment:
1.- Change the extention of your .apk file to .zip
2.- Unzip file and go to: assets > www and look for the folder where your images should be
3.- Are all the images there?
3.1.- If the missed images are there, it means that the app have been built correctly and should be a problem with the format of images. Please share an image to investigate and provide you the better advice.
alonso100Memberhi,
that trick is a good one !! Ok, I know now what the problem is. It´s simply that application is considering old information. I had renamed some images, so my code cannot find the new flag´s name. Here are some examples:
1) name to select –> bosnia.jpg and in the .zip-file –> Bosnia.jpg
2) name to select –> czechrep.jpg and in the .zip-file –> CzechRep.jpgAlthough I had copied the subdirectory with the new names into Main-www, somehow when packaging the files it still keeps the old data. Now I have deleted ALL files (except Main_custom.js) and it works fine.
Thanks.
-
AuthorPosts