Learn about largest android tablet screen size, we have the largest and most updated largest android tablet screen size information on alibabacloud.com
Android in the custom control, often need to get the width of the screen height, every time to write, you can directly encapsulate him as a tool class, directly to use, nonsense, not to say, directly on the code/** * */package com.example.customview;import android.content.context;import android.util.DisplayMetrics; Import android.view.windowmanager;/** * Get phone scre
Use android to extract a long image that exceeds the screen size
Try everything, just stay at the level of imagination, that is also equivalent to waste of time, do not take it for granted
First look at the requirements:
When the content is beyond the display range of the mobile phone, you must intercept all the content to generate the so-called "length ".
There
Android-based long screenshots with content beyond the screen size
Try everything, just stay at the level of imagination, that is also equivalent to waste of time, do not take it for granted
First look at the requirements:
When the content is beyond the display range of the mobile phone, you must intercept all the content to generate the so-called "length ".
The
Get screen Size
Get through WindowManager
Displaymetrics dm = new Displaymetrics ();
Getwindowmanager (). Getdefaultdisplay (). Getmetrics (DM);
where display = Getwindowmanager () Getdefaultdisplay () obtains a Defaultdisplay object; Then Display.getmetrics (DM) to the screen size information assigned to di
A lot of times, we want to share all the content of an interface, but too much content, more than the size of the screen, simple screenshot has not satisfied our needs, this time we can according to the layout of scrollview height to intercept the picture.The code is as follows:/** * Intercept ScrollView's screen * @param scrollView * @return */public static Bitm
have not Installed VMware Tools, right-click it and select install VMware Tools. Select install to download the VMware Tools installation package.
See: http://blog.csdn.net/sunboy_2050/article/details/5370878
Modify the Ubuntu screen size:
Press and modify it by yourself:
Add shortcuts to the sidebar:
Open Ubuntu Software Center and install Main Menu:
Open Main Menu:
Select "new item", "Name: Eclipse"
Official API:A structure describing general information on a display, such as its size, density, and font scaling.To access the Displaymetrics members, initialize a object like this:displaymetrics=newdisplaymetrics();Getwindowmanager(). Getdefaultdisplay(). Getmetrics(metrics); Application Examples:WindowManager WindowManager = (windowmanager) getsystemservice (Context.window_service);Displaymetrics displaymetrics = new Displaymetrics ();Window
Formula: screen size = pixel value on the diagonal line of the screen/(density * 160) =/(density * 160)
// Screen sizeDouble screensize;// Pixel value of the diagonal line of the screenDouble diagonal;Displaymetrics dm = new displaymetrics ();Manager. getdefadisplay display (). getmetrics (DM );
Diagonal = math. SQ
to Android: screenorientation = "Landscape ".For example, (landscape is horizontal and portrait is vertical ):
Java code:
In additionScreenThe switch will restart the activity, so you should save the status of the current activity before the activity is destroyed, and load the configuration when the activity is created again, so that the ongoing game will not automatically restart!
Some programs are suitable for switching from a portrait
Adapt to different Android phone screen sizes
240*320
320*480
480*800
480*854
540*960
800*1200
800*1280
Public static int adjustfontsize (INT screenwidth, int screenheight) {
This example describes how Android uses service and activity to get screen sizes. Share to everyone for your reference. The implementation methods are as follows:
1. Activity:
Displaymetrics dm = new Displaymetrics ();
This.getwindowmanager (). Getdefaultdisplay (). Getmetrics (DM);
SW = Dm.widthpixels;
SH = Dm.heightpixels;
2. Service:
Displaymetrics dm = new Displaymetrics ();
DM = Getreso
let's look at the following layout:, the button is half the size of the screen, then centered in the center of the layout, everyone has their own answers, see my method, Layout layout XML is as follows:Here are a few key points:
The layout is linearlayout so that the layout_weight can be set;
Set the value of the LinearLayout android:weightsum to 1;
Set the button's layout_width to 0DP;
(1) resolution lists of common models are as follows:
Model width and height
Wxga800480x800
Wvga854480X854
Wxga720720x1280
Wqvga400240x400
Wsvga1024x600
Wvga800480x800
Qvga320x240
Wqvga432240x432
Hvga480x320
(2) Simulator Test-scale adjustment
Set"Screen size (in)"Smaller, the simulator also scales down. [The last length and width of the simulator is its original width and high r
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.