Sound & Picture Folders installation in Android App

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Joe Kot
Posts: 37
Joined: Wed Sep 14, 2011 2:49 pm

Sound & Picture Folders installation in Android App

Post by Joe Kot » Mon Dec 19, 2011 10:27 pm

I have an app that uses a lot of sounds and pictures. On my livecode pc program I have seperate folders for each. When installing my pc version these folders are installed on a pc in c:/programs/TW/sounds and c:/programs/TW/pictures. My question is how do I do this in my Android app. Where do I put the sound and picture folders so that they will be installed with my Android app. And what is the path to access them. Thanks - Joe

Klaus
Posts: 14183
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Sound & Picture Folders installation in Android App

Post by Klaus » Tue Dec 20, 2011 9:00 am

Hi Joe,

in the standalone builder you can add these complete folders on the "Copy Files" tab.
Then you can access the folders and their contens in the standalone with:

Code: Select all

...
specialfolderpath("engine") & "/sounds/"
## resp.
specialfolderpath("engine") & "/pictures/"
...

## Like this:
...
play (specialfolderpath("engine") & "/sounds/your_sound.aif")
...
Best

Klaus

Joe Kot
Posts: 37
Joined: Wed Sep 14, 2011 2:49 pm

Re: Sound & Picture Folders installation in Android App

Post by Joe Kot » Tue Dec 20, 2011 3:50 pm

I added the "sounds" folder in the "Copy Files" tab. Then I inserted the following into the card:
on openCard
specialfolderpath("engine") & "/sounds/"
end opencard
Clicking on the continue button I get an error message " can't find Handler".
What am I missing. Just what does "engine" do?

Klaus
Posts: 14183
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Sound & Picture Folders installation in Android App

Post by Klaus » Tue Dec 20, 2011 4:25 pm

Hi Joe,

sigh....

Code: Select all

on openCard
  specialfolderpath("engine") & "/sounds/"
end opencard
This is no handler or something???!!!
So the error is definitively justified! 8)

-> specialfolderpath("engine")
is a function, just like the other specialfolderpath("XXX") functions available on the desktop)
This functionis only avalible on the MOBILE platform and returns the path to the standalone folder
where you added the files and folders in the standalone builder!

That's why I used the PLAY command to to give you a working example of how to play a sound file
that is in the SOUNDS folder!

I highly recommend to read the "Android Release Notes" (Mneu: Help) to get more info about ANDROID.


Best

Klaus

prexsoccer
Posts: 29
Joined: Fri Jun 08, 2012 9:54 am

Re: Sound & Picture Folders installation in Android App

Post by prexsoccer » Tue Jan 22, 2013 8:48 am

good day,

I also have the same concern but its on the image.

how can I use image on buttons using this method?

thanks,

sample code would help.

Klaus
Posts: 14183
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Sound & Picture Folders installation in Android App

Post by Klaus » Tue Jan 22, 2013 12:30 pm

prexsoccer wrote:...how can I use image on buttons using this method?
??? Sorry, don't get this?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Sound & Picture Folders installation in Android App

Post by jacque » Tue Jan 22, 2013 8:38 pm

prexsoccer wrote:good day,

I also have the same concern but its on the image.

how can I use image on buttons using this method?
If you mean button icons, you can't. Icons must always reference images that are imported as controls into the stack. File references won't work as icons.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply