android-gallery

getRealPathFromURI() not working with ICS & Picasa based images

一笑奈何 提交于 2019-12-12 11:10:16
问题 I'm trying to get the local path of a image in order to upload it to a server. When using pre ICS it would get a standard path within the android device via getRealPathFromURI(theURI) However with ICS URI will contain a uriString as something like : content://com.google.android.gallery3d.provider/picasa/item/12312312312312 . and running getRealPathFromURI(theURI) returns null Do I now need to extract the above uriString and manually download the image via the API (if i detect that its a

Open a specific folder inside gallery android

不问归期 提交于 2019-12-12 09:56:45
问题 I have a camera app which save image to separate folder inside the gallery. Path to my folder is /storage/emulated/0/Pictures/CameraExample/ When I click on the button I need to open the folder where I have saved the images. I have used all the solution which was available. This how I'm reading the path. Let me know if i'm wrong. String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath(); Log.d("HelperUtils . getFilePaths", "setting the path

android:selecting multiple images in gallery and starting implicit intent

淺唱寂寞╮ 提交于 2019-12-12 09:39:09
问题 How to get the image path of all the selected images or just display them in my app? I am able to start my implicit intent and display it in my imageView when a user selects image in gallery and press share button like shown below ImageView iv=(ImageView)findViewById(R.id.im); iv.setImageUri((Uri)getIntent().getExtras().get(Intent.EXTRA_STREAM)); in manifest file for my activity <intent-filter > <action android:name="android.intent.action.SEND"/> <category android:name="android.intent

Take image from gallery and convert to base64 issue

[亡魂溺海] 提交于 2019-12-12 07:23:53
问题 sorry for asking silly question.but it solved yet my me.please help i had tried all codes on stackoverflow and follow other tutorial but it wont help at all.i am taking image from galary and convert to base64 it works perfectly fine when taking image on camera but why it dont work on galary i dont know please help me.;( This is the code to select the image private void selectImage() { final CharSequence[] items = { "Take Photo", "Choose from Library", "Cancel" }; AlertDialog.Builder builder =

Keep Camera from saving photo

天涯浪子 提交于 2019-12-12 06:10:21
问题 I have an application that captures pictures by dispatching an intent. Upon return of control to the activity, I retrieve the intent, extract the data, transform it into a bitmap and use it in my application. Just some straight forward code. The pictures taken are subject to some privacy obligations and my application takes care to delete all data. The problem is that all pictures taken by the Camera application seem to automatically be saves into internal storage. I was successful in

Gallery item is not updated while file downloading

試著忘記壹切 提交于 2019-12-12 05:29:12
问题 I am downloading a video from my application but that video is not currently show in gallery, Now i just restart my device and then it shows in gallery item. I don't understand why, Is any video tag set with the file which will tell android to add this item in gallery video. This is my code FileOutputStream fos = new FileOutputStream(filePath); long total = 0; int len = 0; byte[] buf = new byte[1024]; while ((len = inputStream.read(buf)) > 0) { if(!cancel) { fos.write(buf, 0, len); // send

Get Path of Gallery Image Xamarin?

冷暖自知 提交于 2019-12-12 04:54:42
问题 I am trying to get the path of Gallery Image. I am getting the path of the image which is stored in internal storage but not of the external storage. I have also enabled the read-write storage and camera access permissions which has been granted. Here is my code void ChoosePhoto() { try { var imageIntent = new Intent(); imageIntent.SetType("image/*"); imageIntent.SetAction(Intent.ActionGetContent); StartActivityForResult(Intent.CreateChooser(imageIntent, "Select photo"), 0); } catch

Android - Camera activity gets opened instead of picture gallery

本秂侑毒 提交于 2019-12-12 02:56:37
问题 I've created an activity that allows the user to add a picture to an ImageView in that activity. I've created a button, that opens a context menu for the activity and gives the user options to either pick a picture from the gallery or take a picture with camera . If I choose the first option - to pick a picture from the gallery , it works without problems. Gallery is opened, I pick the picture, my activity is resumed and the picture is added to the ImageView. Strange things start happening

ACTION_PICK image picker returns diffrent uri formats

限于喜欢 提交于 2019-12-12 02:19:24
问题 I'm using image picker to select a image and then uploading this image to the server . My code is working perfectly in all android devices except for Mi phones. For all device Uri returned is of type : content://media/external/images/media/523 For Mi devices Uri returned is of type:file:///storage/emulated/0/DCIM/Camera/IMG_20160912_160415.jpg The Cursor cursor = context.getContentResolver().query() returns null if the uri is not in format content://* private void pickImage() { Intent

Image Gallery does not show anything

蓝咒 提交于 2019-12-12 01:07:26
问题 i have a problem while doing Photo gallery. I am retrieving the from the network. The problem is that the images are not been able to set in the gallery. I know i might be doing some silly mistake somewhere. Can anyone please help me with this. Here is my UPDATED code: MainActivity.java public class MainActivity extends Activity implements OnItemClickListener { String FILENAME = "http://122.com/12.php"; private static final String tag = "Main"; private static String carId = ""; private