2

Is it possible to write code in Java and call it in Phonegap HTML5? Can you show me an example for that? I tried the example but it is showing errors.

Links:

Community
  • 1
  • 1
umahesh
  • 61
  • 1
  • 8

2 Answers2

0

here is the answer for your questions:

Is it possible to write code in Java and call it in Phonegap HTML5?

Yes, the link you have given is an example for that. Phonegap has lot of API's which are used to access the device's functions through your HTML 5 code. (more specifically through javascript). Those are implemented using java code by the phonegap guys. And apart from these, if you are sure that you need something else that is available on native coding, ie using native android ( through java code), then you need to make some plugins to satisfy your requirement.

Can you show me an example for that?

seems the link which you gave above is a good example.

I tried the example but it is showing errors.

Please specify what is the error, and where do you get that.

AnhSirk Dasarp
  • 9,026
  • 6
  • 43
  • 54
0

Yes, of course it is possible. Do us a favour and follow the plugin API as it will make your life easier.

http://docs.phonegap.com/en/2.0.0/guide_plugin-development_index.md.html#Plugin%20Development%20Guide

Simon MacDonald
  • 23,243
  • 5
  • 57
  • 74
  • While this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Bill the Lizard Aug 17 '12 at 11:02