screen-size

Program different layouts for different versions in android

六月ゝ 毕业季﹏ 提交于 2019-11-29 06:53:30
I have to program my Android app with the best compatibility to different screen sizes (tablets and smartphones) and to the versions 2.3, 3.2 and 4.0. I know about the possibliy to name the folders of the layout like res/layout-sw600dp/. to match the layout exactly to different screen sizes. So, cause I will use completely different layouts for Tablets / Smartphones , I would start with a "Load Screen", which tests which Android-version is used and if there is used a tablet-or smartphone-device, cause for example in the layout for the Tablet, there will be Buttons on some screens that won't be

WP8 Emulator screen size

好久不见. 提交于 2019-11-29 05:03:32
I have migrate my WP7 application to WP8 platform. Now, if I start debugging my application in WXGA Emulator (screen size should be 768 × 1280). I have got Host.Content.ActualWidth=480 and Host.Content.ActualHeight=800 . Is it normal behaviour? Why WXGA emulator have screen size 480x800? Yeah, that's how WP8 should work. The zen of WP8 multi-resolution is to make developers to do as little work as possible to account for different resolutions. Other platforms dump all the hard work on developers to use physical pixels for different resolutions. Instead WP8 uses logical pixels of 480x800 and

iOS get physical screen size programmatically?

余生颓废 提交于 2019-11-28 22:29:24
Is this possible? I want the number of inches, not the number of pixels. I know it is approximately 160 ppi. But not exactly. If it were available it would be in UIScreen or UIDevice but it is not there. You can infer it from info in Erica's UIDevice-extension and the specs for each device listed here on Wikipedia . There isn't an API that will give you this. Your best bet is to look at the device's screen size (in points) and from that surmise if it's an iPad or iPhone etc., and then use hard-coded values for the screen sizes. Here's some code to get the screen size: CGRect screenRect = [

Most popular screen sizes/resolutions on Android phones [closed]

别等时光非礼了梦想. 提交于 2019-11-28 14:56:08
I understand that Android's developer site provides information on this topic. I have already read the following three pages: Supporting Multiple Screens Screen Sizes and Densites Icon Design Guidelines They do not give the information/statistics that I am looking for. Judging from the second link, the two most important screen categories to support are normal-hdpi and normal-mdpi . The problem is that simply knowing that these two categories are the most popular is of no help to me. The website gives me a range of screen sizes and densities that go into these categories, but the ranges are

Can’t use android:xlargeScreens=“true”?

主宰稳场 提交于 2019-11-28 13:18:25
I am making app for phones, but I wan’t them to be usable on tablets. I don’t know why can’t. I use this in my android manifest file: android:xlargeScreens="true" I get this error: error: No resource identifier found for attribute 'xlargeScreens' in package 'android' This is my manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="cro.perger.bonbon" android:versionCode="5" android:versionName="1.4"> <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" /> <application android:icon="@drawable/icon" android

Android Changing image size depending on Screen Size?

天涯浪子 提交于 2019-11-28 10:13:42
So I need to change the size of an image depending on the area of the screen. The image will have to be half of the screen height, because otherwise it overlaps some text. So Height= 1/2 Screen Height. Width = Height*Aspect Ratio (Just trying to keep the aspect ratio the same) I found something that was: Display myDisplay = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); int width =myDisplay.getWidth(); int height=myDisplay.getHeight(); But how would I change image height in java? or even XML if possible? I can't seem to find a working answer. You can do this

How to get the screen size of the device?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 07:04:41
The desire have 480 x 800 pixels, 3.7 inches and the HD have 480 x 800 pixels, 4.3 inches screen specification. I run the code that is accepted as answer from this thread How to get screen size of device? but it is wrong !, for example for screen size of 3.7 inches returns 2.4 which is very wrong ! Does anybody know how to get the real screen size ?, I do not need the resolution I need the screen size of the screen in inches. NOTE: this code is wrong (at lest doesn't work for me) DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); int width = dm

Program different layouts for different versions in android

喜夏-厌秋 提交于 2019-11-28 00:24:56
问题 I have to program my Android app with the best compatibility to different screen sizes (tablets and smartphones) and to the versions 2.3, 3.2 and 4.0. I know about the possibliy to name the folders of the layout like res/layout-sw600dp/. to match the layout exactly to different screen sizes. So, cause I will use completely different layouts for Tablets / Smartphones , I would start with a "Load Screen", which tests which Android-version is used and if there is used a tablet-or smartphone

WP8 Emulator screen size

和自甴很熟 提交于 2019-11-27 18:48:33
问题 I have migrate my WP7 application to WP8 platform. Now, if I start debugging my application in WXGA Emulator (screen size should be 768 × 1280). I have got Host.Content.ActualWidth=480 and Host.Content.ActualHeight=800 . Is it normal behaviour? Why WXGA emulator have screen size 480x800? 回答1: Yeah, that's how WP8 should work. The zen of WP8 multi-resolution is to make developers to do as little work as possible to account for different resolutions. Other platforms dump all the hard work on

Difference between “screen size” and “screen density” in Android?

不问归期 提交于 2019-11-27 18:11:19
I have a few questions: What is the screen size ? What is the screen density ? What is a difference between screen size and screen density ? How I can support different densities and different screen sizes in Android? I have already read the official documentation , but I was unable to understand the difference between screen size and screen density . Screen density means how many pixels appear within a constant area of the display, dots per inch = dpi Screen size means amount of physical space available for displaying an interface, screen's diagonal, inch Screen resolution means number of