Android under the application of the path and javase different, the application of the data to save their own folder inside> > Getfiledir (); Get your own folder/data/data/package name (application name)/Files> Getcachedir (); /data/data/Package Name (name of application)/The cache Google gives us a directory of two applications, the files directory, which holds important application data. The phone does no
Advantages: 1. Suitable for game storage, can store large data;2. Not only can be stored in the system, but also can be stored in the SD card!@ Save as: Stream data stream mode* @ Note 1: By default, files created using the Openfileoutput method can only be used by the app that they call.* Other apps can't read this file, if need to share data in different applications;** @ NOTE 2: Because the Android OS
The path to the java siege lion (Android)-MP3, MP4, photography, internationalization, style themes, image movement and scaling, android-mp3
I. MP3 player
View the Android API documentation to see the MediaPlayer status transition diagram:
Exercise:
Package com.shellwaygateplayer; import java. io. file; import java. i
INativeDaemonConnectorCallbacks interface. MountService implements this interface and Override the onDaemonConnected () method. This method enables a thread to update the status of an external storage device. The main method for updating the status is also implemented.
20. Return to ListenToSocket and use inputStream to obtain the event passed by Vold. The event is stored in the queue.
21. These events are then taken out in onDaemonConnected () throu
computer. This option enforces the need for a password backup and storage.?? 3, stay awake (keep awake): Select this check box will force the screen to wake up, as long as the connection on the USB cable or charging will not go to sleep, when the need to debug the time to not always go to unlock, quite convenient. 4. Select runtime (Choose Runtime): You can choose Dalvik or art. Art is still experimental until the
use of the Internet to store the data we want, this is the CS structure storage mode, but also a point of name.
How to use the Content Provider
Below are several typical content provider applications that users often encounter:
* Content Provider name:intended Data
* browser:browser bookmarks, Browser history, etc.
* Calllog:missed calls, call Datails, etc.
* Contacts:contact Details
* mediastore:media files such as audio, video and Images
First, the File preservation data IntroductionActivity provides the Openfileoutput () method that can be used to output data to a file, and the implementation process is the same as saving data to a file in a J2SE environment. Files can be used to store large amounts of data, such as text, books, audio, and so on.The file object is suitable for reading or writing large amounts of data in the order from start to finish without skipping. For example, it is suitable for picture files or any content
the SQL statement directly, the other is the implementation of the API of Android itself. Using a database to achieve account login appears to be a bit overqualified for the demonstration of the principle of the database in this paper, the case is to use a database to record multiple users of the account and password information, and the last account information back to the interface. But this is rarely done in practical applications.
Exporting a da
Use External Storage
Each Android-compatible device supports a shared external storage used to save files. This memory can be a removable storage medium (such as an SD card) or internal (non-removable) storage. Files stored in ext
First, how to store the Android data:The Android system offers a total of four data storage options. are: Sharepreference, SQLite, Content provider, and file; There is also a network store. Because the data is basically private in the Android system, it is stored in the "data/data/package name" directory, so to achieve
;Through the Context.getexternalcachedir () method can obtain to sdcard/android/data/{package_name}/cache/, stores the temporary cache data;These two directories correspond to the "clear data" and "clear cache" options in the app-to-application details, settings, respectively.An example of obtaining an external storage cache:
/**
* get the absolute path to
From API8, you can install your application on external storage. This is an optional feature. You can declare the android: installLocation attribute in your application's manifest. If you do not declare this attribute, your application will be installed in internal storage and cannot be moved to external
1. Introduction to file Storage:File storage is a basic form of data storage for Android, similar to the file store in Java, which is stored as an I/O stream intact in the document, in contrast, the file storage in Android is divided into
In general, there are three ways to store data: One is a file, one is a database, and the other is a network. Here is a description of how the Android file is stored in this article.
1. File storage data used Java in the IO operation to save and read files, but android in the context class to encapsulate the input flow and output stream acquisition methods.
The
obtaining/data/
Save the file to SDCard:
Use the openFileOutput () method of Activity to save files. The files are stored in the mobile phone space. Generally, the mobile phone storage space is not very large, and it is okay to store some small files, it is not feasible to store large files such as videos. For large files like videos, we can store them in SDCard.
What does SDCard do? You can think of it as a mobile hard disk or a USB flash disk. To
Android data storage method: SharePreference
Development cannot leave the data, because programming = Algorithm + data. There are five common data storage methods for Android Application Development:
1. Use SharedPreferences to store data 2, file storage data 3, SQLite datab
Android Media Storage ServiceThis article describes how the developer app uses the media Storage service (including Mediascanner, Mediaprovider, and media information parsing) in Android, and includes how to update the app's new or modified files to the media database, How to hide the files generated by the app in the
ContentProviderContentProvider is a mechanism for data sharing among different applications in the Android platform. An application can use this mechanism if it needs to allow other programs to manipulate its own data.And this approach ignores the underlying data storage implementations, ContentProvider provides a uniform way to implement data manipulation through URIs. The steps are:1. Define a ContentProv
Previously introduced three kinds of data storage forms of Android system, http://www.jb51.net/article/99468.htm. Today, there are two other types of content providers and networked storage, respectively. Some people may think that the memory provider and networked storage are more inclined to manipulate the data than
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.