How I can change the icon image in android?

edited July 2014 in Android Mode

Good afternoon,

I'm trying to change the image of the icon of the application that I made for android.

This code works for java application:

    import javax.swing.ImageIcon;
    ImageIcon titlebaricon = new ImageIcon(loadBytes("icon.png"));
    frame.setIconImage(titlebaricon.getImage());

But that code does not work with android: BUILD FAILED C:\Users\Processing\AppData\Local\Android\android-sdk\tools\ant\build.xml:720: The following error occurred while executing this line: C:\Users\Processing\AppData\Local\Android\android-sdk\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.

Did I should import some library for android?

Thanks in advance

Anthony20

Tagged:

Answers

  • Thanks Jellyfish,

    It's easier than I thought, I do not need to change the program, only put the images in the folder of the sketch is enough. As in processing-2.2.1\lib\icons

    http://wiki.processing.org/w/Android#Icons

        Icons
        Starting with revision 0190, it's possible to specify an icon that goes with your sketch. Actually Android wants lots of icons, which cover the varying screen resolutions where your app might show up, and the different contexts (launcher icons or a long list) where your app might be used.
        All sketches use a default icon unless you specify otherwise. To create your own, save images as icon-36.png, icon-48.png, and icon-72.png. These should be 36x36, 48x48, and 72x72 pixel icons. Place them in the sketch folder (not the data folder or any other subfolder). The next time you build your app, these will be used instead of the defaults.
        Your icons shouldn't just be images that use the full area of the icon. See the design guidelines for information on how to size, color, and shade your icons.
    

    Best regards

    Anthony20

Sign In or Register to comment.