Go Back   Android Forums > Android Development > Application Development > App Inventor

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old July 19th, 2012, 03:54 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jul 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default increase the memory allocated to application

Hi after much research I come to speak to you.
I try to display images taken by the camera and display them in the application. When I take low-resolution images (say 100kB in size), I have no problems with the switch to bitmapped display, cons when I take them in high resolution (1.5MB), the application crashes with the exception Error java.lang.OutOfMemoryError. it happens to be on my smartphone (Samsung Galaxy SII, SIII Galaxy) is on all the shelves.
For now I solved manually by lowering the quality and size of the photos but, given the evolution of cameras with increasing resolution, this problem is likely to arise more often.
Is there not a permanent solution to increase the memory allocated to my application for Android without manual intervention on the device and in the code?


Images are stored in bitmap format

Quote:
//creation de l'image
Uri domuri1

ContentValues cv = new ContentValues();
cv.remove("101");
domuri1 = getContentResolver().insert(Media.EXTERNAL_CONTENT _URI, cv);
File domthumb1 = new File(domuri1.toString(), fileName1);

//mise en place de la séléction de l'image
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
intent.putExtra(MediaStore.EXTRA_OUTPUT, domuri1);
startActivityForResult(intent, 100);

//enregistrement des images
ContentResolver cr = getContentResolver();
bitmap1 = MediaStore.Images.Media.getBitmap(cr, domuri1 );
imageView.setImageBitmap(bitmap1);

vetic is offline  
Reply With Quote
sponsored links
Reply


Go Back   Android Forums > Android Development > Application Development > App Inventor
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:38 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.