Many times, the use of touch screen fling, scroll, such as gesture (gesture) operation will make the user experience of the application greatly increased, such as using scroll gestures in the browser to roll the screen, with the Fling in the reader page and so on. In Android, gesture recognition is done through the Gesturedetector.ongesturelistener interface, but
Android to get the length and width of the screen, referring to the internet there are a lot of code, but the results are not practical, such as my phone is i9000, screen size is 480*800px, the result is 320*533
The result is very unreliable, so I wrote a few lines of code, a close test
Test parameters:
Test environment: i9000 (Samsung)
Physical
Official address: http://developer.android.com/guide/practices/screens_support.htmlI. Recommendations on layout adaptation1, do not use absolute Layout 2, try to use match_parent instead of fill_parent. 3, can use the weight of the place as far as possible the use of weight (android:layout_weight) 4, if it is a solid color background, as far as possible using the shape of Android custom. 5. If you need to fit at a specific resolution, you can create a
This article describes the Android programming interface to achieve Full-screen display method. Share to everyone for your reference, specific as follows:
In the development of Android applications, we will encounter some of the interface to set up a full screen format, there are two ways to implement. One is implemen
Android obtains the screen width and height, and android obtains the control width and height.
1. Get screen width and height
Method 1:
Int screenWidth = getWindowManager (). getdefadisplay display (). getWidth (); // screen width (pixels, for example, 480px) int screenHeigh
Android split-screen display LogCat and android split-logcat
There are many interface components in Eclipse, such as file list, editing area, and class structure. There is basically no space to open a Logcat among so many interface components. It is better to split it into two windows.
Or you have two screens. You want to edit one
UI elements
As you can imagine, the Android system is doing everything in the opposite of its competitors (which is called differentiation!). Honeycomb has its own UI specification, and it now has a new "holographic UI" visual language for day-to-day operations such as choosing a time date, selecting an option, setting the volume, and so on. Understanding this UI language is critical to creating screen flo
This article illustrates how Android is programmed to get the screen resolution size of a mobile phone. Share to everyone for your reference, specific as follows:
Import android.app.Activity;
Import Android.os.Bundle;
Import Android.util.DisplayMetrics;
Import Android.widget.TextView;
public class A03activity extends activity {
private TextView mTextView01;
/** called the activity is a. * *
@Overr
Android-screen adaptation to px to dip, android adaptation to pxdip
Reprinted please indicate the source: http://blog.csdn.net/l1028386804/article/details/47356583
All the kids shoes that have been developed for Android are aware that, due to the diversity of Android mobil
Android obtains the coordinates of custom controls, screen size, title bar, Status Bar Height, and android status bar.Android obtains the coordinates of custom controls, screen size, title bar, and Status Bar Height.
1. Get the height of the custom control
Obtain the height of the control in the current Activity in thi
Android multi-screen adaptation: Part 1: android adaptation
1. In the xml layout file, the width and height of the control are dp, And the font size is sp.
2. dynamically adapt to the screen width and height to obtain the screen width and height:
Method 1:
/***
Android screen adaptationOfficial address: http://developer.android.com/guide/practices/screens_support.htmlI. Recommendations on layout adaptation1, do not use absolute Layout 2, try to use match_parent instead of fill_parent. 3, can use the weight of the place as far as possible the use of weight (android:layout_weight) 4, if it is a solid color background, as far as possible using the shape of
In Android game development, we may often have to double click on the screen like a PC operation. For screen-double-clicking, the Android 1.6 version did not provide a perfect gesture recognition class before, Android The 1.5 SDK provides Android.view.GestureDetector.OnDoubl
An example of this article describes the Android program to achieve one-click lock Screen method. Share to everyone for your reference, specific as follows:
Here are the following two classes:
Deviceadminreceiver Device Management components. This class provides an action that facilitates the interpretation of the intent emitted by the system. Your device management application must contain a deviceadminr
| StatusBarManager.DISABLE_SYSTEM_INFO| StatusBarManager.DISABLE_NAVIGATION| StatusBarManager.DISABLE_CLOCK;
Full Screen:?
Code snippet, double-click Copy
01
mStatusBarManager.disable(hideMask);
Non-full screen:?
Code snippet, double-click Copy
01
mStatusBarManager.disable(StatusBarManager.DISABLE_NONE);
The above two sentences can be used to display/
Android keeps the screen on, while android keeps on
Android keeps the screen bright, and PowerManager. WakeLock is used.
packagecom.hebaijun.wakelock;importandroid.app.Activity;importandroid.os.Bundle;importandroid.os.PowerManager;publicclassWakeLockActivityextendsActivity{P
settings, so don't assume that the Web page will always load in "Overview mode". So you should go to customize the size of the window and the scale of the page to replace it.However, when the page is loaded in the WebView control, it is the size of the original page loaded (not loaded in overview mode). Therefore, it shows the default size of the page, not the page after zooming. (This is also the question of how to display a Web page after the user disables "overview mode").
First, through the Java code
To execute before Setcontentview:
Requestwindowfeature (window.feature_no_title);//Hide title bar
GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG _fullscreen,windowmanager.layoutparams.flag_fullscreen);//Hide Status bar
Second, call the Android theme
Add directly to the activity attribute in Androidmanifest.xml that needs to be displayed in full screen
Although you could have used a Web page to start directly on the Android main screen, the Chrome V31 Beta for Android added to the main screen is a little bit improved, with a shortcut to the Web page that is in Full-screen mode without a variety of buttons. It makes you fee
Android Screen Toggle Summary (Android data)Android screen to solve the problem should be two:I. Layout issues Two. Reload the problem1. Layout problem: If you do not want the software to switch between the screen, the simplest wa
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.