
sampling can provide a better way of loading and optimizing memory. While loading an image from the web, its resolution can be larger than the device. this way the lru objects are left at the initial point of the queue later, when the app asks to get an object from the cache, it is placed at the start of a queue. if a new object is added to the cache, it is placed at the beginning of the queue. lrucaches have a fixed cache size and work like a queue. the term itself clarifies the way cache works. i used the lrucache algorithm to implement this mechanism. if you are using a certain resource in your application, you should know that it isn’t easy to retrieve. for this, the most important function is caching. When you build a mobile or a web application, you have to make sure it runs as fast as possible. Increase user engagement by pushing users to share these images.įirst, upload an image from an android sd card to the server so as to get a web url to perform operations on the image, like sharing. here, we are using app42′s service to upload an image to the server. Upload an image on the server from android sd card. thereafter, i will perform caching, sharing, and saving operations on the image. here, for example, i will upload an image from an android sd card using the images play that important role in making an app, or to specify, an android app.

Toast.makeText(ProfileActivity.this, "You haven't picked Image",Toast.LENGTH_LONG).show() ĭon't forget to give permission in Manifest file.What if i ask you to guess the icon image for whatsapp or instagram? even before your mind processes my question, decides on an image and responds, your mouth would have already answered me. Toast.makeText(ProfileActivity.this, "Something went wrong", Toast.LENGTH_LONG).show() Toast.makeText(this, "You haven't picked Image", Sp.edit().putString("dp", encodedImage).commit()

String encodedImage = Base64.encodeToString(byteArray, Base64.DEFAULT) Set the Image in ImageView after decoding the StringīyteArrayOutputStream stream = new ByteArrayOutputStream() īmp.compress(, 100, stream) String imgDecodableString = cursor.getString(columnIndex) Int columnIndex = cursor.getColumnIndex(filePathColumn) *Declare PICK_IMAGE globally : private static final int PICK_IMAGE = 1 */Īctual Code starts Here protected void onActivityResult(int requestCode, int resultCode, Intent data) Ĭursor cursor = getContentResolver().query(selectedImage,

StartActivityForResult(Intent.createChooser(intent,"Select Picture"), PICK_IMAGE) Use the following code for selecting image from gallery : Intent intent=new Intent()
