Creating a helloWorld plugin for Android using Cordova and Eclipse

后端 未结 2 1813
太阳男子
太阳男子 2021-02-10 23:44

I\'ve done quite a bit of research and can\'t seem to find why this isn\'t working. What I have is Cordova based Android app in Eclipse running Cordova 2.7.0. I want to build

相关标签:
2条回答
  • 2021-02-11 00:04

    In this line

        window.func = function(str,callback){
            alert("Outside Call Working");
            cordova.exec(callback, function(err){alert(err)},"HelloPlugin","echo", [str]);
        }
    

    put like this

    window.func = function(str,callback){
            alert("Outside Call Working");
            cordova.exec(callback, function(err){alert(err)},"org.apache.cordova.plugin.HelloPlugin","echo", [str]);
        }
    
    0 讨论(0)
  • 2021-02-11 00:09

    The value of "HelloPlugin" in your config.xml should point to the package where the Java class is, so that Cordova can find and execute the Java code. So if you change <plugin name="HelloPlugin" value="org.apache.cordova.plugin.HelloPlugin" /> to <plugin name="HelloPlugin" value="com.example.plugintest.HelloPlugin" /> I believe it should work.

    0 讨论(0)
提交回复
热议问题