How to set picture as whatsapp or contact photo profile picture - android

I displayed images from webservice using json. Now how to provide user to make image as profile picture for whatsapp or contact photo etc., How to call that intent to open set picture as -> Set as -> showing multiple options -> Contact photo wallpaper, whatsapp profile photo etc.,?
Please guide me to solve this..
Thanks

Related

while sharing image via share intent hangout shows old image inside image preview screen in android

while sharing image via android share intent hangout shows old image inside image preview screen which appears before sending image,but whatsapp and facebook shows cuurently selected image itself,
even it shows wrong image in preview ater clicking send, in chat correct image will only be displayed.
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/png");
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(Intent.EXTRA_STREAM, uri);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(Intent.createChooser(intent, "Share news via.."));
can any one help with this issue
I found reason behind this issue, i was giving same name everytime to store and share the image, by defalut hangout image send preview screen will display old image , if image name is same. so changing image name everytime will fix the issue.

How to draw on a photo IMMEDIATELY after taking it, THEN save to storage

I have searched around and found a few different solutions to this problem but none of them are really what I am looking for.
I am developing an app that lets the user take an image by opening the camera via a MediaStore.ACTION_IMAGE_CAPTURE Intent as so...
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
And then saves the image with
File photo = new File(Environment.getExternalStorageDirectory(), titleOfPhoto + ".jpg");
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
I even get the thumbnail back and display it for the user in the onActivityResult() Override.
As the title suggests, what I would like to do is allow the user to draw on the captured image immediately after taking it. But I have no control over what happens between opening the camera and returning to my app with the captured image already saved. Apps like SnapChat and WhatsApp are doing exactly this and so much more, so I know it is possible, but Android does not appear to have this capability built in.
To be clear: The sequence of events needs to be
1) Open the camera
2) Take a picture
3) Draw on the picture
4) Press 'Ok'/'Done' or something
5) Save the edited photo
6) Return thumbnail
Is there anyway to add an event listener to the camera, or open the camera in a different manner that gives more control? Any help is appreciated! Thanks!
In order to do this, you will have to use the Camera Framwork API.
The basic of this is to render the camera output on a Surface View in your app. Then when the user takes a picture, capture the state of the surface view. From there you can allow your users to draw on the picture. When they are finished, THEN save the picture and display its thumbnail.

Android - New intent with captured Image

I am developing an android app. When I capture an image using the code
Intent intent = new Intent(MediaStore.ActionImageCapture)
it will be stored in my sdcard as well as it will be displayed in the ImageView. Next, on button ‘Crop Picture’ click event, it should open the captured image as a new intent with the crop feature.
I've code to open the Gallery and select the captured image with the crop feature, but I don’t want the Gallery to get opened, instead I want the captured image in new intent with crop features.
Could anyone please assist?
In this case What you should do is, when it goes to next activity, save the image in local device, and put the image location as a intent value. Then when the new activity start, onCreate method, get the image location from intent values and load the image from the saved location. then delete the saved image.
If you can wait for few hours, I can put the code here.Feel free to ask anything until you get what you want.
Cheers!!

Lload a contact image from contacts include facebook twitter etc - android

I have an android app that I show the contacts details include the contact profile image.
This is how I get the contact image:
Uri photo = null;
String sPhoto = cursor
.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.PHOTO_ID));
if (sPhoto != null) {
photo = Uri.withAppendedPath(person,ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);
myImageView.setImageURI(photo);
This code works just fine when the image is taken from the phone, but in my phone (like many others) I have a facebook profile, twitter profile etc, and in my default dialer I can see the facebook or twitter profile image beside the contact name, or the normal image (from the phone)
My code is given me only the image that exists in my phone, How do I get all images include facebook or twitter if such images exists?
Thank you

how to upload image captured from camera in an android app

in my app i have placed a button called Add Photo, when the user clicks the button a pop up menu appears with 2 option camera and library. When i select library i am able to move to the photo album of the device. Following is the code which i am using to go to the mobile library
public void library()
{
Intent myIntent = new Intent(Intent.ACTION_PICK);
myIntent.setType("image/*");
startActivityForResult(myIntent, 1);
}
whatever image i click there i want it to be uploaded in an url,
in the same way the image which i capture through the camera also want to be uploaded in an url.
how to do this is there any API or example code pls help me
This SO answer explains how to get the true path of the image in your onActivityResult
How to pick an image from gallery (SD Card) for my app?
Then look for an example on how to upload a file using http, any Java example ought to work, for instance:
http://www.jguru.com/faq/view.jsp?EID=62798

Categories

Resources