The other day, God graciously allowed me to compile PAC-ROM MM for the T-Mobile Samsung Galaxy S4 (JFLTETMO SGH-M919). So there are a lot of great things about this rom, but there were also a few things that I thought were lacking in creativity. Simple things really. Like the background. It comes standard with the CyanogenMod background. Well, that just doesn’t seem very PacRomish. So, I downloaded a custom background and edited the jpg until it was the right shape and size. I typically use Gimp for that, and today was no exception. After making the jpg into a 1920×1280 jpg file, I then used my home built script to make all of the “default_wallpaper.jpg” files. Here is the script:


echo “Changing name of jpg file.”
mv *.jpg 1920×1280.jpg

echo “Converting to 1080×960”
convert -resize 1080×960 1920×1280.jpg 1080×960.jpg
echo “Converting to 960×800”
convert -resize 960×800 1920×1280.jpg 960×800.jpg
echo “Converting to 1440×1280”
convert -resize 1440×1280 1920×1280.jpg 1440×1280.jpg
echo “Converting to 2160×1920”
convert -resize 2160×1920 1920×1280.jpg 2160×1920.jpg
echo “Converting to 2880×2560”
convert -resize 2880×2560 1920×1280.jpg 2880×2560.jpg

echo “making folders”
mkdir ./drawable-hdpi
mkdir ./drawable-nodpi
mkdir ./drawable-sw600dp-nodpi
mkdir ./drawable-sw720dp-nodpi
mkdir ./drawable-xhdpi
mkdir ./drawable-xxhdpi
mkdir ./drawable-xxxhdpi

echo “copying and renaming pictures”
cp ./1080×960.jpg ./drawable-hdpi/default_wallpaper.jpg
cp ./960×800.jpg ./drawable-nodpi/default_wallpaper.jpg
cp ./1920×1280.jpg ./drawable-sw600dp-nodpi/default_wallpaper.jpg
cp ./1920×1280.jpg ./drawable-sw720dp-nodpi/default_wallpaper.jpg
cp ./1440×1280.jpg ./drawable-xhdpi/default_wallpaper.jpg
cp ./2160×1920.jpg ./drawable-xxhdpi/default_wallpaper.jpg
cp ./2880×2560.jpg ./drawable-xxxhdpi/default_wallpaper.jpg

echo “Complete.”
echo “Move the drawable* folders to ‘vendor/pac/overlay/common/frameworks/base/core/res/res’ folder.”

You have to have imagemagic installed on your machine to use this script. Then, simply place your jpg file in a folder by itself, add this script to the folder, and run it! Here is the output:

alaskalinuxuser@alaskalinuxuser-HP-Compaq-6715b-FY288UC-ABA:~/Documents/projects/phones/wallpapers/pacman/images$ ls
alaskalinuxuser@alaskalinuxuser-HP-Compaq-6715b-FY288UC-ABA:~/Documents/projects/phones/wallpapers/pacman/images$ ./
Changing name of jpg file.
Converting to 1080×960
Converting to 960×800
Converting to 1440×1280
Converting to 2160×1920
Converting to 2880×2560
making folders
copying and renaming pictures
Move the drawable* folders to ‘vendor/pac/overlay/common/frameworks/base/core/res/res’ folder.
alaskalinuxuser@alaskalinuxuser-HP-Compaq-6715b-FY288UC-ABA:~/Documents/projects/phones/wallpapers/pacman/images$ ls
1080×960.jpg 2160×1920.jpg drawable-hdpi drawable-sw720dp-nodpi drawable-xxxhdpi
1440×1280.jpg 2880×2560.jpg drawable-nodpi drawable-xhdpi
1920×1280.jpg 960×800.jpg drawable-sw600dp-nodpi drawable-xxhdpi
alaskalinuxuser@alaskalinuxuser-HP-Compaq-6715b-FY288UC-ABA:~/Documents/projects/phones/wallpapers/pacman/images$ ls drawable-hdpi/

Once I moved the drawable folders to the folder mentioned above, I simply re-ran the compiler:

$ brunch jfltetmo
…..Edited for space…..
===============================-Package complete-===============================
Zip: /home/alaskalinuxuser/Documents/projects/phones/compile/pac6/out/target/product/jfltetmo/
MD5: 61321450dfd6eed47ac7702cb7da7b1a
Size: 294M
OTA Link:
…..Edited for space…..

Now even a simple change like the backgrounds takes a good bit of time. It took my slow computer 2 hours just to make this one change. So don’t be alarmed if it takes a while for you too!

Linux – keep it simple.

2 Replies to “Changing the default wallpaper in an Android build”

Leave a Reply

Your email address will not be published. Required fields are marked *