Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTravis Avey
18,876 PointsUse mipmap instead of drawable, Android Studio 1.1
In the video Creating the story we add the image to page 0.
mPages[0].setImageId(R.drawable.page0);
I am using Android Studio 1.1, it's now a little different:
mPages[0].setImageId(R.mipmap.page0);
Just thought I'd share in case anyone was wondering how to get those drawables to work!
Zaw Mai
1,605 PointsHey Travis, as Joe Redding have stated and linked to the android dev blog. I read mipmap sub-folders are reserved for icons. So, I just made a new android resource directory for drawable type under the res directory. This will organizes the image resources according to the types Android guidelines and the lessons have mentioned. What I did was: Right Click "res" folder -> Select "Android Resource Directory" -> Under Resource Type, selectt drawable -> Create Folders. I made 4 of them for the hdpi, mdpi, xhdpi, and xxhdpi.
Costi Khamis
12,061 PointsThank you so much!
Josh Gold
12,207 PointsIt appears that Android Asset Studio creates images automatically for you, including all the separate drawable folders for each resolution.
https://romannurik.github.io/AndroidAssetStudio/nine-patches.html
I didn't understand if this tool was for all images, or just certain kinds of images. But the tool seemed to do the job.
Mariana Marcondes
11,331 PointsThanks a lot!
Joe Redding
4,560 PointsJoe Redding
4,560 PointsI noticed this change too, but can anyone confirm that mipmap is the intended place to put images now? In this google blog they mention mipmap, but only in regard to icons, not app images. Of course they don't explicitly state anything about the drawable folder... http://android-developers.blogspot.co.uk/2014/10/getting-your-apps-ready-for-nexus-6-and.html
Here is a giant Stackoverflow thread that doesn't really answer it either http://stackoverflow.com/questions/23935810/mipmap-drawables-for-icons