From b100cbf178e91d6652ebbad3ed36684cacb9d10e Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Mon, 26 Jul 2010 11:24:18 -0700 Subject: Support streaming of compressed assets > 1 megabyte Compressed assets larger than one megabyte are now decompressed on demand rather than being decompressed in their entirety and held in memory. Reading the data in order is relatively efficient, as is seeking forward in the stream. Seeking backwards is supported, but requires reprocessing the compressed data from the beginning, so is very inefficient. In addition, the size limit on compressed assets has been eliminated. Change-Id: I6e68247957e6c53e7e8ba70d12764695f1723bad --- tests/LargeAssetTest/Android.mk | 11 +++ tests/LargeAssetTest/AndroidManifest.xml | 28 ++++++ tests/LargeAssetTest/assets/million-ints | Bin 0 -> 4000000 bytes tests/LargeAssetTest/res/layout/lat.xml | 52 +++++++++++ tests/LargeAssetTest/res/values/strings.xml | 23 +++++ .../com/android/largeassettest/LargeAssetTest.java | 104 +++++++++++++++++++++ 6 files changed, 218 insertions(+) create mode 100644 tests/LargeAssetTest/Android.mk create mode 100644 tests/LargeAssetTest/AndroidManifest.xml create mode 100644 tests/LargeAssetTest/assets/million-ints create mode 100644 tests/LargeAssetTest/res/layout/lat.xml create mode 100644 tests/LargeAssetTest/res/values/strings.xml create mode 100644 tests/LargeAssetTest/src/com/android/largeassettest/LargeAssetTest.java (limited to 'tests/LargeAssetTest') diff --git a/tests/LargeAssetTest/Android.mk b/tests/LargeAssetTest/Android.mk new file mode 100644 index 000000000000..cb7f01be8b40 --- /dev/null +++ b/tests/LargeAssetTest/Android.mk @@ -0,0 +1,11 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES := $(call all-subdir-java-files) + +LOCAL_PACKAGE_NAME := LargeAssetTest +LOCAL_CERTIFICATE := platform + +include $(BUILD_PACKAGE) diff --git a/tests/LargeAssetTest/AndroidManifest.xml b/tests/LargeAssetTest/AndroidManifest.xml new file mode 100644 index 000000000000..c86118e492e5 --- /dev/null +++ b/tests/LargeAssetTest/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + diff --git a/tests/LargeAssetTest/assets/million-ints b/tests/LargeAssetTest/assets/million-ints new file mode 100644 index 000000000000..0607de1b7667 Binary files /dev/null and b/tests/LargeAssetTest/assets/million-ints differ diff --git a/tests/LargeAssetTest/res/layout/lat.xml b/tests/LargeAssetTest/res/layout/lat.xml new file mode 100644 index 000000000000..eda7b82e91fa --- /dev/null +++ b/tests/LargeAssetTest/res/layout/lat.xml @@ -0,0 +1,52 @@ + + + + + + + + + +