Custom Plugin development


#1

I have invested almost 4-5 months now in ionicframework . But seem to have hit a brickwall and almost on the verge of going native. The thing is i want to develop a custom camera application , which i was able to build easily in native Android but when it comes to integrating it in my ionic app , as a cordova plugin there is just too few examples and too less/complex information of how to do it neatly. Has anyone done such work before here and would like to share their expiriences ?

I have gone through almost all of the google search resources and examples but the main pitfall is testing the .java classes which extend cordovaPlugin and have cordova dependencies.

@mhartington @Calendee


#2

I’ve had many struggles with Cordova camera plugins myself. Fortunately, the last few releases have really improved the reliability of them.

I don’t have any experience with creating a customer camera plugin though.


#3

I found the cordova camera plugin to be quite stable and easy to integrate specially due to ngCordova. But the problem is it uses the phone camera app which is not customizable.


#4

You might want to checkout http://www.ezartech.com

I think they developed a custom camera plugin for this.


#5

Thank you for sharing ,but there seems to be some problem with the .java lib files of the plugin when i tried to do ionic run android it showed 5 errors

:compileDebugJava/home/qedrix/ionic project/eZarProject/platforms/android/src/com/ezartech/ezar/ezAR.java:54: error: cannot find symbol
webView.setKeepScreenOn(true);
^
symbol: method setKeepScreenOn(boolean)
location: variable webView of type CordovaWebView
/home/qedrix/ionic project/eZarProject/platforms/android/src/com/ezartech/ezar/ezAR.java:55: error: cannot find symbol
webView.setBackgroundColor(0x00000000); // transparent RGB
^
symbol: method setBackgroundColor(int)
location: variable webView of type CordovaWebView
/home/qedrix/ionic project/eZarProject/platforms/android/src/com/ezartech/ezar/ezAR.java:82: error: cannot find symbol
ViewGroup vg = (ViewGroup) webView.getParent();
^
symbol: method getParent()
location: variable webView of type CordovaWebView
/home/qedrix/ionic project/eZarProject/platforms/android/src/com/ezartech/ezar/ezAR.java:83: error: no suitable method found for removeView(CordovaWebView)
vg.removeView(webView);
^
method ViewManager.removeView(View) is not applicable
(argument mismatch; CordovaWebView cannot be converted to View)
method ViewGroup.removeView(View) is not applicable
(argument mismatch; CordovaWebView cannot be converted to View)
/home/qedrix/ionic project/eZarProject/platforms/android/src/com/ezartech/ezar/ezAR.java:95: error: incompatible types: CordovaWebView cannot be converted to View
cordova.getActivity().addContentView(webView,
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
5 errors

FAILURE: Build failed with an exception.