Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / Dumb question.. where do I store my images?

Author
Message
iamroy
9
Years of Service
User Offline
Joined: 3rd Mar 2014
Location:
Posted: 5th Mar 2014 06:35
Sorry, I'm new to this library. If I have the following:



Where do I store image1.png? Should it go in the assets/media?

Thanks,
Roy
The Daddy
15
Years of Service
User Offline
Joined: 13th Jan 2009
Location: Essex
Posted: 5th Mar 2014 20:51
Iamroy

When you ask "where" you do not state on what device, as it differs from device to device. For a windows desktop, you would store your media in the Apps BIN folder, on an android app developed on a windows desktop, you would store it under the android assets folder. Not sure about iOS!

www.bitmanip.com
All the juicy you could ever dream of!
The Daddy
15
Years of Service
User Offline
Joined: 13th Jan 2009
Location: Essex
Posted: 5th Mar 2014 20:52
Sorry, yes assets/media!

www.bitmanip.com
All the juicy you could ever dream of!
iamroy
9
Years of Service
User Offline
Joined: 3rd Mar 2014
Location:
Posted: 7th Mar 2014 01:25
Yeah I tried that but I just have red x's :/
Ancient Lady
Valued Member
19
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Mar 2014 02:22
iamroy, make sure that the name of the file and the code you load it with are exactly the same casewise. Android is case sensitive. So 'image.png' and 'Image.PNG' are two different files (unlike in Windows).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
iamroy
9
Years of Service
User Offline
Joined: 3rd Mar 2014
Location:
Posted: 8th Mar 2014 02:28
Thanks Ancient Lady, tried that and still no luck. I'm going to try saving it with different PNG settings. Maybe Android is picky about its PNGS?
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 9th Mar 2014 21:55
I think T2 uses the /assets folder as the "root" folder while T1 uses /assets/media. If you are using t2 and want to store images in the media folder, you want to use "media/image.png" as the image path or move the image out of the media folder

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
Ancient Lady
Valued Member
19
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 11th Mar 2014 04:40
Do you explicitly use 'media' in the load or just let it default?

I always explicitly use '/media/somefile.png' and did this both with Tier 1 and Tier 2.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 11th Mar 2014 11:07
In T1 I don't type out /media. I noticed that when saving a file, the default location is /media/filename so I don't think it's needed. On T2 the root directory seems to be assets so you have to type /media to get to the media folder

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
iamroy
9
Years of Service
User Offline
Joined: 3rd Mar 2014
Location:
Posted: 11th Mar 2014 21:37
I can't figure it out. This is T2.

This is my code: agk::LoadImage ( mciBottomThrust, "/media/bottomthrust.png" );

I have the image inside of the assets folder, the media folder and just to check the res/drawable folder. I've tried many different combinations of /media, media, assets/media, /assets/media and I've also tried the drawable directory. I've also looked in the project folders and made sure the files are there.

Such a weird thing to have trouble with.

When I add an image to my project, do I need do anything special to it? Or can I just drag it into my media folder?
iamroy
9
Years of Service
User Offline
Joined: 3rd Mar 2014
Location:
Posted: 11th Mar 2014 21:44
Ok so I went through a just resaved my png file. Now it works if I use media/filename. Thank you all for the help, I appreciate it. Looking forward to using this engine.

Login to post a reply

Server time is: 2024-02-26 20:12:57
Your offset time is: 2024-02-26 20:12:57