Release date: Author: Android Development Network original
Android software generally processes large resources and downloads resources to sdcard through sdcard, for example, online. The following two methods are generally used for Embedded resources or binary files in APK:
Method 1
Stored in the Res/raw directory. For example, a binary file of cwj. Dat can be read directly.
Inputstream is = context. getresources (). openrawresource (R. Raw. cwj );
Method 2
The assets folder in the root directory of the project, for example, assets/cwj. dat. The following code is used:
Assetmanager AM = context. getassets (); <br/> inputstream is = aM. Open (cwj. dat );
Here, android123 prompts you that there is a bug in Google's Android system processing assert. In assertmanager, you cannot process a single file larger than 1 MB. Otherwise, an exception is reported. You can test and upload a slightly larger file, we mentioned in our article two years ago that the first raw file can be 4 MB without this limit.