android-screen

How to find the device as LDPI MDPI HDPI or XHDPI [duplicate]

你说的曾经没有我的故事 提交于 2019-11-28 05:54:05
This question already has an answer here: How to check an Android device is HDPI screen or MDPI screen? 6 answers Without any code snippet for the application, how to get screen resolution and length of the screen. How could I find whether the device is ldpi, mdpi , hdpi or xhdpi ? Pragnani Edit: use DisplayMetrics to get the density of the screen getResources().getDisplayMetrics().densityDpi; this will return the int value that represents the following constants. DisplayMetrics.DENSITY_LOW ,DisplayMetrics.DENSITY_MEDIUM, DisplayMetrics.DENSITY_HIGH, DisplayMetrics.DENSITY_XHIGH int density=

How to disable power button?

夙愿已清 提交于 2019-11-27 23:49:47
Is it possible to override the functionality of the android power button ? I want to 'disable' the power button. My plan is to override the functionality of this button to do nothing ( {}; ) Well my main idea is to disable the turning the screen off. I want when someone press the power button nothing to happen. How can I do this ? Is it possible to override the functionality of the android power button ? I want to 'disable' the power button. Fortunately, this is not possible, except perhaps via custom firmware. It works on Cyanogenmod: http://review.cyanogenmod.com/#/c/18924/4/core/res

Android : App support for multiple tablet screen resolutions

那年仲夏 提交于 2019-11-27 18:36:56
I just ran my Android application on Galaxy Tab Emulator, where the design looks distracted. Now my worry is how to make the app fit perfectly on all the Tablet Screens. Since I came acrosss diffrent screen resolutions for Android Tablets. For example: Samsung Galaxy Tab 10.1 3G - 10.1 inches, 1280 x 800 pixels Samsung P1000 Galaxy Tab - 7.0 inches, 600 x 1024 pixels Dell Streak 7 - 7-inch 800×480 Motorola Xoom - 10.1-inch, 1280×800 Viewsonic G - 10.1-inchs 1024×600 For small, medium, large .. screens Android provides specific layout and drawable folders. For tablets xhdpi and xlarge has been

Android: Disable application for tablet

做~自己de王妃 提交于 2019-11-27 11:36:18
I developed an application, Now i want to restrict the application for tablet. Means the application should not run on any tablets. For that I specify the support-screens in Androidmenifest.XML file as: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.abc.xyz" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="17" android:maxSdkVersion="17" /> <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="false" android:xlargeScreens="false" android:resizeable="true

Lock Android phone application to Portrait mode

夙愿已清 提交于 2019-11-27 10:12:38
问题 Can someone tell me how to lock my application to a portrait mode? Is it a simple configuration in the manifest file? 回答1: Yes. Add android:screenOrientation="portrait" to the manifest under your main activity. <activity android:name=".yourActivity" android:screenOrientation="portrait"... /> 回答2: Yes! It's an attribute of the activity tag: <activity android:name=".yourActivity" android:screenOrientation="portrait" ... /> 回答3: Also, you may have to add the following to your activity element:

samsung note 2 and note 3 screen bucket

我的梦境 提交于 2019-11-27 07:07:45
问题 What screen bucket do the Samsung Note 2 and Note 3 report? "Normal" or "Large"? Here are stats on the two phones: Model Dimensions Density Density Bucket DP Dimensions note2 720px x 1280px 265dpi hdpi 480dp x 853dp note3 1080px x 1920px 386dpi xhdpi 540dp x 960dp This post from Diane Hackborn: http://android-developers.blogspot.com/2011/07/new-tools-for-managing-screen-sizes.html ...says that "large" screens are at least 480dp x 640dp, so both these phones would qualify. What I'd like to

Android resource notlong / long identifiers not working

最后都变了- 提交于 2019-11-27 02:56:35
问题 Currently I have the following resource folders: 1. layout-sw600dp 2. layout-sw600dp-notlong The idea is that we have 3 types of devices and the devices should use the resources from the correct folder accordingly. The devices are: 1. Samsung Galaxy Tab 10.1, 1280 X 800 mdpi. 16/10 2. Asus Transformer TFT 101, 1280 X 800 mdpi. 16/10. 3. A generic tablet, 800 X 600 ldpi. 4/3. The problem is that all 3 devices use resources from layout-sw600dp-notlong. To my understanding 4/3 is categorized as

Android: Showing wrong screen resolution

笑着哭i 提交于 2019-11-27 02:05:39
I was trying to get the screen resolution of android phones,using this code DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); str_ScreenSize = dm.widthPixels + " x " + dm.heightPixels; str_ScreenSize = "dd" + " x " + dm.heightPixels; When i tried this code in my Galaxy S phone i got the screen resolution as 320x533 px, but in reality the Galaxy S got a screen resolution of 480x800 px. So what's wrong with the code?? How can i get the actual screen resolution of a particular device?? Finally after 2 days of searching and testing, i finally managed

How to find the device as LDPI MDPI HDPI or XHDPI [duplicate]

和自甴很熟 提交于 2019-11-27 01:07:00
问题 This question already has an answer here: How to check an Android device is HDPI screen or MDPI screen? 6 answers Without any code snippet for the application, how to get screen resolution and length of the screen. How could I find whether the device is ldpi, mdpi , hdpi or xhdpi ? 回答1: Edit: use DisplayMetrics to get the density of the screen getResources().getDisplayMetrics().densityDpi; this will return the int value that represents the following constants. DisplayMetrics.DENSITY_LOW

How to disable power button?

≯℡__Kan透↙ 提交于 2019-11-26 21:34:59
问题 Is it possible to override the functionality of the android power button ? I want to 'disable' the power button. My plan is to override the functionality of this button to do nothing ( {}; ) Well my main idea is to disable the turning the screen off. I want when someone press the power button nothing to happen. How can I do this ? 回答1: Is it possible to override the functionality of the android power button ? I want to 'disable' the power button. Fortunately, this is not possible, except