image - android: best practice for custom background -


i new android experienced java , other languages programmer.

i need create custom background initial app activity. it's quite simple, here is: http://imgur.com/vrtrro5

should pretty simple! best come is:

android:background="@drawable/background" 

first, driving me crazy, getting:

binary xml file line #1: error inflating class <unknown> 

searching, first hints pointed size issue - file size 11kb! found more hits , pointed resolution. image dimensions 1080x1920px. resized 768px (keeping ratio) , - voilá! - loaded.

however, wonder if correct approach. after many years of web development, wonder if "css-like" approach more suitable. if use image size, work fine devices , resolutions? after all, it's 2 colors (granted, curved element).

what best practices such cases? thanks!

the best practices come in understanding following 3 parts of application development , design: how handle bitmaps, how provide resources, , who target app.

starting @ target of app not person devices tend use , devices want support. in question mentioned resizing image 768px prevented error occurring error happened because 1080 (at 16:9) resolution rather large images when decompressed. own development device not capable of handling rather large image. 8m when decompressed argb, 768px image above 4mb. can see there significant memory difference. in addition considering memory sizes may consider screen size differences, image moment if had 800x480 image being displayed on capable 2048x1536 display, not considering memory usage scaled image jagged , aspect ratio flawed, worse if device's orientation changed.

the conclusion provide graphics kind of devices want support. providing these resources matter of understanding how apps organize resources.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -