You can write custom plug-ins for PhoneGap.
Custom PhoneGap plug-ins have a JavaScript component that exposes the custom native component and a native component. See the PhoneGap documentation for information about PhoneGap plug-ins.