+ 1

How to place images into android (Java N-IDE)?

I have an android N-IDE on my device but instead of just having a "drawable" file, it has several files where the example image has been places in several slots. The slots it is in are called "drawable-ldpi", "drawable-mpdi" and "drawable-xhdpi". Why is this different from all the tutorials I am seeing and on what folder would I need to place an attachment to successfully locate it? (In the example the image is accessed as being in the drawable file, even though that one is empty)?

11th Nov 2020, 5:01 AM
Cam UOR
Cam UOR - avatar
4 Respostas
+ 6
Those files(drawable-idpi(low density pixels), drawable-mpdi(medium density pixels), drawable-xhdpi(extra high density pixels) are for supporting different screen sizes/resolution or pixel denisity screen. It's always good practice to have separate drawable files for different pixel denisity devices, but you can also just have an single drawable(named only draweble) folder where you can paste all your icons and images required for your app. But disadvantage of this way is your apps images and bitmaps are not same for the all devices vary from big to small screens. For i.g in big screens images may be seen as pixelated. Images quilty is not same in all screens, so to support big screens as well medium and small you need to put different image quality in different drawable folder. -further more https://developer.android.com/training/multiscreen/screendensities
11th Nov 2020, 6:00 AM
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~ - avatar
+ 1
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~ Thank you for the explanation. I have put the source as @drawable/work.png but the config thing states that imported ImageView does not work. How do I fix this so the picture shows now that I have put it in the right file?
11th Nov 2020, 6:34 AM
Cam UOR
Cam UOR - avatar
+ 1
Never mind I have realised what the problem is. Thank you for your help!
11th Nov 2020, 6:45 AM
Cam UOR
Cam UOR - avatar
0
How did you solve the problem?
28th May 2023, 3:24 PM
Ù‡Ű§Ù…ÙˆÙŠŰł Ù‡Ù…Ű±
Ù‡Ű§Ù…ÙˆÙŠŰł Ù‡Ù…Ű± - avatar