Android Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsMobile ProgrammingAndroid Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 13th, 2010, 06:43 AM
xil3 xil3 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2010
Posts: 1 xil3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 19 sec
Reputation Power: 0
Capturing image, saving and then displaying problem

I'm having an issue when trying to display an image on Android 1.5 - on 1.6+ it seems to work fine, but just not on 1.5.

Here is the code I use to start the camera, take the picture and save it:
Code:
java Code:
Original - java Code
  1. Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  2. file = new File(Environment.getExternalStorageDirectory(), ReceiptData.PICTURE_PATH + String.valueOf(System.currentTimeMillis()) + ".jpg");
  3.  
  4. outputFileUri = Uri.fromFile(file);
  5. //outputFileUri = Uri.parse(file.toString());
  6. intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
  7. startActivityForResult(intent, TAKE_PICTURE);



Here is the code I use to retrieve the picture from the sd card:
Code:

java Code:
Original - java Code
  1. mIv.setVisibility(View.VISIBLE);
  2.  
  3. BitmapFactory.Options options = new BitmapFactory.Options();
  4. options.inSampleSize = 4;
  5.  
  6. FileInputStream fis = new FileInputStream(outputFileUri.getPath());
  7. Bitmap bm = BitmapFactory.decodeStream(bis, null, options);
  8.  
  9. mIv.setImageBitmap(bm);


And here is the xml imageview markup:

HTML Code:

html Code:
Original - html Code
    <ImageView android:id="@+id/add_image_preview"               android:layout_width="320dp"               android:layout_height="480dp"               android:scaleType="fitXY"               android:visibility="gone"/>



Does anyone see any issues here? It works fine on my Nexus one - I can take the picture and then it'll display it within the ImageView just fine.

On the Android 1.5 (HTC Hero) phones it just doesn't display the image - just a blank space where the image would be.

Any ideas?

Reply With Quote
Reply

Viewing: Dev Shed ForumsMobile ProgrammingAndroid Development > Capturing image, saving and then displaying problem

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap