Confused About App Icons for Android

So I am trying to export a simple game I’ve made in processing and everything up until this point has been smooth sailing but I’ve run into a wall for getting app icons to work. I try to use their tutorial and looked on other forums but nothing has worked. I have all of the other .pde files, background images and other stuff loaded in correctly for my game but I can’t figure out the new icon process.

All I get is this error no matter how much I troubleshoot: “The sketch does not include all required app icons. Processing could use its default . . .”

I’ve looked on these posts:

and the Android Processing page.

but I still get that error because I think they’re all outdated. Can anyone help me?
I think it has to do with this in the Android Manifest XML: " " and I don’t think whatever I’m doing works for that line. I’ve tried mipmap-hdpi with ic_launcher.jpg inside in the data folder, I’ve tried it in the sketch folder but it doesn’t recognize it.

Hi
Welcome

Try this example

The following source code should create an icon set for Android. Drag and drop the image that you want to use onto the window and a folder should appear on your desktop with the required icons. You will have to change the url for the desktop on your system.

import java.awt.*;
import java.awt.dnd.*;
import java.util.List;
import javax.swing.TransferHandler;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.File;

PFont font;
PImage img;
PImage myimg;
String imgPath = "";
String savePath = "";
String fileName = "";

void setup() {
  size(520, 520);
  surface.setTitle("Icon Maker Android");
  fill(0);
  textSize(30.0);
  textAlign(CENTER, CENTER);
  text("Drag and drop image here", 0, 100, width, 160);
  Canvas canvas = (Canvas) surface.getNative();
  canvas.setDropTarget(new DropTarget(canvas, DnDConstants.ACTION_COPY_OR_MOVE, new DropTargetListener() {

    @Override
      public void dragEnter(DropTargetDragEvent dtde) {
    }

    @Override
      public void dragOver(DropTargetDragEvent dtde) {
    }

    @Override
      public void dropActionChanged(DropTargetDragEvent dtde) {
    }
    @Override
      public void dragExit(DropTargetEvent dte) {
    }

    @Override
      public void drop(DropTargetDropEvent evt) {
      // Accept copy drops
      evt.acceptDrop(DnDConstants.ACTION_COPY);
      Transferable transferable = evt.getTransferable();
      // Get the data formats of the dropped item
      DataFlavor[] flavors = transferable.getTransferDataFlavors();
      for (DataFlavor flavor : flavors) {
        try {
          if (flavor.isFlavorJavaFileListType()) {
            // Get all of the dropped files
            List<File> files = new ArrayList<>();
            files = (List)transferable.getTransferData(flavor);
            for (File file : files) {
              imgPath = file.getPath();
              fileName = file.getName();
              // Strip extension if there is one
              if (fileName.indexOf(".") > 0) {
                fileName = fileName.substring(0, fileName.lastIndexOf("."));
              }
  *// **** Change the next line for your system **** //*
              savePath = "/Users/xxxxx/Desktop/AndroidIcons" + "_" + fileName + "/";
              println("imgPath: " + imgPath);
              img = loadImage(imgPath);
              img.resize(0, 512);
              img.save(savePath + "myimg.png"); // used for display
              img.resize(0, 192);
              img.save(savePath + "icon-192.png");
              img.resize(0, 144);
              img.save(savePath + "icon-144.png");
              img.resize(0, 96);
              img.save(savePath + "icon-96.png");
              img.resize(0, 72);
              img.save(savePath + "icon-72.png");
              img.resize(0, 48);
              img.save(savePath + "icon-48.png");
              img.resize(0, 36);
              img.save(savePath + "icon-36.png");
              myimg = loadImage(savePath + "myimg.png");
            }
          }
        }
        catch (Exception e) {
          println(e);
        }
      }
      evt.dropComplete(true);  // Inform that the drop is complete
    }
  }
  ));
}

void draw() {
  if (myimg != null) {
    image(myimg, 0, 0, width, height);
  }
}

It seems like you need to first run your project on your Android device. Afterwards, check the console where it typically displays the “build folder” location. Copy the address from there and search for the *.apk file extension in the file explorer with name “sketch_xxxxxxx_debug.apk”. This will help you find the APK file that was built from your project.