Small white Android Note (written by Mr.bubbles)

Source: Internet
Author: User

Small white Android Note

Written by Mr.bubbles

Today, the invasion of Android, a few days after the baptism is also a burn, the summary of the study of the point of experience to share the following, if there are errors please forgive and point out.

    1. The first thing to configure JDK Eclispe is not to say much.
    2. Eclispe is mainly used in XML and Java two languages, XML processing presentation layer, is the ability to layout a page, add elements, is to implement the UI and the different UI of the surface of the foundation, that is, no logical consideration.

Java is a concrete logical design, so each XML corresponds to a controlled Java file.

  1. XML language is the description and nesting of elements, labeled elements, property syntax <element property= "(what is it should be)", End </element> and/> Play the same role. At compile time, when the element is edited, the direct typing > will automatically get ></element>, which is very convenient and practical, and straightforward and easy to understand.
  2. Start by building a basic single UI from the XML language, and familiarize yourself with XML from a linear layout (LinearLayout) relative layout (relativelayout). (These two are viewgroup subclasses, inheriting ViewGroup)
  3. The name of the label should not be wrong, the compiler will not prompt, but also remember the first time the Slidingdrawer written slidingdawer is not prompted, run to the device will directly stop running. Slidingdrawer is a cool drawer that can be used for sliding menus and unfamiliar words to do in graphical layout.
  4. The object of the view class is used to display UI elements, and the ViewGroup class (which is a subclass of the view) is used to display nested objects, can contain other ViewGroup objects and view objects, and the View object does not.
  5. Add <activity></activity> tags to the android manifest to increase activity operations, Whenever you add a page layout XML and control files to Java, remember to add activity to the manifest.

    <intent-filter>

    <action android:name="Android.intent.action.MAIN" />

    <category android:name="Android.intent.category.LAUNCHER" />

    </intent-filter> is used to set the main activity.

  6. Android:layout_height,android:layout_width is the layout size that affects the actual size of the UI element, and if it is the same as match_parent and Fill_parent, fills the parent container; Wrap_content, Wrap the contents so that the setting is the same size and setting.
  7. R.java can be understood as a resource dictionary, does not modify!
  8. The way to assign IDs in XML is android:id= "@+id/ok"

By calling the Findviewbyid (r.id. Identifier) method in the activity to get the XML-defined component in the Java control file, Java uses the @id/identifier.

To be Continued ...

Small white Android Note (written by Mr.bubbles)

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.