This is a migrated thread and some comments may be shown as answers.

getPicture crashes app, i want to call garbage collector manually

5 Answers 164 Views
Feedback & Suggestions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
pistoleta
Top achievements
Rank 1
pistoleta asked on 19 Feb 2014, 09:50 AM
Hi, im comfronting a very common trouble in cordova.  
The camera plugin makes some devices crash due to the amount of memory it uses processing the picture and i tried everything:
-lowering picture quality
-lowering picture resolution
-using  FILE_URI, instead of Base64 
- <uses-sdk android:minSdkVersion="7" />

And still, SOMETIMES my app restarts after trying to save the picture, normally if the app restarts and i try to take the picture again then it works, so that makes me thing its the memory that got flushed by garbage collector and the second time has space.
Also, im using devices with low ram memory, (128),  but i cant change that for the moment.

I want to make a plugin i can use to call the native java method System.gc();   just before processing the picture, so that way probably the app wont crash.
I also found this plugin:
https://code.google.com/p/foreground-camera-plugin/

But this is supposed to work with cordova 2.4.0 and im on 3.0 and btw i dont know how to add that plugin to appBuilder...
Can anyone tell me wich is the best sollution to solve this please? I dont want to go to phonegap cause i find appbuilder more efficient but i really dont know how to solve this. 
THANKS in advance.







5 Answers, 1 is accepted

Sort by
0
Jan-Dirk
Top achievements
Rank 1
answered on 19 Feb 2014, 01:26 PM
It could be that the plugin works with Phonegap 3.x? You could always set your project in AppBuilder to an older version in project properties.

Else, start trying to make the plugin plugman compatible: http://docs.telerik.com/platform/appbuilder/creating-your-project/using-plugins/using-custom-plugins/making-plugman-compatible/how-to-make-plugman-compatible. After that you should be able to import the plugin: http://docs.telerik.com/platform/appbuilder/creating-your-project/using-plugins/using-custom-plugins/add-custom-plugins

It seems that all the sources are available through the link in your post.

It's a little work, but could be very helpfull.
0
pistoleta
Top achievements
Rank 1
answered on 19 Feb 2014, 02:39 PM
Hi, finnally i was able to do it,  i found this project:

https://github.com/mWater/cordova-plugin-camera-foreground

i just had to add it with the plugin manager and use the examples found in the test folder, very easy, i didnt use the plugman it wasnt needed for this plug-in.   May be another time but i find the plugman stuff really complicated and not well documented.

Ah. in order to work you need to disable the native camera plugin otherwise wont use the new.

Thanks!
0
Iva Koevska
Telerik team
answered on 24 Feb 2014, 09:03 AM
Hello,

Thanks for sharing this solution!

Regards,
Iva Koevska
Telerik
Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
0
Jaya
Top achievements
Rank 1
answered on 24 Aug 2016, 12:44 PM

hi, 

i have tried but always getting error,

please explain how to implement foreground camera for ios step by step briefly.

Thanks.

 

 

0
Preslav
Telerik team
answered on 29 Aug 2016, 12:28 PM
Hi Jaya,

Foreground camera plugin runs a custom activity which is supported only on Android, that is way it's not working on iOS. Additionally, it is a fork of the official Cordova Camera plugin, which is a Core plugin in AppBuilder. More information about core plugins is available in this section.

I'd recommend using the Cordova Camera plugin. To get more familiar with it, check our sample app and plugins documentation.

Further, if you are still getting errors I'll be happy to continue my investigation but for that purpose, I'll need a sample app that clearly reproduces the issue. I'd recommend that you open a support ticket, which is private and comes with a guaranteed response time, and all the needed information there.

Regards,
Preslav
Telerik by Progress
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Feedback & Suggestions
Asked by
pistoleta
Top achievements
Rank 1
Answers by
Jan-Dirk
Top achievements
Rank 1
pistoleta
Top achievements
Rank 1
Iva Koevska
Telerik team
Jaya
Top achievements
Rank 1
Preslav
Telerik team
Share this question
or