`

【翻译】(41)数据存储

 
阅读更多

【翻译】(41)数据存储

 

see

http://developer.android.com/guide/topics/data/data-storage.html

 

原文见

http://developer.android.com/guide/topics/data/data-storage.html

 

-------------------------------

 

Data Storage

 

数据存储

 

-------------------------------

 

Storage quickview

 

存储快速概览

 

* Use Shared Preferences for primitive data

 

* 对原始数据使用共享预设

 

* Use internal device storage for private data

 

* 对私有数据使用内部设备存储

 

* Use external storage for large data sets that are not private

 

* 对非私有的大数据集使用外部存储

 

* Use SQLite databases for structured storage

 

* 对结构化存储使用SQLite数据库

 

In this document

 

本文目录

 

* Using Shared Preferences 使用共享预设

* Using the Internal Storage 使用内部存储

* Saving cache files 保存缓存文件

* Other useful methods 其它有用的方法

* Using the External Storage 使用外部存储

* Checking media availability 检查媒体可用性

* Accessing files on external storage 访问外部存储上的文件

* Saving files that should be shared 保存应该被共享的文件

* Saving cache files 保存缓存文件

* Using Databases 使用数据库

* Database debugging 数据库调试

* Using a Network Connection 使用网络连接

 

See also

 

另见

 

Content Providers and Content Resolvers 内容提供者与内容解析器

 

-------------------------------

 

Android provides several options for you to save persistent application data. The solution you choose depends on your specific needs, such as whether the data should be private to your application or accessible to other applications (and the user) and how much space your data requires.

 

Android为你提供几个选项以保存持久的应用程序数据。你选择的解决方案依赖于你的特定需要,诸如数据是否应该对于你的应用程序是私有的,还是对于其它应用程序(以及用户)是可访问的,以及你的数据需要多少空间。

 

Your data storage options are the following:

 

你的数据存储选项如下:

 

* Shared Preferences

 

* 共享预设

 

Store private primitive data in key-value pairs.

 

把私有的原始数据储存在键值对中。

 

* Internal Storage

 

* 内部存储

 

Store private data on the device memory.

 

把私有数据存储在设备内存上。

 

* External Storage

 

* 外部存储

 

Store public data on the shared external storage.

 

把公共数据存储在共享的外部存储上。

 

* SQLite Databases

 

* SQLite数据库

 

Store structured data in a private database.

 

把结构化数据存储在一个私有数据库中。

 

* Network Connection

 

* 网络连接

 

Store data on the web with your own network server.

 

把数据存储在带有你自己的网络服务器的网页上。

 

Android provides a way for you to expose even your private data to other applications — with a content provider. A content provider is an optional component that exposes read/write access to your application data, subject to whatever restrictions you want to impose. For more information about using content providers, see the Content Providers documentation.

 

Android甚至为你提供一种方式以暴露私有数据给其它应用程序——使用内容提供者。一个内容提供者是一个可选的组件,它暴露读/写你的应用程序数据的访问权,服从你所希望强加的任何限制。想获取关于使用内容提供者的更多信息,请参见内容提供者文档。

 

-------------------------------

 

Using Shared Preferences

 

使用共享预设

 

The SharedPreferences class provides a general framework that allows you to save and retrieve persistent key-value pairs of primitive data types. You can use SharedPreferences to save any primitive data: booleans, floats, ints, longs, and strings. This data will persist across user sessions (even if your application is killed).

 

SharedPreferences类提供一个通用框架,它允许你保存和取出持久的原始数据类型的键值对。你可以使用SharedPreferences来保存任意原始数据:布尔型,浮点型,整型,长整型,以及字符串。这个数据将跨用户会话持久化(即便你的应用程序被杀死)。

 

-------------------------------

 

User Preferences

 

用户预设

 

Shared preferences are not strictly for saving "user preferences," such as what ringtone a user has chosen. If you're interested in creating user preferences for your application, see PreferenceActivity, which provides an Activity framework for you to create user preferences, which will be automatically persisted (using shared preferences).

 

共享预设不是严格地用来保存“用户预设”,诸如一个用户已经选择的是什么铃声。如果你对为你的应用程序创建用户预设感兴趣,请参见PreferenceActivity,它提供一个Activity框架给你来创建用户预设,它将自动地被持久化(使用共享预设)。

 

-------------------------------

 

To get a SharedPreferences object for your application, use one of two methods:

 

要想为你的应用程序获取一个SharedPreferences对象,请使用两个方法之一:

 

* getSharedPreferences() - Use this if you need multiple preferences files identified by name, which you specify with the first parameter.

 

* getSharedPreferences()——使用它,如果你需要多个预设文件,而它们的名称是你用第一个参数指定的。

 

* getPreferences() - Use this if you need only one preferences file for your Activity. Because this will be the only preferences file for your Activity, you don't supply a name.

 

* getPreferences()——使用它,如果对于你的Activity来说你只需要一个预设文件。因为对于你的Activity来说它将是仅有的预设文件,所以你不提供名称。

 

To write values:

 

为了写入值:

 

1. Call edit() to get a SharedPreferences.Editor.

 

1. 调用edit()以获取一个SharedPreferences.Editor。

 

2. Add values with methods such as putBoolean() and putString().

 

2. 使用一些方法来添加值,诸如putBoolean()和putString()。

 

3. Commit the new values with commit()

 

3. 用commit()提交新的值。

 

To read values, use SharedPreferences methods such as getBoolean() and getString().

 

为了读取值,请使用SharedPreferences的方法诸如getBoolean()和getString()。

 

Here is an example that saves a preference for silent keypress mode in a calculator:

 

这里有一个示例,它为一个计算器中的静音按键模式保存一个预设:

 

-------------------------------

 

public class Calc extends Activity {

    public static final String PREFS_NAME = "MyPrefsFile";

 

    @Override

    protected void onCreate(Bundle state){

       super.onCreate(state);

       . . .

 

       // Restore preferences

       // 恢复预设

       SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);

       boolean silent = settings.getBoolean("silentMode", false);

       setSilent(silent);

    }

 

    @Override

    protected void onStop(){

       super.onStop();

 

      // We need an Editor object to make preference changes.

      // All objects are from android.context.Context

      // 我们需要一个Editor以使预设改变。

      // 所有对象来自android.context.Context

      SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);

      SharedPreferences.Editor editor = settings.edit();

      editor.putBoolean("silentMode", mSilentMode);

 

      // Commit the edits!

      // 提交编辑!

      editor.commit();

    }

}

 

-------------------------------

 

-------------------------------

 

Using the Internal Storage

 

使用内部存储

 

You can save files directly on the device's internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed.

 

你可以直接保存文件在设备的内部存储上。默认,保存在内部存储的文件对于你的应用程序来说是私有的,其它应用程序不能访问它们(用户也不可以)。当用户卸载你的应用程序时,这些文件被移除。

 

To create and write a private file to the internal storage:

 

要想创建和写入一个私有文件到内部存储:

 

1. Call openFileOutput() with the name of the file and the operating mode. This returns a FileOutputStream.

 

1. 用文件的名称和操作模式调用openFileOutput()。它返回一个FileOutputStream。

 

2. Write to the file with write().

 

2. 用write()写入到文件。

 

3. Close the stream with close().

 

3. 用close()关闭流。

 

For example:

 

例如:

 

-------------------------------

 

String FILENAME = "hello_file";

String string = "hello world!";

 

FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);

fos.write(string.getBytes());

fos.close();

 

-------------------------------

 

MODE_PRIVATE will create the file (or replace a file of the same name) and make it private to your application. Other modes available are: MODE_APPEND, MODE_WORLD_READABLE, and MODE_WORLD_WRITEABLE.

 

MODE_PRIVATE将创建文件(或替换相同名称的文件)并且使它对于你的应用程序是私有的。其它可用的模式有:MODE_APPEND,MODE_WORLD_READABLE,和MODE_WORLD_WRITEABLE。

 

To read a file from internal storage:

 

想要从内部存储中读取一个文件:

 

1. Call openFileInput() and pass it the name of the file to read. This returns a FileInputStream.

 

1. 调用openFileInput()并且把要读取的文件的名称传给它。它返回一个FileInputStream。

 

2. Read bytes from the file with read().

 

2. 用read()从文件中读取字节。

 

3. Then close the stream with close().

 

3. 然后用close()关闭流。

 

-------------------------------

 

Tip: If you want to save a static file in your application at compile time, save the file in your project res/raw/ directory. You can open it with openRawResource(), passing the R.raw.<filename> resource ID. This method returns an InputStream that you can use to read the file (but you cannot write to the original file).

 

提示:如果你希望在编译期保存一个静态文件在你的应用程序中,那么请保存文件在你的工程的res/raw/目录。你可以用openRawResource()打开它,传递R.raw.<文件名>资源ID。这个方法返回一个InputStream,你可以用它读取文件(但你不能写入原来的文件)。

 

-------------------------------

 

Saving cache files

 

保存缓存文件

 

If you'd like to cache some data, rather than store it persistently, you should use getCacheDir() to open a File that represents the internal directory where your application should save temporary cache files.

 

如果你喜欢缓存一些数据,而非持久地保存它,那么你应该使用getCacheDir()来打开一个File,它代表你的应用程序应该保存临时缓存文件所在的内部目录。

 

When the device is low on internal storage space, Android may delete these cache files to recover space. However, you should not rely on the system to clean up these files for you. You should always maintain the cache files yourself and stay within a reasonable limit of space consumed, such as 1MB. When the user uninstalls your application, these files are removed.

 

当设备的内部存储空间低时,Android可能删除这些缓存文件以回收空间。然而,你不应该依赖系统来为你清除这些文件。你应该总是自己维护缓存文件,并且保持在一个消耗空间的合理限制内,诸如1MB。当用户卸载你的应用程序时,这些文件被移除。

 

Other useful methods

 

其它有用的方法

 

* getFilesDir()

 

Gets the absolute path to the filesystem directory where your internal files are saved.

 

获取指向你的内部文件被保存在的文件系统目录的绝对路径。

 

* getDir()

 

Creates (or opens an existing) directory within your internal storage space.

 

创建(或打开一个现存)你的内部存储空间中的目录。

 

* deleteFile()

 

Deletes a file saved on the internal storage.

 

删除保存在内部存储上的一个文件。

 

* fileList()

 

Returns an array of files currently saved by your application.

 

返回你的应用程序当前保存的文件数组。

 

-------------------------------

 

Using the External Storage

 

使用外部存储

 

Every Android-compatible device supports a shared "external storage" that you can use to save files. This can be a removable storage media (such as an SD card) or an internal (non-removable) storage. Files saved to the external storage are world-readable and can be modified by the user when they enable USB mass storage to transfer files on a computer.

 

每个Android兼容设备支持一个共享的“外部存储”,你可以用它来保存文件。它可能是一个可移除的存储媒体(诸如一张SD卡)或一个内部(不可以移除的)存储。保存到外部存储的文件是全局可读(注:这里world-readable对应常量MODE_WORLD_READABLE,可能是指可以跨应用程序包访问文件)的,在它们使能USB海量存储以传输电脑上的文件时,可以被用户修改。

 

-------------------------------

 

Caution: External files can disappear if the user mounts the external storage on a computer or removes the media, and there's no security enforced upon files you save to the external storage. All applications can read and write files placed on the external storage and the user can remove them.

 

警告:如果用户挂接外部存储在一台电脑上或移除媒体,以及没有安全性强加在你保存到外部存储的文件上,那么外部文件可能消失。所有应用程序可以读写放在外部存储上的文件,而且用户可以移除它们。

 

-------------------------------

 

Checking media availability

 

检查媒体可用性

 

Before you do any work with the external storage, you should always call getExternalStorageState() to check whether the media is available. The media might be mounted to a computer, missing, read-only, or in some other state. For example, here's how you can check the availability:

 

在你处理任何外部存储的工作前,你应该总是调用getExternalStorageState()来检查媒体是否可用。这个媒体可能被挂接在电脑上,缺失的,只读的,或者其它一些状态。例如,这里是你如何可以检查可用性:

 

-------------------------------

 

boolean mExternalStorageAvailable = false;

boolean mExternalStorageWriteable = false;

String state = Environment.getExternalStorageState();

 

if (Environment.MEDIA_MOUNTED.equals(state)) {

    // We can read and write the media

    // 我们可以读取和写入媒体

    mExternalStorageAvailable = mExternalStorageWriteable = true;

} else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {

    // We can only read the media

    // 我们仅可以读取媒体

    mExternalStorageAvailable = true;

    mExternalStorageWriteable = false;

} else {

    // Something else is wrong. It may be one of many other states, but all we need

    //  to know is we can neither read nor write

    // 其它有些东西是错误的。它可能是许多其它状态之一,但我们需要知道的所有东西是

    / 我们既不可以读也不可以写

    mExternalStorageAvailable = mExternalStorageWriteable = false;

}

 

-------------------------------

 

This example checks whether the external storage is available to read and write. The getExternalStorageState() method returns other states that you might want to check, such as whether the media is being shared (connected to a computer), is missing entirely, has been removed badly, etc. You can use these to notify the user with more information when your application needs to access the media.

 

这个示例检查外部存储是否读写可用。getExternalStorageState()方法返回你可能希望检查的其它状态,诸如媒体是否正在被共享(连接到一台电脑),是否完全缺失,是否曾经不正确地移除,等等。当你的应用程序需要访问媒体时,你可以使用这些方法用更多的信息通知用户。

 

Accessing files on external storage

 

访问外部存储上的文件

 

If you're using API Level 8 or greater, use getExternalFilesDir() to open a File that represents the external storage directory where you should save your files. This method takes a type parameter that specifies the type of subdirectory you want, such as DIRECTORY_MUSIC and DIRECTORY_RINGTONES (pass null to receive the root of your application's file directory). This method will create the appropriate directory if necessary. By specifying the type of directory, you ensure that the Android's media scanner will properly categorize your files in the system (for example, ringtones are identified as ringtones and not music). If the user uninstalls your application, this directory and all its contents will be deleted.

 

如果你正在使用API级别8或更高,请使用getExternalFilesDir()来打开代表你应该保存你的文件所在的外部存储目录的File。这个方法传入一个指定你想要的子目录类型的type参数,诸如DIRECTORY_MUSIC和DIRECTORY_RINGTONES(传递null以接收你的应用程序文件目录的根目录)。如果需要的话,这个方法将创建合适的目录。通过指定目录的类型,你确保Android的媒体扫描器将在系统中正确地分类你的文件(例如,铃声被标识为ringtones而非music)。如果用户卸载你的应用程序,那么这个目录和它的所有内容将被删除。

 

If you're using API Level 7 or lower, use getExternalStorageDirectory(), to open a File representing the root of the external storage. You should then write your data in the following directory:

 

如果你正在使用API级别7或更低,请使用getExternalStorageDirectory(),以打开一个代表外部存储根目录的File。然后你应该写入你的数据到以下目录中。

 

/Android/data/<package_name>/files/

 

/Android/data/<包名>/files/

 

The <package_name> is your Java-style package name, such as "com.example.android.app". If the user's device is running API Level 8 or greater and they uninstall your application, this directory and all its contents will be deleted.

 

<包名>是你的Java风格包名,诸如“com.example.android.app”。如果用户的设备正在运行于级别8或更高,而他们卸载你的应用程序,那么这个目录和它的所有内容将被删除。

 

-------------------------------

 

Hiding your files from the Media Scanner

 

从媒体扫描器中隐藏你的数据

 

Include an empty file named .nomedia in your external files directory (note the dot prefix in the filename). This will prevent Android's media scanner from reading your media files and including them in apps like Gallery or Music.

 

在你的外部文件目录中包含一个命名为.nomedia的空文件(注意文件名中的点前缀)。它将阻止Android的媒体扫描器读取你的媒体文件和包含它们在你的应用程序中,就像画廊和音乐应用程序那样。

 

-------------------------------

 

Saving files that should be shared

 

保存应该被共享的文件

 

If you want to save files that are not specific to your application and that should not be deleted when your application is uninstalled, save them to one of the public directories on the external storage. These directories lay at the root of the external storage, such as Music/, Pictures/, Ringtones/, and others.

 

如果你希望保存不是特定于你的应用程序的文件,而它们不应该在你的应用程序被卸载时删除,那么保存它们到外部存储上的公共目录中的其中一个。这些目录处于外部存储的根目录,诸如Music/,Pictures/,Ringtones/,以及其它。

 

In API Level 8 or greater, use getExternalStoragePublicDirectory(), passing it the type of public directory you want, such as DIRECTORY_MUSIC, DIRECTORY_PICTURES, DIRECTORY_RINGTONES, or others. This method will create the appropriate directory if necessary.

 

在API级别8或更高,请使用getExternalStoragePublicDirectory(),传给它你想要的公共目录的类型,诸如DIRECTORY_MUSIC,DIRECTORY_PICTURES, DIRECTORY_RINGTONES,或其它。如果需要的话这个方法将创建合适的目录。

 

If you're using API Level 7 or lower, use getExternalStorageDirectory() to open a File that represents the root of the external storage, then save your shared files in one of the following directories:

 

如果你正在使用API级别7或更低,请使用getExternalStorageDirectory()以打开一个File,它代表外部存储的根目录,然后保存你的共享文件在以下目录中的其中一个:

 

Music/ - Media scanner classifies all media found here as user music.

 

Music/——媒体扫描器分类在这里找到的所有媒体作为用户音乐。

 

Podcasts/——Media scanner classifies all media found here as a podcast.

 

Podcasts/ - 媒体扫描器分类在这里找到的所有媒体作为一个播客。(注:播客是指网络上的音频和视频节目,pod来源于苹果的iPod)

 

Ringtones/ - Media scanner classifies all media found here as a ringtone.

 

Ringtones/——媒体扫描器分类在这里找到的所有媒体作为一个铃声。

 

Alarms/ - Media scanner classifies all media found here as an alarm sound.

 

Alarms/——媒体扫描器分类在这里找到的所有媒体作为一个闹钟声音。

 

Notifications/ - Media scanner classifies all media found here as a notification sound.

 

Notifications/——媒体扫描器分类在这里找到的所有媒体作为一个通知声音。

 

Pictures/ - All photos (excluding those taken with the camera).

 

Pictures/——所有照片(不包括用照相机照的照片)。

 

Movies/ - All movies (excluding those taken with the camcorder).

 

Movies/——所有影片(不包括用摄像机录的影片)。

 

Download/ - Miscellaneous downloads.

 

Download/——杂项下载。

 

Saving cache files

 

保存缓存文件

 

If you're using API Level 8 or greater, use getExternalCacheDir() to open a File that represents the external storage directory where you should save cache files. If the user uninstalls your application, these files will be automatically deleted. However, during the life of your application, you should manage these cache files and remove those that aren't needed in order to preserve file space.

 

如果你正在使用API级别8或更高,请使用getExternalCacheDir()来打开代表你应该保存缓存文件所在的外部存储目录的File。如果用户卸载你的应用程序,那么这些文件将被自动地删除。然而,在你的应用程序的生命期间,你应该管理这些缓存文件并且移除不需要的文件,以保留文件空间。

 

If you're using API Level 7 or lower, use getExternalStorageDirectory() to open a File that represents the root of the external storage, then write your cache data in the following directory:

 

如果你正在使用API级别7或更低,请使用getExternalStorageDirectory()来打开一个代表外部存储的根目录的File,然后写入你的缓存文件在以下目录中:

 

/Android/data/<package_name>/cache/

 

/Android/data/<包名>/cache/

 

The <package_name> is your Java-style package name, such as "com.example.android.app".

 

<包名>是你的Java风格的包名,诸如"com.example.android.app"。

 

-------------------------------

 

Using Databases

 

使用数据库

 

Android provides full support for SQLite databases. Any databases you create will be accessible by name to any class in the application, but not outside the application.

 

Android提供SQLite数据库的完全支持。你创建的任何数据库对于应用程序中的任何类来说将是通过名称可访问的,但在应用程序外部则不是。

 

The recommended method to create a new SQLite database is to create a subclass of SQLiteOpenHelper and override the onCreate() method, in which you can execute a SQLite command to create tables in the database. For example:

 

创建新的SQLite数据库的建议方法是创建一个SQLiteOpenHelper的子类,并且覆盖onCreate()类。在它里面你可以执行一个SQLite命令以在数据库中创建表。例如:

 

-------------------------------

 

public class DictionaryOpenHelper extends SQLiteOpenHelper {

 

    private static final int DATABASE_VERSION = 2;

    private static final String DICTIONARY_TABLE_NAME = "dictionary";

    private static final String DICTIONARY_TABLE_CREATE =

                "CREATE TABLE " + DICTIONARY_TABLE_NAME + " (" +

                KEY_WORD + " TEXT, " +

                KEY_DEFINITION + " TEXT);";

 

    DictionaryOpenHelper(Context context) {

        super(context, DATABASE_NAME, null, DATABASE_VERSION);

    }

 

    @Override

    public void onCreate(SQLiteDatabase db) {

        db.execSQL(DICTIONARY_TABLE_CREATE);

    }

}

 

-------------------------------

 

You can then get an instance of your SQLiteOpenHelper implementation using the constructor you've defined. To write to and read from the database, call getWritableDatabase() and getReadableDatabase(), respectively. These both return a SQLiteDatabase object that represents the database and provides methods for SQLite operations.

 

然后你可以使用你已经定义的构造函数获取你的SQLiteOpenHelper实现的一个实例。要想写入和读取数据库,请分别调用getWritableDatabase()和getReadableDatabase()。这两个方法都返回一个SQLiteDatabase对象,它代表数据库并且提供用于SQLite操作的方法。

 

Android does not impose any limitations beyond the standard SQLite concepts. We do recommend including an autoincrement value key field that can be used as a unique ID to quickly find a record. This is not required for private data, but if you implement a content provider, you must include a unique ID using the BaseColumns._ID constant.

 

Android不强加任何超越标准SQLite概念的限制。我们建议包含一个自增长值的键字段,它可以被用作一个唯一ID以快速地找到记录。对于私有数据来说不是必需的,但如果你实现一个内容提供者,那么你必须包含一个使用BaseColumns._ID常量的唯一ID。

 

You can execute SQLite queries using the SQLiteDatabase query() methods, which accept various query parameters, such as the table to query, the projection, selection, columns, grouping, and others. For complex queries, such as those that require column aliases, you should use SQLiteQueryBuilder, which provides several convienent methods for building queries.

 

你可以使用SQLiteDatabase的query()方法来执行SQLite查询,它接受不同的查询参数,诸如要查询的表,投影,选择,列,分组,以及其它。对于复杂的查询,诸如那些需要列别名的查询,你应该使用SQLiteQueryBuilder,它提供用于构建查询的一些便利方法。

 

Every SQLite query will return a Cursor that points to all the rows found by the query. The Cursor is always the mechanism with which you can navigate results from a database query and read rows and columns.

 

每个SQLite查询将返回一个Cursor,它指向被查询找到的所有行。这个Cursor总是一种机制,你可以使用它导航来自一个数据库查询的结果并且读取行和列。

 

For sample apps that demonstrate how to use SQLite databases in Android, see the Note Pad and Searchable Dictionary applications.

 

想获取演示如何在Android中使用SQLite数据库的应用,请参见记事本和可搜索字典应用程序。

 

Database debugging

 

数据库调试

 

The Android SDK includes a sqlite3 database tool that allows you to browse table contents, run SQL commands, and perform other useful functions on SQLite databases. See Examining sqlite3 databases from a remote shell to learn how to run this tool.

 

Android SDK包含一个sqlite3(注:这个sqlite3是sdk中的一个可执行文件的文件名)数据库工具,它允许你浏览表的内容,运行SQL命令,以及在SQLite数据库上执行其它有用的函数(注:功能)。请参见从一个远程外壳中检查sqlite3数据库以学习如何运行这个工具。

 

-------------------------------

 

Using a Network Connection

 

使用网络连接

 

You can use the network (when it's available) to store and retrieve data on your own web-based services. To do network operations, use classes in the following packages:

 

你可以使用网络(当它可用时)来在你自己的基于网页的服务上存储和取出数据。要想执行网络操作,请使用以下包内的类:

 

java.net.*

android.net.*

 

Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.

 

除特别说明外,本文在Apache 2.0下许可。细节和限制请参考内容许可证。

 

Android 4.0 r1 - 20 Jan 2012 22:25

 

-------------------------------

 

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

 

(此页部分内容基于Android开源项目,以及使用根据创作公共2.5来源许可证描述的条款进行修改)

 

(本人翻译质量欠佳,请以官方最新内容为准,或者参考其它翻译版本:

* ソフトウェア技術ドキュメントを勝手に翻訳

http://www.techdoctranslator.com/android

* Ley's Blog

http://leybreeze.com/blog/

* 农民伯伯

http://www.cnblogs.com/over140/

* Android中文翻译组

http://androidbox.sinaapp.com/

 

分享到:
评论

相关推荐

    Transformer机器翻译数据集

    Transformer机器翻译数据集是用于训练和评估机器翻译模型的重要资源,尤其在自然语言处理(NLP)领域。Transformer模型由Google的研究团队在2017年提出,它彻底改变了序列到序列学习的范式,成为了现代神经网络翻译...

    中英翻译模型数据 中英互译语料

    《中英翻译模型数据与中英互译语料解析》 在现代信息技术中,机器学习和自然语言处理(NLP)领域取得了显著的进步,其中,中英翻译模型数据扮演着至关重要的角色。这些数据集是训练高效、准确的神经网络翻译系统的...

    从excel中导入数据至QT翻译文件

    我们需要创建一个TS对象,然后使用`insert()`或`addTranslation()`方法将解析出的翻译数据添加进去。 4. **Qt5.5编译**:在添加了新翻译后的TS文件需要使用Qt的linguist工具或命令行工具lupdate和lrelease进行编译...

    爬取百度翻译.py_数据挖掘;python_百度翻译爬取_

    4. **数据存储**:爬取到的翻译数据可以存储在本地文件(如CSV或JSON格式),或者直接存入数据库(如SQLite、MySQL)。存储方式应考虑数据量和后续分析的需求。 此外,项目中提到的数据挖掘部分,通常涉及到数据...

    c# winform工具 用Google在线大量翻译SQL数据库中的数据,多字段一起翻译

    对于SQL Server数据库,这是一个关系型数据库管理系统,广泛应用于企业级数据存储。SQL Server 2005及更高版本提供了丰富的功能,包括事务处理、备份恢复、安全性管理和性能优化等。在这个工具中,很可能使用了ADO...

    数据驱动仿真的翻译

    相关工作部分回顾了过去的研究,早期的技术如运动图方法和基于图的模拟逐渐发展到从录像中学习的轨迹存储,再到使用数据库方法和混合不同输入数据来生成新的人群动画。这些方法都在试图解决如何在没有明确行为模型的...

    01 DNA数据存储.pdf

    随着信息时代的飞速发展,数据存储的需求呈现出爆炸性的增长趋势。传统硬盘、固态硬盘等电子存储介质已面临物理极限的挑战,这促使科学家们开始探索全新的存储技术。分子数据存储技术,特别是DNA数据存储技术,成为...

    java数据结构(老外那版,翻译的)

    《Java数据结构(老外那版,翻译的)》是一本专门为Java程序员设计的数据结构教程,它以清晰易懂的方式介绍了各种重要的数据结构概念。这本书是初学者的优秀选择,特别是对于那些偏好Java语言,不熟悉C++的人来说,...

    hadoop分布式存储平台外文文献翻译.doc

    HDFS的设计目标是为了满足大规模数据存储和处理的需求,具有高可靠性、可扩展性和高性能。HDFS的设计考虑了以下几点: * 高可靠性:HDFS可以检测和自动恢复硬件错误,确保数据的安全和可靠性。 * 可扩展性:HDFS...

    英法语言翻译数据集.zip

    CSV(Comma Separated Values)格式是一种常见的数据存储方式,便于分析和处理。每行可能代表一个翻译对,英文句子和法文句子通过某种分隔符(如逗号)分开。为了充分利用这个数据集,开发者需要将其加载到适当的...

    数据结构_表达式翻译

    ### 数据结构之表达式翻译——MFC计算器设计与实现 #### 实验背景及目标 本次实验旨在通过实际项目开发,加深学生对数据结构的理解与应用能力。具体而言,实验要求学生设计并实现一个能将中缀表达式转换为后缀...

    操作数据存储(ODS)和数据集市(详解).ppt

    1. ODS 的定义:ODS 是 Operational Data Store 的简称,翻译成操作数据存储。它是一个面向主题的、集成的、可变的、当前的细节数据集合,用于支持企业对于即时性的、操作性的、集成的全局信息的需求。 2. ODS 的...

    数据库翻译作业——大型共享数据库数据的关系模型

    在IT行业中,数据库是存储和管理信息的核心工具,特别是在大型共享环境下的数据处理。本话题主要探讨的是“大型共享数据库数据的关系模型”,这是数据库理论的一个重要组成部分,它涉及到如何用数学化的方式描述和...

    中日词典翻译数据库

    这两个`.mdb`文件都是Microsoft Access数据库格式,这是一种关系型数据库管理系统,用于存储和管理大量结构化数据。在实际应用中,用户可能需要使用Access软件或者开发特定的应用程序来访问和检索这些数据。数据库...

    中英翻译的数据库存储过程

    ### 数据库存储过程实现中英文翻译 #### 概述 本文档主要介绍了一种通过SQL Server存储过程实现中文字符到拼音转换的方法。该方法适用于在数据库层面进行数据处理的情况,例如将中国的省市名称等中文字段转换成...

    计算机英文文献+翻译(数据仓库)

    它不仅提供了结构化的数据存储方式,还为用户提供了必要的工具来进行高效的数据分析。在当前高度竞争的商业环境中,数据仓库已经成为了一个非常有价值的工具。许多公司不惜投入巨额资金来构建企业级的数据仓库系统。...

    数据仓库(中英文翻译)分享.pdf

    与传统的操作数据库、事务处理系统和文件系统不同,数据仓库系统强调的是数据的集成,提供了一个稳定的基础,用于存储和分析经过整合的历史数据。 W.H. Inmon,数据仓库系统构建的先驱者,将数据仓库定义为“面向...

    GDAL数据集(Dataset)翻译版

    GDAL数据集(Dataset)是Geographic Information System(GIS)中一种常见的数据存储格式,它允许用户存储和操作大量的地理空间数据。在本篇文章中,我们将对GDAL数据集的概念、结构、成员函数和应用进行详细的介绍...

    UWB定位DW1000硬件数据手册中文翻译文档

    3. **内存**:存储配置参数和临时数据。 4. **接口**:通过SPI或I²C与主机微控制器通信,提供配置和控制功能。 5. **电源管理**:支持多种电源模式,以优化功耗。 四、DW1000应用示例 DW1000芯片广泛应用于工业...

Global site tag (gtag.js) - Google Analytics