android circular gallery?

youcan try: public class TestGallery extends Activity { /** Called when the activity is first created. */ private Integer[] mImageIds = { R.drawable.sample_1, R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4 }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Gallery g = (Gallery) findViewById(R.id.gallery); g.setAdapter(new ImageAdapter(this)); g.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) … Read more

image attachment to a mail.. how in android?

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,getResources().getString(R.string.emlSendToFriendSubject)); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[]{emailto}); emailIntent.setType(“text/plain”); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,getResources().getString(R.string.emlSendToFriendBody)); File file = getFileStreamPath(EMAIL_TEMP_FILE); emailIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); emailIntent.setType(“image/jpeg”); emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(“file://”+file.getAbsolutePath())); startActivityForResult(Intent.createChooser(emailIntent, getResources().getString(R.string.btnSendToFriend)),ActMain.EMAIL_DONE);

Android getting an image from gallery comes rotated

You could use ExifInterface to modify the orientation: public static Bitmap modifyOrientation(Bitmap bitmap, String image_absolute_path) throws IOException { ExifInterface ei = new ExifInterface(image_absolute_path); int orientation = ei.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL); switch (orientation) { case ExifInterface.ORIENTATION_ROTATE_90: return rotate(bitmap, 90); case ExifInterface.ORIENTATION_ROTATE_180: return rotate(bitmap, 180); case ExifInterface.ORIENTATION_ROTATE_270: return rotate(bitmap, 270); case ExifInterface.ORIENTATION_FLIP_HORIZONTAL: return flip(bitmap, true, false); case ExifInterface.ORIENTATION_FLIP_VERTICAL: return … Read more

Android – Save images in an specific folder

Go through the following code , its working fine for me. private void createDirectoryAndSaveFile(Bitmap imageToSave, String fileName) { File direct = new File(Environment.getExternalStorageDirectory() + “/DirName”); if (!direct.exists()) { File wallpaperDirectory = new File(“/sdcard/DirName/”); wallpaperDirectory.mkdirs(); } File file = new File(“/sdcard/DirName/”, fileName); if (file.exists()) { file.delete(); } try { FileOutputStream out = new FileOutputStream(file); imageToSave.compress(Bitmap.CompressFormat.JPEG, 100, … Read more

Android : How to detect the image orientation (portrait or landscape) picked from gallery while setting on an imageview?

Use ExifInterface for rotate image. Use this method for get correct value to be rotate captured image from camera. public int getCameraPhotoOrientation(Context context, Uri imageUri, String imagePath){ int rotate = 0; try { context.getContentResolver().notifyChange(imageUri, null); File imageFile = new File(imagePath); ExifInterface exif = new ExifInterface(imageFile.getAbsolutePath()); int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL); switch (orientation) { case ExifInterface.ORIENTATION_ROTATE_270: … Read more

How to access an image from the phone’s photo gallery?

You have to launch the Gallery App using the built-in Intents. After that, on your onActivityResult(), get the path of the selected image and load your image into your ImageView main.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”fill_parent” android:layout_height=”fill_parent” > <TextView android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:text=”@string/hello” /> <Button android:id=”@+id/loadimage” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:text=”Load Image” /> <TextView android:id=”@+id/targeturi” android:layout_width=”fill_parent” … Read more

Loading all the images from gallery into the Application in android

Working solution with the help of Glide. Bonus part is Glide will auto play Gif . import java.util.ArrayList; import android.app.Activity; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.provider.MediaStore.MediaColumns; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; import android.widget.Toast; import com.bumptech.glide.Glide; /** * The Class GallarySample. */ public … Read more