Res/raw and asserts
The same point: the package will remain intact in the apk and will not be compiled into binary.
Differences: Files in Res/raw will be mapped to R.java, asserts will not be able to read the directory structure under Res/raw, asserts can.
READ: Res/raw using InputStream input = Getresources (). Openrawresource (int resId);
Asserts uses InputStream input = Getasserts (). Open (String fileName);
Getwritabledatabase () and Getreadabledatabase ()
Both can obtain a sqlitedatabase instance that is used to manipulate the database.
Getwritabledatabase () Opens the database in read-write mode, and when the database disk space is full, the failure is turned on.
Getreadabledatabase () executes Getwritabledatabase () first, and when open fails it continues to attempt to open the database as read-only.
Code Mode setting Activity
No title bar: Call Requestwindowfeature (Window.feature_no_title) before Setcontentview ();
Custom title bar: Requestwindowfeature (window.feature_custom_title);
GetWindow (). Setfeatureint (Window.feature_custom_title, R.layout.title_bar custom title bar layout);
Fullscreen: GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, previous parameter);
ANR (Application not Responding) program is unresponsive
By default, the maximum execution time for an activity is 5 seconds, and the broadcastreceiver maximum execution time is 10 seconds.
Avoidance scenario: The main thread does as little as possible. Potentially time-consuming operations, such as network or database operations, or high-time calculations such as changing the bitmap size, should be done in a child thread.