Class notes (some knowledge scatter points) but useful (* ^__ ^ *)

Source: Internet
Author: User

During Android development, constants in Java code are usually defined in the string. xml file. It is easy to modify and internationalized.

The value of string. XML is mapped to the r file, so we can see that all the r files are defined as int type, just like an address guide.

There are several differences in getting the values in the string. xml file.

1. in XML files such as androidmanifest. xml and layout:

01. Android: text = "@ string/resource_name"
2. In activity:

01. Method 1: This. getstring (R. String. resource_name );
02. Method 2: getresources (). getstring (R. String. resource_name );
3. In other java files (context or pplication is required)

01. Context. getstring (R. String. resource_name );
02. application. getstring (R. String. resource_name );


I. Set in the Java file:
// 1. Full Screen
// Full screen with title
This. getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen,
Windowmanager. layoutparams. flag_fullscreen );
// 2. Remove the title bar
// Full screen without title
This. requestwindowfeature (window. feature_no_title );
// Load the layout after the title bar and other settings are completed !!!!!!!!!!! It does not matter for full screen
Setcontentview (R. layout. Main );

<Activity
Add:
Android: screenorientation = "Landscape" // landscape Screen
Android: theme = "@ Android: style/theme. notitlebar. fullscreen" // remove the status bar and title bar.

II. 1. Remove the title bar in the project description file of the application (in the activity attribute:
Android: theme = "@ Android: style/theme. notitlebar"
2. Set the translucent style in the project description file of the application (in the activity attribute:
Android: theme = "@ Android: style/theme. translucent"
3. Set the application icon in the project description file of the application (search in the activity first, and search in the application if not ))
Application Android: icon = "@ drawable/icon_name"

Process: The program being executed
Checkedtextview: this class is useful.

// Set the progress bar to the title bar and place it in front of the layout file. For example:
This. requestwindowfeature (window. feature_progress );

Setcontentview (R. layout. Main );
Animation eg:
Mswitcher. setinanimation (animationutils. loadanimation (this,
Android. R. anim. fade_in); // enter
Mswitcher. setoutanimation (animationutils. loadanimation (this,
Android. R. anim. fade_out); // exit

Static:
In a class: a static member variable is called a class variable. Eg: Private Static ing a = 0; called by class name. The general member variable uses the new object. A member variable that is not added is called by reference.
MVC mode: (Model View Control)

Conversion:
Byte/100 0000 = MB
Byte/1000 = KB
Gui: graphical user interface)
Uri: Uniform Resource Identifier (Uniform Resource Identifier)
API: application program interface)
Aidl (Android Interface Definition Language) is an IDL Language used to generate code for inter-process communication (IPC) between two processes on the Android device. If you want to call operations on objects in another process (such as service) in a process (such as activity), you can use aidl to generate serializable parameters.

 

Common commands (CMD)
Open and run: Window + R (shotcut key)
Ls: Display directory (excluding hidden files)
Ls-L: displays file details in the form of a list (excluding hidden files)
Ls-A: displays hidden files in the form of a list.
Ls-AL: displays the file details (including hidden files) in the form of a list)
PWD (position work directory): displays the current working directory
CD... return to the upper-level CD space... press ENTER
Exit: Exit
// Decimalformat is used to format decimal numbers.
Eg:
Decimalformat myformat = new decimalformat ("0.00 MB"); // you can add the unit and number of digits after the decimal point.
Strsize = myformat. Format (New Double (size/10000/100 ));
Small star style of checkbox (check box): Style = "? Android: ATTR/starstyle"

Androidsupports ipv.mp3,.wav,. Mid
There is one in the View: invalidate (); // redraw

Custom intent (string action), and action is custom action
Will be submitted to the framework layer, and the framework layer will find the activity you want to start

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.