Icons for Android apk?

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Icons for Android apk?

Post by fracteed »

The only real stumbling block I ran into after working out working the maze that is building for Android apk is getting the icons working.

After replacing the stock ZGE icon (36x36) with my own in the folder at ZGameEditor>Android>Template>base>res>drawable-ldpi and building the apk it works fine, but I would like to get the other icon sizes as well.

I created additional folders in the same ZGE Template location(drawable-hdpi, drawable-mdpi, drawable-xdpi, drawable-xxdpi) at the right specs according to the Google offical docs, but when I build, ZGE strips them out and only leaves the lpdi file. According to Google, you don't actually even need the ldpi anymore, just the 4 others(mdpi (48px)- xxdpi(144px)) a the lpdi is created automatically.

Does anyone know if this is possible with ZGE without hacking the apk file which my invalidate the signing?
Imerion
Posts: 200
Joined: Sun Feb 09, 2014 4:42 pm

Post by Imerion »

Strange, this worked for me. Perhaps something has changed since then, it was a year ago.
I followed these instructions : viewtopic.php?t=1125&highlight=
But it sounds like what you are already doing.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

I do not think anything has changed in ZGE. Creation of additional directories for resources works fine; I just tested it.
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

Thanks for the replies guys. Just to be clear , all I am doing is putting the requisite folders into the ZGameEditor>Android>Template>base>res> folder and all icons are the correct size and called "icon.png".

Is there anything I need to do within ZGE itself? I downloaded the latest ZGE beta and tried again, but I still just get the single lpdi folder and icon when I build the apk. I noticed on the ZGE console while it is building the apk, that it just compresses the one icon and doesn't register the others.

I have attached a screenshot of my folder structure to check if I am doing something stupid:
Attachments
android_icon_path.png
android_icon_path.png (29.75 KiB) Viewed 10486 times
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Hi fracteed, you should put the folders with PNG icons to the generated folder (created after you press Project / Android: Build APK), not to the ZGE folder. The generated folder is used by Android SDK to compile your Android application.
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

Hi Rado1, I was going to do that, but I didn't think you were meant to tamper with an apk after it had been built?

So, are you saying that after building the release apk with ZGE, that I unzip the apk, then add the png's and re-zip the apk. Doesn't this invalidate the signature or something?
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Hi fracteed, here's the process:

1. Open your ZGE project. It has AndroidPackageName set to "com.fracteed.cubenemy".
2. Activate the "Project / Android: Build APK (*)" menu item -> it creates com.fracteed.cubenemy directory.
3. Go to that directory. It contains "res" sub-directory and place your resources there; so there will be, for example, com.fracteed.cubenemy\res\drawable-xxhdpi\icon.png file + plus other files for different resolutions.
4. Run the step 2. again -> it regenerates the application (.apk) with all icons included in -> it is located in the "bin" sub-directory.

BTW you should not change APK file, because there is a checksum and Android installer will consider it as corrupted.

I hope this answer helped.
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

Aha, yes this works! I never would have guessed that was the workflow, so thanks for the details. I can now cross this issue off my list :D
Post Reply