Android Learning Supplements

Source: Internet
Author: User

1. Flush () in Java: Forces data from the output stream buffer to be sent out.

2. File storage:

Store to internal: Another class implementation, the initial initialization of the use of this, and then placed here is not appropriate, changed to a construction method with parameters.

Includes storage, read, append

READ: In addition to using the Setxxx method, for security reasons, using Google API Sharedpreferre directly save the data, the next time you can also be directly extracted. This interface to be used with the editor, must Editor.commit (), this is to prevent the input name is OK, the input pwd time is abnormal, to ensure that the whole process is a transaction, together commit. (The Java web is playing the same way). This interface is stored in XML format, which is the shared_perfs.xml that is visible everywhere!!! Gets the contents of the XML file, Sp.getboolean (key,value), originally stored in the XML file is the <map> method, that is, the key value pair!

External: Add write to SD card permissions in the manifest file. Tips: How do I get sdcard size? Environment class does not provide methods, we know settings inside can get, so download Android source code, import settings package, from the Chinese "Total capacity" search, and then find the implementation method: Getblocksize* Totalblockcount

Sqlite

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.