How to create PhoneGap plugin out of an android application

孤街醉人 提交于 2019-12-03 00:39:34

问题


I am basically using this https://github.com/googlesamples/android-vision with a few changes and it works perfectly on my android device. Anyway, I would like to use it inside PhoneGap. The idea is to build the rest of the application in javascript/html/css and when pressed a specific button, start the android app.

Can this be done by someone who has never created a plugin before?

I would be grateful for any hint or tutorial on how to do it.


回答1:


Of course it depends of your dev skills but I created myself my first plugin two months ago without being a Phonegap/Cordova expert, I'm a Java developer since 15 years but the most important thing is your motivation.

You first have to develop your basic Cordova app: https://cordova.apache.org/docs/en/latest/guide/cli/index.html

Then your ressource to create a plugin will be here: https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html

You will have to create one or few Java files as an adapter between your web app and your Jar code.

I found that the documentation was not enough for my case but I googled and used some dev blog articles and found some StackOverflow questions to help me.

Good luck!



来源:https://stackoverflow.com/questions/36235320/how-to-create-phonegap-plugin-out-of-an-android-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!