Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
This chapter focuses on how you can extend PhoneGap functionality to expose more of your native code.
However, please note that even if you write PhoneGap plug-ins, the only way to inject the plug-in is to add the plug-in source to your project. There is currently no way to build a plug-in into a package and add the package to your PhoneGap project. This stops you using your custom plug-ins when you are using PhoneGap build.
For this chapter, let's keep the nature of the plug-in very simple. We call this a helloworld plug-in. We pass a name to the plug-in, and we get back a string “Hello <name>! The time now is <Current Time>”.
This way, we focus mainly on the bridge aspect of the plug-in.