adding flickr pictures to android gallery and display it - android

I am new to android, I have learned how to display drawable pic in gallery,
and display a url pic use ImageView. Now I dont know how to display online pictures in gallery. Should I use listview or not? In addtion, I want to know how to get pictures urls from flickrs with given userid

Do you mean like a photo gallery? is that what your app is supposed to do? Then, yes you could use a ListActivity/ListView. However i do not know if this will provide you with exactly the effect you want. A list view would load ALL of the pictures before the UI could be displayed and you would view them by scrolling. typically a photo viewer shows pictures full screen and switches with either a button or a swipe (gesture).
To get the latter effect, your app could display an ImageView with the first pic while it loads the next pic, and then switch to a new ImageView when the user clicks a button or swipes. this will prevent your app from eating up resources and will give you an interface that people are more used to.
as for flickr, you will have to ask someone else (you should separate these into two separate questions because they are so different)

Related

Android Gallery Button Beside Capture Button

can you plesae tell me what can I use to make the gallery widget that is on the left side of the capture button. I am guessing I would need access to the last image captured and an image view and then the person would be taken to the gallery to select the image. Can you please tell me how I should go about that and any references to websites or documentation?
Take a look here. There is answer how to get last picture taken by user and then you can simply set it to your ImageView.

How to create a grid thumbnail gallery with photo browser for Android

I've just written an app with a nice photo gallery for iOS, now I'd like to do the same thing with my Android version of the app. I see that the Android Gallery API allows me to build a scrolling gallery of images. But what I really want is an apple-photo gallery style interface with a grid of thumbnails which, when tapped, open up a full screen display of the selected image and allows me to navigate through the photo gallery using swipes or left/right arrows on a tool bar.
In iOS I used the KTPhotoBrowser to achieve this interface, but I haven't been able to find anything like that for Android. Can anybody point me to a library, or even a tutorial with example code which will give me an interface like that without having to roll it myself?
Update: I've found the GridView Tutorial which describes how to put image thumbnails into a grid, seems to be the perfect thing. The Gallery API can be used for the full size photo browser as shown in #ariefbayu sample code (see link in comments below). It's not quite the same as the iPhone style gallery, but it's pretty good.
I've done this kind of interface. The basic is:
MainActivity load images into GridView.
On each Gallery click, load another activity using Intent, called SlideActivity which extends 'Gallery' in full screen mode where this will:
show Gallery and set current image to selected
set currently selected image in gallery, to what is clicked in first layout.
Link to sample code: https://www.dropbox.com/s/xk2oupma8zcxqpf/GridToGallery.zip

Android, How to show array of address of images with intent?

I have an array which includes URL address of for example 20 images. When user clicks on a button i need to show image in full screen mode and if user touched the screen and his finger points to right or left then show next or previous image (something like loading image from gallery and navigating to right or left).
Is it possible to do it with intents? Thank you.
Yes you can do it, find out the Gallery example in Android Universal Image loader.

Selecting thumbnail and viewing full screen

I have my app working where it comes to a screen with 6 thumbnails. The user will select one and the next screen is a full image. I've accomplished this through an OnClickListener to call a new activity/xml (I'm new at this, sorry if my terminology is a little off).
My question is: is there a way to avoid creating 6 activty/xml (one for each thumbnail)? ultimately, my app will have about 40 thumbnails that can be selected for full screen view.
I've been trying to follow examples online where it appears that the code is presenting the full image within java instead of referencing an xml file. I've also seen use of Bitmap and BitmapFactory. Is this the way to go?
If the full screen image can be created dynamically within java, will the Back button still work to the user back to the screen with 6 thumbnails?
thanks, J
The simplest approach to take is to pass a reference to the image in the intent you use to launch the full-screen activity.
You can use the BitmapFactory to create a Bitmap, and then update the ImageView (or however you're displaying the image) from the loaded bitmap.
Using this approach, the back button will still work normally, but you'll only need one activity to display the full-screen image.

ACTION_VIEW for images but only a subset of images

I have an app that have more than one gallery. It is a travel app and it have a separate gallery for each trip. When I'm taking pictures with the camera I'm saving them in the default MediaStore of the system.
To view an Image I'm using new Intent(Intent.ACTION_VIEW) and it launches the default image viewer. When scrolling with the left and right arrows it displays all the pictures in the folder where the pictures from the camera are saved.
Is there any way to put an extra in the intent when calling VIEW action which images to scroll trough? I have the IDs of the images for a certain trip in a database.
Or putting them in a separate folder is the only solution?
You could also consider building your own preview activity using a GridView. Of course this is more work to do, but also offers more flexibility:
You can create "virtual" folders
You can display images from local store or from the net (if you want to offer synchronization with web albums for example)
You can highlight certain images (favorite, shared)

Categories

Resources