android-gallery

android gallery view “stutters” with deferred image loading adapter

断了今生、忘了曾经 提交于 2019-11-30 07:32:04
I would like to create an deferred loading adapter for use with a Gallery widget. That is to say getView() returns an ImageView immediately, and later some other mechanism will asynchronously call its setImageBitmap() method. I did this by creating a "lazy" ImageView that extends ImageView . public class GalleryImageView extends ImageView { // ... other stuff here ... public void setImage(final Looper looper, final int position) { final Uri uri = looper.get(position); final String path = looper.sharePath(position); new Thread(new Runnable() { @Override public void run() { GalleryBitmap gbmp =

How to write exif data to image in Android?

北战南征 提交于 2019-11-30 06:57:08
I'm trying to write a User_Comment and TAG_GPS to a captured image in an Android application using the exif interface, but for some reason the tags don't seem to be appended to the image when I view the image's details in the gallery. It seems that maybe the tags are not being written to the captured image as the file path may be wrong. I think it could be because I've written the tags to an incorrect image path. Does anyone know if their is a problem with the way I'm writing the tags to the image? This is the code that saves the exif data following @Charlie's changes below: private File

Captured image was not showing in gallery but it stored successfully in sdcard

元气小坏坏 提交于 2019-11-30 05:17:11
问题 I am new to android development, i am doing small application to capture USB Camrea image using UVCCamera . I have captured image using UVCCamera and stored in sdcard like this File filepath = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), "IMG_"+getDateTime() + ".jpg"); mCameraClient.captureStill(filepath.toString()); here mCameraClient will intract with UVC Camera and capture image and store in that path and it will callback method onCaptureDone

Open Gallery App in Android

て烟熏妆下的殇ゞ 提交于 2019-11-30 04:14:29
I am trying to open inbuilt gallery app pressing a button in my app. I am trying out on Android 2.3 and above phones. The phones/tablet that I have are Samsung S (Android 2.3.5) LG phone (Android 2.3.3) Nexus One (Android 2.3.6) Android Tablet (Android 4.0.3) Galaxy Nexus (Android 4.3) I tried the following: Intent intent = new Intent(Intent.ACTION_VIEW, null); intent.setType("image/*"); startActivity(intent); above code works fine on Android tablet (4.0.3) and my Nexus phone too.. but if run the same app on any phone which is below 3.0 (gives me error) 08-24 11:47:53.628: E/AndroidRuntime(787

Picking a photo from gallery and show in a image view

ぃ、小莉子 提交于 2019-11-29 13:30:39
I have an app, which has a button to select a photo from your gallery and it works fine and after selecting the image my app show came back to the activity and shows the image in an image View. Every is working fine but sometimes ,when i select some particular images the preview is not showing. I have also tried to compress the image still its not working My code is below.. In onCreate() galeryBtn=(Button)findViewById(R.id.buttonGallery); galeryBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(Intent.ACTION_PICK, android.provider

File not added to gallery android

寵の児 提交于 2019-11-29 11:59:31
This app i am making is taking pictures and saving it to sdcard but the images are not being shown in gallery...Is there something wrong with my code public void takepicture(View view){ try{ String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { //To store public files File directory=new File(Environment.getExternalStorageDirectory() , "Myapp Pictures"); if(!directory.exists()) directory.mkdir(); // Create an image file name String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); String imageFileName = "Img" + timeStamp + "

How to write exif data to image in Android?

ε祈祈猫儿з 提交于 2019-11-29 07:58:59
问题 I'm trying to write a User_Comment and TAG_GPS to a captured image in an Android application using the exif interface, but for some reason the tags don't seem to be appended to the image when I view the image's details in the gallery. It seems that maybe the tags are not being written to the captured image as the file path may be wrong. I think it could be because I've written the tags to an incorrect image path. Does anyone know if their is a problem with the way I'm writing the tags to the

Android : Why Intent.EXTRA_LOCAL_ONLY shows Google Photos

你说的曾经没有我的故事 提交于 2019-11-29 05:43:10
问题 What I'm trying to do in my application is to let the user choose a picture from his phone's gallery(Don't want to get gallery images only but also allowing a user to choose their app of choice). The code I'm using is as follows: Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true); startActivityForResult(Intent.createChooser(intent, "Select Picture"), 1); As per Intent.EXTRA_LOCAL_ONLY doesnt work

How can I stop MediaStore.ACTION_IMAGE_CAPTURE duplicating pictures

依然范特西╮ 提交于 2019-11-29 05:20:20
I am using the following code to take a picture: private static final int TAKE_PHOTO_CODE = 1; final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tFile)); startActivityForResult(intent, TAKE_PHOTO_CODE); This code works fine however I am getting a copy of every picture I take automatically appearing in the "Camera Shots" gallery as well as where I want the picture to go. How do I stop it automatically copying my picture? The file name is not even the same as the one I specified so it is not like I can delete it easily.

[Android - Kitkat ]Get/pick an image from Android's built-in Gallery app programmatically

青春壹個敷衍的年華 提交于 2019-11-29 04:08:46
Try to pick only one particular image from the SD card.I am able to pick images from gallery and Photos app in kikat.But not getting file path when i pick image from recents am getting file path as null. I tried https://stackoverflow.com/a/2636538/1140321 . Sunil Mishra This works for Kitkat public class BrowsePictureActivity extends Activity{ private static final int SELECT_PICTURE = 1; private String selectedImagePath; private ImageView imageView; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.browsepicture); imageView =