J
Juhran
Guest
Hello, I am stuck with understanding how to add a java file as extension to my android GM2 project.
Maybe someone can upload a quick full example to study?
I got this in my "test.java" file:
package ${YYAndroidPackageName};
import ${YYAndroidPackageName}.RunnerActivity;
import ${YYAndroidPackageName}.R;
import com.yoyogames.runner.RunnerJNILib;
import android.app.Application;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
public class WebViewEmbed// extends Activity
{
public String testMe()
{
return "Access to test method succeeded";
}
}
What is the next step?
1. Right click "Extensions" and "Create Extension"?
2. check "Android" under "Extra Platforms" ?
3. "Add Generic Placeholder" or "Add File" ?
4. Add Function and name it "testMe" with Return Type "string" ?
5. where and when do I add my test.java file here?
6. In "Tap" Event I would then try:
string x = testMe();
show_message(x);
to display the returned value of my function testMe() right?
Sorry, I really only need a bit guide here to get it started. I did read the tutorials
and some other questions reagrding this in this forum and searched for yt videos
on this topic. I am bit lost without a proper guide.
Maybe someone can provide an example I can test and play a bit with?
Or the youtubers here might even think about a video?
Maybe someone can upload a quick full example to study?
I got this in my "test.java" file:
package ${YYAndroidPackageName};
import ${YYAndroidPackageName}.RunnerActivity;
import ${YYAndroidPackageName}.R;
import com.yoyogames.runner.RunnerJNILib;
import android.app.Application;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
public class WebViewEmbed// extends Activity
{
public String testMe()
{
return "Access to test method succeeded";
}
}
What is the next step?
1. Right click "Extensions" and "Create Extension"?
2. check "Android" under "Extra Platforms" ?
3. "Add Generic Placeholder" or "Add File" ?
4. Add Function and name it "testMe" with Return Type "string" ?
5. where and when do I add my test.java file here?
6. In "Tap" Event I would then try:
string x = testMe();
show_message(x);
to display the returned value of my function testMe() right?
Sorry, I really only need a bit guide here to get it started. I did read the tutorials
and some other questions reagrding this in this forum and searched for yt videos
on this topic. I am bit lost without a proper guide.
Maybe someone can provide an example I can test and play a bit with?
Or the youtubers here might even think about a video?