We know that Android offers several different resolution bitmap to match the density of different phone screens. The corresponding relationship is as follows:
xxhdpi:3.0
xhdpi:2.0
hdpi:1.5
mdpi:1.0
ldpi:0.75
So a problem arises:Since Android can be converted automatically, why waste user space to store low-resolution images when it comes to Android
Android development accumulation _ 1) Get files, folder buckets, and use Toast in a user-friendly manner
Record the file-related content that needs to be used frequently. In other words, good memory is not as good as bad writing!
1)
/*** Obtain the total memory space of a file or folder in the path *** @ return */public static long getTotalMemorySize (String
Create a folder on sdcard in Android, androidsdcard
// Create a folder on the SD cardPublic void createSDCardDir (){If (Environment. MEDIA_MOUNTED.equals (Environment. getExternalStorageState ())){// Create a folder object and assign it to the directory of the External StorageFile sdcardDir = Environment. getExternalSt
The Android program function Copies files in the assets folder to the SD card (including subfolders) of the mobile phone and androidassets.
Recently, the function is to copy all files (including sub-files) in the asset folder to the specified directory. The method used is nothing more than AssetManager. However, the problem here is that both subfolders and subfol
In the LAN, the implementation from the Android client to the mobile phone SD card files uploaded to the PC server side, and saved in the PC hard drive under the specified folder. At the same time, the PC-side hard disk file directory and the file description information stored in the MySQL database.1, the client key code:(1) Get the files on the SD card/** * Get file path and status information * * @retur
Due to work needs, today we have studied how to create folders and modify their permissions in Android. We need to know that each application package has a private directory for storing data (similar to folders ), only applications of this package can write data to this directory space. The private data directory of each package application is in the absolute path of Android/data/
The Code is as follows:
1,
Android reads the contents of the Assets folderAssets folder is a directory in the Android program to store relevant external files, Android has provided the appropriate way to access the contents of the folder, so we do not need to carry out the relevant path judgment and o
The problem arises [2013-01-11 10:52:39-GRIDLAYOUT_V7] Unable to resolve target ' android-7 ' cause: At one time to do nine Gongge. The GridLayout layout was mistakenly used. So Eclipse took the initiative to download for me?? Gridlayout_v7_2 file and put it in the workspace folder.Because it is no longer necessary, but also for the clarity of the folder structure, you need to delete it. But when you close
()///folder directory for all files for (int i = 0; i 5)Use this method to prevent multiple pop-up reminders when a toast is triggered multiple timesPrivate Toast mtoast = null;private void Showtoast (context context, String str) {if (mtoast = = null) {Mtoast = Toast.maket EXT (context, str, toast.length_short);} else {mtoast.settext (str);} Mtoast.show ();}File related actions:1) String name = File.getname ();// get the file or
Android Program multi-language support is the difference between the value folder in different countries, the previous document has a description of the corresponding country name value how to write as follows the replacement of the multi-language picture is also in the Picture Directory folder drawable folder as follo
1. Introduction to favorites on the desktop
The launcher desktop has four elements in the middle, which are the window widgets of a clock. The following lines are respectively a camera, an Amazon bookmarks, and a folder (the folder contains settings and clock ).
In the code, they are all favorites: appwidget, application, shortcut, and folder.2. view the databas
Due to the development of the time to open to view the contents of the database, in Eclipse database files by default in the/data/data/application package name/databases/database name, and with Android Studio Open Ddms under Find when found clicking on the Data drop-down button did not react (as shown) and then looked for a long time to find that the permissions issue, you need to modify the permissions of the file:The above is unmodified, you can see
1, the market, some Android big game screen is very exquisite, but its program bulky, often with hundreds of trillion packets, installation of such games, you will need between the simulator and the computer has a mutual access to the public folder, facilitate data transfer;
2, in order to facilitate future management, we recommend that users create a dedicated
In short: The problem is that the jar package repeats the conflict!At the beginning of this question I appeared a "self-righteous" answer, in the Android Private libraries directory will be packaged into the project executable, and not automatically compiled because the libs below the jar file is too large to cause, But obviously, when it's running, it's a direct error--class not found!So obviously that's not the problem!In fact, there is a
In the process of Android development, we often need to change the style of the control, can be used to increase the background image of the way to change, but the background image is more and more certainly will make the apk file greatly.We can do that with a custom attribute shape.Shapegradient--corresponds to the color gradient.StartColor, EndColor will not say much. android:angle refers to the angle from which the change begins. Solid--fill.Strok
The Android custom control style is in the XML under the Drawable folder, which is achieved by setting the control's Background property in the layout file.First, the control common state: used in the XML file selector node, selector can be understood as a state switcher, different states to switch the different styles, various states with the item node representation, The following are some common states
displays 1 or 3 files. therefore, the multimedia files in the SD card will not be displayed in the Image Library.
About the android. nomedia file:
. Nomedia file: Images in the application are not scanned by the System Image Library. when the nomedia file is placed in any folder, all the media files (images, mp3, and videos) in the folder are hidden from the Sys
Original: http://www.cnblogs.com/wanqieddy/archive/2011/12/28/2304906.htmlDue to the need for work, today we have studied how to create folders and modify their permissions under Android, and it is necessary to understand that each application package will have a private directory (similar folder) for storing data, and only applications belonging to that package will be able to write to that directory space
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.