03 March 2009
Android layout tricks #3: optimize by merging
In the previous installmentAndroid layout tricks, I showed youHow to UseTag in XML layout to reuse and share your layout code. I also mentionedAnd it's now time to learn how to use it.
TheWas created for the purpose of optimizing Android layouts by grouping the number of levels in view trees. it's easier
0, Common Properties first let's look at some of the common properties of the GridView
The number of columns for the 1.android:numcolumns= "Auto_fit"//gridview is set to Automatic 2.android:columnwidth= "90DP"//width of each column, which is the width of item, 3. Android:stretchmode= "columnWidth"//Zoom and column width size sync 4.android:verticalspacing= "10DP"//two margin between lines 5.android: horizontalspacing= the margin between "10D
, waiting for you to pass in a layout file, simply drag an XML into the bat file from the layout folder in your Eclipse project, and press ENTER to do so, then you will seeAs shown, your butterknife's notation has been generated, and already in your sticky board, and so what, to find the corresponding ACTIVITY,CTRL+V bar!!!Below is my Ctrl + V-OH:@InjectView (R.ID.LOC_BTN)Button loc_btn;@InjectView (R.id.loc_info)TextView Loc_info;Iv. SummaryIn fact, this gadget has no technical difficulties, th
Environment: Ubuntu 12.04 + Android Studio 1.0 + JDKJDK using Sun's JDK, there are more tutorials on the web to teach how to configure, Android studio to download from the Android website, the reason for the great Chinese wall, what the problem everyone understand, the SDK download will still automatically download some content, you can choose to set the image do
Mobile terminals use rem to adapt to Android ios Mobile Phone principles, mobile responsive development, and Android ios
People may already be familiar with the rem unit. rem is a method that shows the width with the html font size. How can we develop the mobile terminal response?
The default font size of the browser is 16 PX and 1rem is 16 PX.
If we want to make
Use of SeekBar and RateBar for Android-android learning Tour)SeekBar Introduction
SeekBar allows you to drag and adjust the volume.Android: thumb sets the drawable object to represent the dragged object.SetOnSeekBarChangeListener () changes the SeekBar.Sample Code
package peng.liu.test;import android.app.Activity;import android.os.Bundle;import android.view.Menu;
Use the signature mechanism for program self-check-Android anti-cracking and self-check android
Self-check program written in so
Main Code
Import in File Header
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)#include
Then write Java in cpp to call the c interface
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)extern "C"{JNIEXPORT jint JNICALL Java_org_cocos2d
need to close the soft keyboard to get at and Interac T with obscured parts of the window.
This attribute is introduced in API level 3.
Introduced in:
API level 1 for all attributes except for
noHistoryand
windowSoftInputMode, which were added in API level 3.
====================================================================================
Ouyangpeng Welcome reprint. Sharing with others is the source of progress!
Reprint please
1. Introduce
When making Android apps, there are a lot of strings, some text, and here's a way to encapsulate all the strings in a String.xml file and control the size of the string by Styles.xml. In code, just call the ID of a string. This is in line with object-oriented programming ideas, but it also makes Android more adaptable to a variety of resolution phones!
2. Concrete implementation
First, we se
Use eclipse to develop Android source code
The tool chain and development tools provided by Android are relatively complete, so the development environment is relatively simple. I believe many of my friends have already set up th
How to Use Android Bluetooth (Bluetooth details) and Android bluetoothI. Communication between bluetooth devices consists of four processes.
Configure a bluetooth device to search for devices that may match in the LAN to connect to data transmission between devices.
Ii. completion of detailed programming
1. Activate Bluetooth
First, call the static method getdefa
Use Bluetooth in the Android command line and Bluetooth in the android command line
Note: This part only applies to broadcom series bluetooth chips, such as RK903 and AP6xxx Series
Switch to the root user using the su command
1. confirm that the RFKILL driver has been loaded.
Ls/sys/class/rfkill/rfkill0/
If the rfkill0 directory is not found, the Bluetooth driver
chronometer and ProgressBar to you. For more information about customizing the layout of a notification bar, refer to Remoteviews's documentation.
Note: When you use a custom notification bar, pay special attention to how your customized notification bar works in different directions and resolution devices. Of course, this recommendation is important for all view layouts. However, it is particularly important for the notification bar because the con
In a project, we may need to use the same layout design. If they are all written in an xml file, the code is redundant and the readability is poor, therefore, we can write code with the same layout into a single module, and then use the
App_title.xml:
Copy codeThe Code is as follows: Android: background = "@ drawable/bt" xmlns:
Used to use Android library to do get, post, and so on the API to connect and operate.But recently want to say look for the use of the library, should be able to do more with less.I was looking for three sets of more people.1.Android Asynchronous Http Client2.okhttpSquare developed and open source, because before using
', \
];\
} '];
Master the above 4 steps, basically in iOS end and JS interaction is completely OK.Then we start to H5 with the Android end.Here, we found a problem:The Android side JS method calls the native method, you need to specify InterfaceName, so their JS invocation is this way:
Xxname.log (' arg1 ');
The front is more out of the xxname, this way, we directly
matrix is: The verification is based on a method similar to the preceding "panning".
The rotation of the image is slightly more complex: the corresponding point after the P0 (x0, y0) rotation theta angle is P (x, y). By using vectors, we get the following:x0 = R Cosα Y0 = r sinex = R cos (α+θ) = x0 cosθ-y0 sinθ y = r sin (α+θ) = x0 sinθ+ y0 cosθ
So we get the matrix:
What if the image rotates around a point (a, b)? Then you have to translate the coordinates to that point, rotate it, and then
Hello everyone, let's briefly talk about the android status bar reminder, which will also be used frequently during development. When we plug in USB, there will be a status bar reminder, and a text message will also contain a status bar reminder.
Alertdialog can also be used if there is a reminder function in Android, but we need to review the usage, because when using alertdialog, the user's ongoing operat
Android of android Animation: Use of the interpolator attribute,
Android: interpolator for android Animation
Interpolator is used to modify the animation effect, define the animation change rate, and enable the existing animation effects such as accelerated, decelerated,
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.