Android ViewPager with previous and next pages visible?

I used a negative page margin to partly show the next and the previous pages. The fading edge property can be used to make previous/next page fade: ViewPager examplePager = (ViewPager) findViewById(R.id.exampleView); examplePager.setPageMargin(-50); examplePager.setHorizontalFadingEdgeEnabled(true); examplePager.setFadingEdgeLength(30); The lastest support package (revision 4, October 2011) is also required for this to work

android : deleting an image

Use the code below, it may help you. File fdelete = new File(file_dj_path); if (fdelete.exists()) { if (fdelete.delete()) { System.out.println(“file Deleted :” + file_dj_path); } else { System.out.println(“file not Deleted :” + file_dj_path); } } to refresh gallery after deleting image use below code for send Broadcast (for < KITKAT API 14) sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(“file://” … Read more

Get list of photo galleries on Android

Groupings are defined by MediaStore.Images.Media.BUCKET_DISPLAY_NAME. Here is the sample code to list the images and log their bucket name and date_taken: // which image properties are we querying String[] projection = new String[] { MediaStore.Images.Media._ID, MediaStore.Images.Media.BUCKET_DISPLAY_NAME, MediaStore.Images.Media.DATE_TAKEN }; // content:// style URI for the “primary” external storage volume Uri images = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; // Make the … Read more

Android get image from gallery into ImageView

Simple pass Intent first: Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(i, RESULT_LOAD_IMAGE); And you will get picture path on your onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) { Uri selectedImage = data.getData(); String[] filePathColumn = { MediaStore.Images.Media.DATA … Read more

Single intent to let user take picture OR pick image from gallery in Android

You can try doing something like this: // … // Within your enclosing Class // … private static final int SELECT_PICTURE = 1; // … Intent pickIntent = new Intent(); pickIntent.setType(“image/*”); pickIntent.setAction(Intent.ACTION_GET_CONTENT); Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); String pickTitle = “Select or take a new Picture”; // Or get from strings.xml Intent chooserIntent = Intent.createChooser(pickIntent, … Read more

Mosaic Grid gallery with dynamic sized images [closed]

I suggest Freewall. It is a cross-browser and responsive jQuery plugin to help you create many types of grid layouts: flexible layouts, images layouts, nested grid layouts, metro style layouts, pinterest like layouts … with nice CSS3 animation effects and call back events. Freewall is all-in-one solution for creating dynamic grid layouts for desktop, mobile, … Read more

Image, saved to sdcard, doesn’t appear in Android’s Gallery app

A simpler solution is to use the static convenience method scanFile(): File imageFile = … MediaScannerConnection.scanFile(this, new String[] { imageFile.getPath() }, new String[] { “image/jpeg” }, null); where this is your activity (or whatever context), the mime-type is only necessary if you are using non-standard file extensions and the null is for the optional callback … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)