Android efficient memory makes your pictures save memoryIn memory optimization, we found that in addition to resolving memory leaks, the only thing left was to reduce the actual memory footprint. In the app, most of the memory may be occupied by our pictures, so reduce the memory footprint of the image can bring a direct effect.How much memory does one or one ima
; intent-filter> activity> activity android:name=". Mainactivity "/> Application>manifest>OK, our code is done ~ try to let it runSummary:
Through the above practice, the use of Picasso has been basically mastered, but we do not involve the most important point is the image of the cache, why did not write this part of it, because this part of the relatively involved in more things, so I intend to write another article specifically explore the
.
Can you maintain a good balance between quantity and quality? In some cases, it is more effective to store multiple low-pixel images, while loads in the background to load high-resolution images.
And not a specified cache size can satisfy all applications, which is up to you. You should analyze the usage of the program's memory and then work out a suitable solution. A cache space that is too small can cause images to be released and reloaded frequently, which does not benefit. A cache
Android: cartoon APP development notes: Scaling pictures in ListView by screen width
1. listview
Where,
android:divider="#00000000"Set the interval color of the list items to transparent,
android:listSelector="#00000000"Set no background color when you click an image (transparent color, no system background color)
Ii. piclist_item
Iii. PicListInfo
Package com. cartoon. adapte
This article describes how Android uses post to upload pictures to the server. Share to everyone for your reference, specific as follows:
/** * Upload files to server class * * @author Tom/public class Uploadutil {private static final String TAG = "UploadFile"; private static final int time_out = 10 * 1000; Timeout time private static final String CHARSET = "Utf-8";
Set Code/** *
Loading pictures from the network there are two main issues to note:1. Memory management: The image occupies a large amount of memory, the number of fake pieces, it is easy to let the system throw out of memory of the exception.At the same time, we should also pay attention to different versions of Android memory management differences.2. Performance: Picture loading speed, and loading
, whereR represents the country, and us represents the United States in Java.
Language recognition rules: for example, when the system language is set to British English, the system cannot find the English language, it will use the files in the "values-en" folder.If it is set to a language without a folder, files in the values folder are automatically matched.-->Android: layout_width = "fill_parent"Android
. In addition, in Android 3.0 (API level 11), image data is stored in local memory, so it cannot be released in a predictable way, which poses a potential risk of memory overflow and crash of the application. To be able to choose a suitable cache size for LruCache, there are several factors that should be taken into account, such as:
How much memory can your device allocate for each application?
How many
This article illustrates the method of adding image and reflection and 3D effect to the gallery dynamically by Android. Share to everyone for your reference, specific as follows:
Gallery in Android can provide a good way to display pictures, achieve the above effect and dynamically add a database or download the image resources on the network. We first impleme
(); } vh.tvTitle.setText ("Title Information Test ————" +position); Vh.ivImg.setTag (Data[position]); Loading images asynchronously, first from a cache, then two cache, the last network to obtain pictures Bitmap bmp = Imageloader.loadbitmap (vh.ivimg, data[position]); if (BMP = = null) {Vh.ivImg.setImageResource (r.drawable.default_big); } else {Vh.ivImg.setImageBitmap (BMP); } return Convertview; } privat
Photo wall This kind of function is quite common now, in many applications you can often see the shadow of the picture wall. Its design is actually very simple, with a GridView control as a "wall", and then along with the GridView rolling a picture affixed to the "wall", these photos can be stored on the phone locally, can also be downloaded from the Internet. To make an application similar to this one, there is a very important question to consider when the picture resources should be released.
Content of this article
Environment
Demo Display Network picture
This article shows how Android displays network pictures. Learn a new language, the best way to understand the language of the grammar and library, as well as design ideas, and then proceed to some common functions, after all, after all, the language is to write programs, and the program is plainly, is a functional
Scalable Vector pictures do not lose sharpness, and a single color of App-icon is perfectYou can define a bitmap as transparency (Alpha) and run time colorsYou can take a color from a bitmap image and remove its more conspicuous color.Website address: https://developer.android.com/training/material/drawables.html
The following image features can help you implement material design in app:
Picture coloring
Color extraction
Vector
This example describes the Android TextView display HTML class parsing pages and pictures and custom tags. Share to everyone for your reference, specific as follows:
The Android system displays the best controls for HTML pages as WebView, and sometimes needs to display HTML pages, images, and parsing custom tags in textview to meet specific needs.
1, TextView d
First, the realization of taking pictures, select pictures and crop picture effects
According to the style of the previous blog, first look at the implementation effect.
II. Application of Ucrop project
Think of the previous yalantis/ucrop effect is more gorgeous, but after the study of the source found in the custom interface is still a bit of restri
This article illustrates a simple way to call pictures, video, audio, recording, and photographing in Android. Share to everyone for your reference, specific as follows:
Select the logo returned by the picture Requestcode Intent innerintent = new Intent (intent.action_get_content); "Android.intent.action.GET_CONTENT" Innerintent.settype (ContentType);
View type String image_unspecified = "image/*";
In
In the previous article, we learned what volley is and how it is used in its basic usage. In this article we are about to learn more advanced usage of volley, how you have not read my previous article, it is recommended to first read the Android volley fully Parse (a), the basic usage of the first knowledge volley .As mentioned in the previous article, volley is a framework that integrates the advantages of asynchttpclient and Universal-image-loader.
The example in this article describes the Android programming method for drawing circular pictures. Share to everyone for your reference, specific as follows:
The effect chart is as follows:
First step: Create new Roundview custom control inherit view
Package com.rong.activity;
Import COM.RONG.TEST.R;
Import Android.content.Context;
Import Android.graphics.Bitmap;
Import Android.graphics.Bitmap.Con
For programmers, especially the front-end design designer, nine Gongge picture is necessary (. 9.png), for beginners do not know this nine Gongge picture what is the use, in fact, this nine Gongge pictures actually commonly used in Android button components, to up and down the background image.Tools/Materials
Computer
Draw9patch.bat
Method/Step
The first step: first to find Draw9patch.bat, my
Although the following app has not done fast map browsing, ES file browser level, encounter big sdcard or there will be read too long, memory overflow and other issues, but the basic idea is this.For example with. There are 4 pictures on the SDcard card,Open the app and it will read all the pictures on the SD card and display it. The read process has a progress bar display.The production steps are as follow
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.