Android Java+;xml扩展错误-尝试调用sheldo上的方法shell_do时引发异常

Android Java+;xml扩展错误-尝试调用sheldo上的方法shell_do时引发异常,java,android,xml,gml,Java,Android,Xml,Gml,有没有人在GameMaker studio中有过使用java扩展(包含java文件和.xml清单)移植到android的经验? 版本-Game Maker:Studio,还请注意,进行扩展涉及3种不同的代码:Java、XML和GML(基本上是html和visual basic的组合) 我有一个为Android制作的时间卡应用程序,你可以打卡、休息,它会将信息记录到应用程序工作目录中的文本文件中。 我的问题是,如何在Game Maker:Studio中打开note pad.exe(或等效文件)向用

有没有人在GameMaker studio中有过使用java扩展(包含java文件和.xml清单)移植到android的经验? 版本-Game Maker:Studio,还请注意,进行扩展涉及3种不同的代码:Java、XML和GML(基本上是html和visual basic的组合)

我有一个为Android制作的时间卡应用程序,你可以打卡、休息,它会将信息记录到应用程序工作目录中的文本文件中。 我的问题是,如何在Game Maker:Studio中打开note pad.exe(或等效文件)向用户显示文本

我在扩展名supopntxtf中设置了名为sheldo的java文件,在它的属性页中,我只选择了android,在函数属性页上,我将名称和外部名称都设置为shell_do,返回类型设置为double,并将argument0和argument1列为字符串。 下面是我放在sheldo.java文件中的代码:

     package ${YYAndroidPackageName};


    import android.content.Intent;
    import android.net.Uri;
    import java.io.File;
    import java.io.FileReader;
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.lang.String;
    import ${YYAndroidPackageName}.R;
    import com.yoyogames.runner.RunnerJNILib;

    public class sheldo extends Activity {

        public void shell_do(String arg0, String arg1) {
            if (arg0 == "open") {
                Intent intent = new Intent(Intent.ACTION_EDIT);
                Uri uri = Uri.parse(arg1);
                intent.setDataAndType(uri, "text/plain");
                startActivity(intent);
            }
        }

       }
并将xml代码添加到android清单中(右键单击我的扩展名并转到android选项卡),以下是我键入的代码:

<activity 
android:label="@string/app_name" 
android:name="${YYAndroidPackageName}" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
好的,现在在游戏中它自己(现在我们回到GML代码语言)有一个名为指针的对象,在它的创建事件中,我声明了这些相关变量:

result1="open";result2="No records";result3="No records";
在对象指针的报警事件中,我有以下代码来激活扩展名:

result1="open";
result2=string_insert(string(global.fname[global.empnum]),string(" "),0);
result2=string_insert(string(result2),string(global.finfo[0]),0);
result2=string_insert(string(result2),string(" Week "),0);
result2=string_insert(string(result2),string(global.fiscalw),0);
result2=string_insert(string(result2),string(" "),0);
result2=string_insert(string(result2),string(global.yrs),0);
result2=string_insert(string(result2),string(".txt"),0);// result2 to this        point builds the file name.txt
result3=string_insert("file:///",working_directory,0;
result3=string_insert(result3,string("+"),0);
result2=string_insert(string(result3),string(result2),0);// this puts the     file path together
shell_do(result1,result2); // this calls the extension



   Explanation of the variables that I used to name the file with their values being all strings:
  global.fname[global.empnum] - employee name depending on the employee number
  global.finfo[0] - the company name
  global.fiscalw - the week
  global.fiscalyr - the year 
我编译了我的游戏(因为手册告诉我,除非游戏完成编译,否则扩展将无法工作),没有问题,但是当我尝试使用扩展时,什么也没有发生,但是通过runner日志回顾,每当我尝试使用扩展时,我都会收到以下错误消息:

result1="open";
result2=string_insert(string(global.fname[global.empnum]),string(" "),0);
result2=string_insert(string(result2),string(global.finfo[0]),0);
result2=string_insert(string(result2),string(" Week "),0);
result2=string_insert(string(result2),string(global.fiscalw),0);
result2=string_insert(string(result2),string(" "),0);
result2=string_insert(string(result2),string(global.yrs),0);
result2=string_insert(string(result2),string(".txt"),0);// result2 to this        point builds the file name.txt
result3=string_insert("file:///",working_directory,0;
result3=string_insert(result3,string("+"),0);
result2=string_insert(string(result3),string(result2),0);// this puts the     file path together
shell_do(result1,result2); // this calls the extension



   Explanation of the variables that I used to name the file with their values being all strings:
  global.fname[global.empnum] - employee name depending on the employee number
  global.finfo[0] - the company name
  global.fiscalw - the week
  global.fiscalyr - the year 
尝试调用sheldo上的方法shell_do时引发异常

我在YouTube上观看了两个帮助性视频,以了解更多关于java与xml结合的信息:


下载了Android Studio,让它很容易运行,但我想在game maker:Studio上完成这个项目,因为我花了很多钱买它,也不想重新编写整个应用程序,因为它的语言完全不同哈哈,但我想我一定是在某个地方做错了什么,任何人有什么想法吗?

在编译我的应用程序时,有一条关于无法创建sheldo类的错误消息,下面是错误消息:D/yoyo(12630):doSetup called-/data/app/com.*****.RHG_Timecard_Full-2/base.apk I/yoyo(12630):尝试初始化扩展类com.*****.RHG_Timecard_Full.sheldo I/yoyo(12630):尝试创建扩展类com时引发异常。****.RHG_Timecard_Full.sheldo I/yoyo(12630):尝试初始化扩展类com.*****.RHG_Timecard_Full.sheldo I/yoyo(12630):尝试创建扩展类com.**.RHG_Timecard_Full.sheldoOk时引发异常,因此当我编译应用程序时,我在编译器窗口中得到一条错误消息,上面写着:尝试创建扩展类com时抛出异常。****.RHG_Timecard_Full.sheldo,如果我尝试在编译后的应用程序运行时使用扩展,我在尝试调用sheldo上的方法shell_do时抛出异常消息,那么为什么编译器不能创建扩展类?什么会导致这个错误?如果您有任何想法,我将不胜感激,我不知道为什么这在android studio中有效,但在game maker中无效:studio的扩展一个更有用的信息是在编译我的应用程序时,有一条关于无法创建sheldo类的错误消息,下面是错误消息:D/yoyo(12630):doSetup called-/data/app/com.**.RHG_Timecard_Full-2/base.apk I/yoyo(12630):尝试初始化扩展类com.**.RHG_Timecard_Full.sheldo I/yoyoyo(12630):尝试创建扩展类com时引发异常。***.RHG_Timecard_Full.sheldo I/yoyoyo(12630):尝试初始化扩展类com.***.RHG_Timecard_Full.sheldo I/yoyo(12630):尝试创建扩展类com.***.RHG_Timecard_Full.sheldoOk时引发异常,因此在编译应用程序时,我在编译器窗口中得到一条错误消息,上面写着:尝试创建扩展类com时抛出异常。****.RHG_Timecard_Full.sheldo,如果我尝试在编译后的应用程序运行时使用扩展,我在尝试调用sheldo上的方法shell_do时抛出异常消息,那么为什么编译器不能创建扩展类?什么会导致这个错误?如果您有任何想法,我将不胜感激。我不知道为什么这可以在android studio中工作,但在game maker:studio的扩展中却不行