Use referenced filename images in Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Use referenced filename images in Android

Post by Mag »

I'm using referenced images files on my project. All works well in iOS, unfortunately under Android the images are not displayed.
Maybe could be a problem I have in the Standalone Settings, any advice will be greatly welcomed!
Attachments
and.png
stand.png
copy.png
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Use referenced filename images in Android

Post by Mag »

Nobody uses referenced files in image objects? This will be the main mode of using images in LiveCode 6.5 which has resolution independence...
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Use referenced filename images in Android

Post by jacque »

The most likely cause is that the referenced file path is wrong. Check your images to see what paths are being referenced. If they are absolute references (i.e., they include the name of your hard drive or user folder) then they will fail if the stack isn't on your own hard drive.

Also check the Files & Memory pane in LiveCode preferences and make sure that absolute file paths are not selected. If it is, then all the images you referenced will be absolute.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Use referenced filename images in Android

Post by Mag »

Thank you so much Jacque!
ChrisMukrow
Posts: 73
Joined: Mon Nov 12, 2012 4:13 pm

Re: Use referenced filename images in Android

Post by ChrisMukrow »

Also make sure that the referenced filename is case-sensitive (only Android?). This is a problem we found with porting from iOS to Android.
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Use referenced filename images in Android

Post by Mag »

Thank you, I will double-check this values.
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Use referenced filename images in Android

Post by Mag »

OK, it was a bug, solved on 6.1.3 rc1. Thank you to all.
michix74
Posts: 3
Joined: Sun Jan 19, 2014 11:30 am

Re: Use referenced filename images in Android

Post by michix74 »

hi
i search over all android forum but i don't understand how make visible referenced images in androip app with standalone builder. I'using use livecode 6.5.1
I created only a stack and then add image from File Menù -> New Referenced Control, then i choose icona.jpg from /Users/michix/Documents/LiveCodeFiles. There is no script in stack code; you can see all settings in attachment, but i don't understand where i have to specify specialFolderPath
Attachments
Icona.jpg
Klaus
Posts: 14326
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Use referenced filename images in Android

Post by Klaus »

Hi michix74,

1. welcome to the forum! :D

2. The trick is to use RELATIVE (to the stack) pathames (filenames) and
not absolute pathnames to make it work without scripting!

Do this:
1. put all your images you want to reference in your app into the same folder as the stack (the later APP)
Or use a substack "images" or whatever.

In my example I presume that the image is in the same folder as the stack, no subfolder!
And I will use an imaginary image named "trasonos.png" (I just made up that name! :D )

2. Then do NOT use the menu to create a referenced image but use the image tool to create an empty image object.

3. Open the inspector palette for that image and enter the filename manually in the "filename" field in the inspector!
This means JUST the filename
traonos.jpg
NO folder or anything else!

Since the eingine will look into the same folder as the stack for images it will find it, since you entered
the correct relative (to the stack) path! OK, it is not really a path but a filename, but you get the picture :D )

If you have a subfolder named "images" enter:
images/trasonons.jpg

4. The image should appear in the image object.

5. Congratulation, you just created your first referenced image with a relative path!

6. Now add the image(s) via the "Copy files..." tab in the standalone builder like before and it will work on your device!
And on any other machine be it a tablet, smartphone or desktop machine!

Now if you want to access that image on the devide in any script (just an example, you dont need to 8) ) here is where
the standalone builder will copy it to:
specialfolderpath("engine") & "/trasonos.jpg"

Look Ma, no scripting :D


Best

Klaus
michix74
Posts: 3
Joined: Sun Jan 19, 2014 11:30 am

Re: Use referenced filename images in Android

Post by michix74 »

Klaus wrote:Hi michix74,

1. welcome to the forum! :D

2. The trick is to use RELATIVE (to the stack) pathames (filenames) and
not absolute pathnames to make it work without scripting!

Do this:
1. put all your images you want to reference in your app into the same folder as the stack (the later APP)
Or use a substack "images" or whatever.

In my example I presume that the image is in the same folder as the stack, no subfolder!
And I will use an imaginary image named "trasonos.png" (I just made up that name! :D )

2. Then do NOT use the menu to create a referenced image but use the image tool to create an empty image object.

3. Open the inspector palette for that image and enter the filename manually in the "filename" field in the inspector!
This means JUST the filename
traonos.jpg
NO folder or anything else!

Since the eingine will look into the same folder as the stack for images it will find it, since you entered
the correct relative (to the stack) path! OK, it is not really a path but a filename, but you get the picture :D )

If you have a subfolder named "images" enter:
images/trasonons.jpg

4. The image should appear in the image object.

5. Congratulation, you just created your first referenced image with a relative path!

6. Now add the image(s) via the "Copy files..." tab in the standalone builder like before and it will work on your device!
And on any other machine be it a tablet, smartphone or desktop machine!

Now if you want to access that image on the devide in any script (just an example, you dont need to 8) ) here is where
the standalone builder will copy it to:
specialfolderpath("engine") & "/trasonos.jpg"

Look Ma, no scripting :D


Best

Klaus
thank you so mach
it's really work and now, in copy file, i have only non-abosute path to file
Attachments
Icona.jpg
Post Reply