I am using flickr API in my project, everything is working fine but i stuck at point where I am not able to get user's profile picture.
For example i am getting below type response
<user nsid="12037949754#N01" url="http://www.flickr.com/people/bees/" />
But not getting user image URL , can any one please help me out?
It's really very simple to find out the profile picture of any user which is called buddyicons. The API format/syntax is:
http://farm{icon-farm}.staticflickr.com/{icon-server}/buddyicons/{nsid}.jpg
For example: http://farm9.staticflickr.com/8573/buddyicons/116479554#N04.jpg
Here in this example, icon-farm=9, icon-server=8573 and nsid=116479554#N04
By default, the above example will give you default image of size 48*48(Each user has this size image may or may not exist large, medium images), but if you want large, medium, small profile pictures then just append _l, _m, and _s at the end of nsid respectively.
For example: http://farm9.staticflickr.com/8573/buddyicons/116479554#N04_l.jpg
Hope this help you and resolve your issue and might be useful to other users also who face the same issue.
Related
I'm creating an app where the user will use the camera or choose some photos from the gallery.
I'm trying to put some rules when the user chooses the photo from the album but I don't know all the properties and I tried to search some site or tutorial but I didn't found anything.
Someone knows where I can find this or learn the properties.
Properties like this
intent.putExtra("crop","true");
intent.putExtra("aspectX",10);
intent.putExtra("aspectY",10);
intent.putExtra("outputX",256);
intent.putExtra("outputY",256);
intent.putExtra("return-data",true);
I need to disable the resize function from the crop screen and I want to learn more about working with an android camera.
Thanks and regards to everyone.
"return-data"
"cropped-rect"
"aspectX"
"aspectY"
"spotlightX"
"spotlightY"
"outputX"
"outputY"
"scale"
"data"
"scaleUIfNeeded"
"outputFormat"
"set-as-wallpaper"
"noFaceDetection"
I refer you to Mr. Murphy's post here: http://commonsware.com/blog/2013/01/23/no-android-does-not-have-crop-intent.html
I used graph API Json Response of facebook Wall POst Images and display in my APP i successfully got it. But the images look very Blur .. please tel me how to get clear images as like in Facebook
here is my code
URL url=new URL("http://graph.facebook.com/"+hashMap.get("id")+"/picture?type=normal");
Bitmap bitmap=BitmapFactory.decodeStream(url.openConnection().getInputStream());
((ImageView)view.findViewById(R.id.imageView_ProfilePicture)).setImageBitmap(bitmap);
url=new URL(hashMap.get("picture_url"));
bitmap=BitmapFactory.decodeStream(url.openConnection().getInputStream());
((ImageView)view.findViewById(R.id.imageView_FullImage)).setImageBitmap(bitmap);
And in AsynTask
dobackground(){
hashMap.put("picture_url", data.getJSONObject(i).getString("picture"));
}
Use "/picture?type=large" instead of "/picture?type=normal" to get a slightly bigger picture.
While ?type=large provides a bigger image it may still not be large enough for a xhdpi display. You can actually specify a actual size now and they'll try their best to fulfill it.
For example this gives you a large square of Mark Zuckerberg:
http://graph.facebook.com/4/picture?width=500&height=500
I've been trying to figure out how to display a photo on Android. I can create an ImageView and display a picture, but the functionality is limited (no zoom, pan or share). Is there a demo or tutorial with code out there on how to do this? I've been searching all week with no luck.
Thanks.
P.S.> Please No Snark!
Maybe I don't understand how to create a uri correctly or how to make my resource available to the viewer. I have a resource ID, R.drawable.opal, I'm using to display different minerals and gems for a science project. If the student clicks the small sample photo, then I want to bring up a bigger and better viewer for the photo to allow them to compare to their collected rock.
Unless you really need to build your own you should probably just use the gallery's viewer. Send it the picture by using the view intent like so:
Intent viewImageIntent = new Intent(android.content.Intent.ACTION_VIEW, uri);
startActivity(viewImageIntent);
Replace "uri" with the image's uri of course. Writing your own viewer is really involved and would include threading, physics calculations and handling touch inputs.
I'm trying to retrieve the currently-logged-in user's avatar image so that I can save it on my server and use it later in my application.
How would I go about getting the image directly?
Try this:
(replace USER_ID with alias or user ID...)
set source as https://graph.facebook.com/USER_ID/picture
for example large icon of a Page ID 149926629437 is:
http://graph.facebook.com/149926629437/picture?type=large
<img src="http://graph.facebook.com/149926629437/picture?type=large"/>
more info (specify size etc...):
http://developers.facebook.com/docs/reference/api/
part Pictures
(I also userd the aQuery (android query) to cache images...
aq.id( holder.image).image("https://graph.facebook.com/" + USER_ID + "/picture?type=normal");
http://code.google.com/p/android-query/
It seems working fine...
)
Can't say much about this, but you might want to try the facebook android sdk here ->https://github.com/facebook/facebook-android-sdk . Good luck :)
If you want a higher quality profile picture try:
https://graph.facebook.com/{ID}?fields=picture.height(2048)
And then retrieve the response.picture.data.url
I guess this question has been asked before, but I can't seem to find a proper answer/solution.
Have a note-taking app, which allows to take pictures. For that I start an intent, that starts up the built-in camera-app. So far so good.
But when I show that image in my app, it's in a much smaller format :(
The funny/weird thing is, that the camera-app did take a full-resolution picture! But for some reason I can't get the full version to show in my app???
So, when I use the standard Android Gallery app, and go to that picture, it is very obvious that it's full size (I can zoom in and see details I really can't see when I zoom in, in my own app). Also, the dimensions are really those of the original picture, taken with the 5MP camera.
In my app, they are very small. My phone has Android 2.2, but the same happens on my emulator (Android 2.1).
How should I retrieve the pictures in my app??? Tried a couple of ways, but none works :( Don't need a complete example (allthough that's very welcome), just a few clues are enough to search for myself.
Tx in advance!!
Greetingz,
Koen<
Very weird, I found the solution/answer by looking at the _ID-values that were being inserted in my own database. First I noticed that when I selected an existing image (via the build-in Android Gallery), I did get the full size image.
When I first took a picture, I got a scaled image. So where was the difference. Apparantly at the location where the _ID of the picture got stored in my database. In my case, and probably most cases, this happens in the onActivityResult procedure.
First take a look at what I initially had:
if(requestCode == REQUEST_CAMERA && resultCode == RESULT_OK){
String timestamp = Long.toString(System.currentTimeMillis());
// get the picture
mPicture = (Bitmap)result.getExtras().get("data");
//save image to gallery
String pictureUrl = MediaStore.Images.Media.insertImage(getContentResolver(), mPicture, getResources().getString(R.string.app_name_short), timestamp);
insertPictureAttachment(mRowId.intValue(), Integer.parseInt(Uri.parse(pictureUrl).getLastPathSegment()));
The "insertPictureAttachment"-method does the actual inserting into the database.
Looking backwards, this was a bit weird anyway ... make a picture, so I could make an URI of it, and then get the last path segment (which is the _ID), so I could insert that into my database.
Eventually, it turns out that I can replace the above code with just one line:
insertPictureAttachment(mRowId.intValue(), Integer.parseInt(result.getData().getLastPathSegment()));
Much shorter, and actually makes more sense ... rather than getting the info from result.getExtras().get("data"), I get my info from result.getData(), which gives the _ID of the original, full-size image.
I will do some further research on this though, cause it's not clear to me yet why I actually don't have to call MediaStore.Images.Media.insertImage(...) ... maybe I will have to if I want specific features (like a custom file location or something like that).
Greetingz,
Koen<