Android course Summary (II): android Course

Source: Internet
Author: User

Android course Summary (II): android Course

1. The resource file name can only be in lower case. Otherwise, an error will be reported and the R. java file cannot be generated.

2. When importing the R file package, you should import your own project package, instead of android. R.

3. Use SqliteOpenHelper for database operations

4. customize an xml file in the values directory. The obtained method is R. _ the horizontal line is determined by the child nodes in the Custom XML. For example, <String/> is R. string

5. In Eclipse, CTRL + SHIFT + X and CTRL + SHIFT + Y are case-insensitive conversions.

6. Use the <View> label with a height of 1 DP to split the line.

7. When one Fragment is superimposed on another Fragment, event penetration may exist. Set the clickable = "true" of the Fragment above.

8. ImageButton sets background = "#00000000" to transparent, and sets the background to be as beautiful as the image background. ImageButton needs to set clickable = "true"

9. ConnctivityManager. Connectivity_ACTION is used to monitor network status changes. Check whether the API description is added after listening to all networks.

WifiManager. NETWORK_STATE_CHANGED_ACTION listens to wi-fi network changes, including enabling and disabling

WifiManager. WIFI_STATE_CHANGED_ACTION is used to listen for Wi-Fi status changes, including enabled, enabled, disabled, and disabled

10. if no Nesting is required, for example, if you use FrameLayout to create a single root node for layout, you can use the <merge> label to replace the <FrameLayou> label, when a layout with a merge label is added to another layout, the merge node of the layout is deleted, and the Child View of the layout is directly added to the new parent layout, merge labels are especially useful when used together with include tags. include tags are used to insert content from one layout to another.

11. ViewStub is a hidden view object that does not occupy memory space. It can load layout resource files at runtime delay. The layout resource file is loaded only when ViewStub is visible or the inflate () function is called.

12. The previous blog will be supplemented after the respective activities and Fragment and their combined lifecycles

13. After adding, deleting, and replacing Fragment, you can specify its animation, select whether to add it to the back stack as needed, and finally commit ()

14. You can use "|" to add multiple parameters when you need to input parameters, for example, as a flag.

15. after creating a class that inherits the Application, you can process the lifecycle function of the entire Application. For example, you can enable the database when the entire Application starts, the database is closed only when the application process is terminated. However, you must specify the name attribute for the application node in the Manifest configuration file. The value is your class name.

16. To register another broadcast receiver in a broadcast receiver, use context. getApplicationContext (). registerReceiver to solve the ReceiverCallNotAllowedException exception.

17. when we receive an intent, if we want to modify the data of the intent and then send it out, then the subsequent receiver cannot receive the intent, because intent cannot be reused by default, the data will be filtered out. You can use flag to identify different modes for reuse.

18. You can use ComponentName and RemoteViews to update the desktop plug-in view.

19. The terminate function in the Application may not be called. If it is not disabled by the called database, an error will be reported during Reinstallation, but it will not be prompted to the user and will only be recorded in the log.

20. currently, I have encountered a problem. When I add another fragment in a container that already has a fragment, the latter will not display and can only use replace, at the same time, the implementation principle of the popBackStack function also needs to be learned.

21.use .9.png

22. The installLocation attribute can be used in the Manifest file to specify whether to allow or preferred to install the application to external storage (the user cannot reject or retrieve the SDK, otherwise the application will be terminated immediately)
Not applicable to: Applications with widgets, Live Wallpaper, and Live Folder
Applications that provide uninterrupted services
Input Method engine IME
Device Manager


Gu Jian 2 course 2 switch course 1






How can I view the code During Android learning? How can I trace the code from scratch and check whether there is any function? Under the guidance of hero

Because Android runs on the simulator, it is useless to set the breakpoint. to track the code, you can use log. d ().
In the body of the method to be tracked, this method is called. This method has two reloads. Generally, the one that receives two parameters can be understood as a tag, the first parameter is the tag name, the second parameter is the TAG content, and both are strings. For example, log. d ("onCreate ----------------------", "onCreate stage of Activity"); then you can see the output result in Log Cat.
 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.