Use APL (Android Programming Language) to make Android plugin to Unreal Engine 4
<p>I'm trying to develop  Unreal Engine 4 plugin for Android camera API 2. </p>

<p>As I could read on unreal engine forums, there two possibilities to make a plugin for Android. </p>

<p>The first, consist on modifying the UE Android base project (GameActivity). </p>

<p>The second is a standalone plugin, which brings portability to add the plugins in any project.</p>

<p>According to this <a href="https://forums.unrealengine.com/showthread.php?117571-Plugin-Android-Camera" rel="noreferrer">post</a>, it is possible to make a camera Api1  standalone plugin,  which uses APL.xml file to add java code. </p>

<p>But I think it is very limited to a Game activity, like the code below.</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!--ARToolKit plugin additions--&gt;
&lt;root xmlns:android="http://schemas.android.com/apk/res/android"&gt;
 &lt;!-- init section is always evaluated once per architecture --&gt;
 &lt;init&gt;
   &lt;log text="AndroidCamera init"/&gt;
 &lt;/init&gt;

 &lt;androidManifestUpdates&gt;
   &lt;addPermission android:name="android.permission.CAMERA"/&gt;
   &lt;addFeature android:name="android.hardware.camera"/&gt;
   &lt;addFeature android:name="android.hardware.camera.autofocus"/&gt;
 &lt;/androidManifestUpdates&gt;

 &lt;!-- optional additions to the GameActivity imports in GameActivity.java --&gt;
 &lt;gameActivityImportAdditions&gt;
   &lt;insert&gt;
import android.widget.Toast;
import android.hardware.Camera;
import android.hardware.Camera.CameraInfo;
import android.hardware.Camera.Parameters;
import android.hardware.Camera.PreviewCallback;
import android.graphics.SurfaceTexture;
import android.graphics.ImageFormat;
import android.graphics.PixelFormat;
import java.util.List; 
import java.io.IOException;
import android.util.Log;
   &lt;/insert&gt;
 &lt;/gameActivityImportAdditions&gt;

 &lt;gameActivityClassAdditions&gt;
   &lt;insert&gt;
     static String msg = "yes i am a rock!";
     SurfaceTexture surfaceTexture;
     Camera camera;
     public native boolean nativeGetFrameData(int frameWidth, int frameHeight, byte[] data);

     public void AndroidThunkJava_Toast()
     {
       try
       {
         _activity.runOnUiThread(new Runnable()
         {
           public void run()
           {
             Toast.makeText(_activity.getApplicationContext(), "cam o yeah!", Toast.LENGTH_SHORT).show();
           }
         });
       }
       catch (Exception e)
       {
         Log.debug("Toast failed with exception " + e.getMessage());
       }
     }

     public void AndroidThunkJava_startCamera()
     {
       surfaceTexture = new SurfaceTexture(10);
       surfaceTexture.setDefaultBufferSize(320,240);
       camera = Camera.open();


       try { 
         camera.setPreviewTexture(surfaceTexture);
       } catch (IOException t) {
         android.util.Log.e("ARToolKitLog", "Cannot set preview texture target!", t);
       } 

       Parameters cameraParam = camera.getParameters();

       cameraParam.setPreviewFormat(ImageFormat.NV21);
       cameraParam.setPreviewSize(320, 240);
       camera.setParameters(cameraParam);

       camera.setPreviewCallback(new PreviewCallback() {
         @Override
         public void onPreviewFrame(byte[] data, Camera camera) {
           int Height = camera.getParameters().getPreviewSize().height;
           int Width = camera.getParameters().getPreviewSize().width;
           nativeGetFrameData(Width, Height, data);
         }
       });

       camera.startPreview();
     }

     public void AndroidThunkJava_stopCamera()
     {
       if (camera != null) 
       {
         camera.stopPreview();
         camera.release();
         camera = null;
       }
     }
   &lt;/insert&gt;
 &lt;/gameActivityClassAdditions&gt;

 &lt;!-- optional additions to GameActivity onCreate in GameActivity.java --&gt;
 &lt;gameActivityOnCreateAdditions&gt;
   &lt;insert&gt;
   //Toast.makeText(this,msg,Toast.LENGTH_LONG).show();
   //AndroidThunkJava_Toast();
   &lt;/insert&gt;
 &lt;/gameActivityOnCreateAdditions&gt;


&lt;/root&gt;
</code></pre>

<p>So my questions are:</p>

<p>Is this the only way to make a standalone plugin for Unreal Engine 4?</p>

<p>Is there a  XML tag to add custom classes in this APL files?</p>