=================================== displaymetrics (222) (8509): screenWidthDip=320; screenheightdip=533
e/== myscreenactivity =================================== displaymetrics (222) (8509): screenWidth=480; screenheight=800
Analysis Results:
In the OnDraw () method
Methods 1 and 2, the results are consistent, are 320*533, is obviously not the test machine i9000 screen size
Method 3, will be the results of methods 1 and 2, multiplied by densi
The screen length obtained in android is longer than the width. According to the code on the Internet, the result is inconsistent with the actual value. For example, if my mobile phone is i9000 and the screen size is 480 * 800px, the result is 320*533.The results were unreliable, so I wrote a few lines of code to test it.Test parameters:Test environment: i9000 (S
The general method for devices of different Android versions to correctly obtain the screen resolution when talking about the android screen resolution, we all know, but how to correctly obtain the screen resolution? Does android2.2 \ 2.3 \ 4.0 \ 4.1 use the same method? The
(Activityinfo.screen_orientation_landscape)Third, intercept the configuration file required for screen switching: onconfigurationchangedThe activity will recall the onpause->onstop-> Ondestory->oncreate->onstart->onresume (for this content and data to be saved and read) each time the screen toggles. Otherwise the content will disappear before the screen is turne
the intermediary medium when casting the screenHow to put your iphone on a computeriOS is a mobile operating system developed by Apple Inc. Apple first unveiled the system at the Macworld Conference on January 9, 2007, originally designed for the iphone, and later applied to products such as ipod Touch, ipad and Apple TV. iOS, like Apple's Mac OS X operating system, belongs to the Unix-like commercial operating system. The way the iphone is dropped
For an Android mobile app, a nice and concise interface is very important, which not only improves the user experience, but also ensures the efficient execution of the app. The android SDK has provided us with a complete set of interface design functions, with a wide range of components for our use. If we still cannot meet our interface requirements, we can also expand them. To achieve this goal, we need to
In android, image adaptation is a tricky task. This article details the principle of screen display, why does it exist in resource files?
Drawable-ldpi, drawable-mdpi, drawable-hdpi, drawable-xhdpi, and other folders. Why do we use dp as the unit.
Start with the display effect of the two images.
The system will generate drawable-ldpi, drawable-mdpi, drawable-hdpi,
Drawable-xhdpi and drawable-xxhdpi. For th
Articles that have been found for a long time
From: http://archive.cnblogs.com/a/2265135/
First: viewflipper + gesturedetector;
Second, rewrite the viewgroup to manage the view;
Third: Use the viewpager that comes with the system.
As for the first method, many people just talk about the idea: Use viewswitcher and add the animation effect.
For more information about the second method, see http://marshal.easymorse.com/archives/3828. here I have posted the following:
The above is the result of d
modeAndroid:theme= "@android: Style/theme.notitlebar" does not display the application title barAndroid:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and full screenAndroid:theme= "Theme.light" background is whiteAndroid:theme= "Theme.Light.NoTitleBar" white background with no title barAndroid:theme= "Theme.Light.NoTitleBar.Fullscreen" white background, no
obviously not the size of the i9000 screen of the test machine.
Method 3: multiply the results obtained from methods 1 and 2 by the density, and then the perfect 480*800, perfect!
Note:If the density is greater than 1, you must set the targetSdkVersion to 4-9. For example:
However, does this mean that method 3 must be generic?
The answer is no, because I also tested it on the simulator, HTC G14 physical machine, ViewSonic, and Galaxy
modeAndroid:theme= "@android: Style/theme.notitlebar" does not display the application title barAndroid:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and full screenAndroid:theme= "Theme.light" background is whiteAndroid:theme= "Theme.Light.NoTitleBar" white background with no title barAndroid:theme= "Theme.Light.NoTitleBar.Fullscreen" white background, no
The Qt for Android program disables screen rotation. qtandroid
Sometimes we want to keep the interface of a program in one direction and not change with the orientation of the mobile phone (tablet): Add in every Activity configuration in AndroidManifest. xml that needs to be switched off
android:screenOrientation=”landscape”
Attribute.
Landscape = landscape
Portr
(Window.feature_no_title);
Attached:Android system comes with styleAndroid:theme= "@android: Style/theme.dialog" displays an activity as a dialog box modeAndroid:theme= "@android: Style/theme.notitlebar" does not display the application title barAndroid:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and full
backgroundAndroid:theme= "Theme.Wallpaper.NoTitleBar"//using the system desktop as the application background with no title barAndroid:theme= "Theme.Wallpaper.NoTitleBar.Fullscreen"//Use System desktop for application background, no title bar, fullscreenAndroid:theme= "theme.translucent"//Transparent BackgroundAndroid:theme= "Theme.Translucent.NoTitleBar"//Transparent background with no captionAndroid:theme= "Theme.Translucent.NoTitleBar.Fullscreen"//Transparent background with no caption, full
When developing apps (game programs) on an Android tablet with an 8-inch screen, the app cannot be displayed in full screen or configured in the first place.
Originally, the LCD should be 800*600, but always get the result of 600*600.
The modification code is as follows:
Layout file:
xmlversion="1.0"encodin
Share the small loop function of the desktop sliding between left and right in one of my implemented source code:
One of the major functions of Launch2 in Android's native code is to support sliding between the left and right, but it seems that it does not support circular sliding. It seems easy to think about at first, that is, when obtaining the screen number
The remainder can be achieved, but in fact there will be a lot of misleading information in
Download address (source code and complete Project project): http://loon-simple.googlecode.com/files/barrage%2Bslg.7z
There has been a period of time did not update the blog, so the younger brother deliberately prepared two games samples issued.
1. Example of the bomb screen:
This is a very simple example of the play screen game, using touch-
/birthday_width_provider.xml and the contents are as follows.Appwidget-provider Xmlns:android= "Http://schemas.android.com/apk/res/android"Android:minwidth= "150DP"Android:minheight= "120DP"Android:updateperiodmillis= "43200000"Android:initiallayout= "@layout/birday_widget"android:configure= "Cn.wei.flowingflying.testwidget.ConfigBirthDayWidgetActivity"Android:previewimage= "@drawable/gift"Android:resizemode= "Horizontal|vertical" >In the widget list,
The Android phone or tablet will have the ability to switch on and off, usually by physical gravity sensors, but sometimes it's not, and it's usually in the setup that we can turn off the screen switch on the phone.
Androidmanifest.xml
Activity_main.xml
Mainactivity.java
Package com.example.yanlei.yl7;
Import android.content.res.Confi
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.