I have seen similar questions but I can't get it working, either because I lack some basic knowledge or because I am missing in between steps.
I have also checked the plug in build manual and found no answer, it exposes several methods to execute native code, using DLLs, using "androidJavaObjects" created in c# scripts and using java classes. This third method seemed the simpler so I went with it. This is what I have done:
-Create in the Plugins folder and Android folder, placed this AndroidManifest.xml there:
-Create an "ReceiverOnBoot.java" file with those contents
pakage com.InteractionFactory.startingtest;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class ReceiverOnBoot extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent)
{
intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse("market://details?id="+packageName));
startActivity(intent);
}
}
I have tried replacing the "onReceive" function contents with "Toast.makeText(context, "TEXT TO DISPLAY", Toast.LENGTH_LONG).show();" for debug purposes, to no effect.
Also, since I added those files no icon is created when I install the apk.
Do I need to compile the "java" file in any way? Build "jar" files maybe?
↧