screen-size

Difficulty to understand how to support multiple screen

喜你入骨 提交于 2019-12-03 13:59:15
问题 I have seen so many questions on StackOverFlow how to support multiple screens. But most of the answers provide this link and this. And in the first one link I have got this. I am working with screen sizes first time so please help me. xlarge screens are at least 960dp x 720dp large screens are at least 640dp x 480dp normal screens are at least 470dp x 320dp small screens are at least 426dp x 320dp And in case of xhdpi they suggest 320 density . I am confused so I have following questions.

How to create two views in Android that use 50% height each, unless one is smaller?

£可爱£侵袭症+ 提交于 2019-12-03 10:52:43
Imagine a full Android device screen, I want it split in to two sections: The upper half has text in it, which may be larger than the space available (or not) and so the text will scroll (i.e. TextView inside a ScrollView) The lower half contains a MapView control. Looking specifically at some scenarios: If the text is small, I want the map to take up more space, i.e. more than 50%. So perhaps 20% text, 80% map. If the text is larger, it only takes up a MAXIMUM of 50% of the screen space, and then scrolls. So 50% map, 50% text. At the moment I've assigned weights to the two parts, and that isn

how to set image width height based on screen size in gridview

我与影子孤独终老i 提交于 2019-12-03 09:06:41
问题 I want to show 3x3 sized gridview. I want to set the height and width based on device size. I am taking reference from this link. MainActivity- public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); GridView gridview = (GridView) findViewById(R.id.gridview); gridview.setAdapter(new ImageAdapter(this)); } @Override public boolean onCreateOptionsMenu(Menu menu) {

how to set image width height based on screen size in gridview

∥☆過路亽.° 提交于 2019-12-02 23:17:12
I want to show 3x3 sized gridview. I want to set the height and width based on device size. I am taking reference from this link . MainActivity- public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); GridView gridview = (GridView) findViewById(R.id.gridview); gridview.setAdapter(new ImageAdapter(this)); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } } activity_main- <?xml version="1.0" encoding

Error on running “adb shell wm density 240” for changing Android device density

狂风中的少年 提交于 2019-12-02 08:08:46
问题 I want to resize the screen on Android device. When I run the following commands: adb shell wm density 240 or adb shell wm size 800x480 I get error: /system/bin/sh: wm: not found . Why? How can I resolve that? I should mention that my device is rooted and its model is Asus transformer TF101 回答1: I changed it to: adb shell am display-size 800x480 and it worked 回答2: wm (Window Manager) is not available on Jelly Bean and older devices. for pre jelly bean use adb shell am display-density 240 or

Android Screen Size Algorithm / Pattern

不打扰是莪最后的温柔 提交于 2019-12-02 04:56:19
问题 I'm looking for an Algorithm or Pattern to calculate where objects can be placed on multiple resolutions. So far, I have got the X and Y screen size, but im not sure how to turn it into a calculation that would place something such as a drawText() at a location on the screen no matter the screen size. I was thinking perhaps using percentages might be easier to work with. I have a program that draws text to the screen at the top left corner indicating what position the screen has been touched.

Error on running “adb shell wm density 240” for changing Android device density

北城余情 提交于 2019-12-02 03:28:56
I want to resize the screen on Android device. When I run the following commands: adb shell wm density 240 or adb shell wm size 800x480 I get error: /system/bin/sh: wm: not found . Why? How can I resolve that? I should mention that my device is rooted and its model is Asus transformer TF101 I changed it to: adb shell am display-size 800x480 and it worked wm (Window Manager) is not available on Jelly Bean and older devices. for pre jelly bean use adb shell am display-density 240 or adb shell am display-size 800x480 来源: https://stackoverflow.com/questions/30839523/error-on-running-adb-shell-wm

Android Screen Size Algorithm / Pattern

岁酱吖の 提交于 2019-12-02 01:32:57
I'm looking for an Algorithm or Pattern to calculate where objects can be placed on multiple resolutions. So far, I have got the X and Y screen size, but im not sure how to turn it into a calculation that would place something such as a drawText() at a location on the screen no matter the screen size. I was thinking perhaps using percentages might be easier to work with. I have a program that draws text to the screen at the top left corner indicating what position the screen has been touched. when i run this on the emulator, with the drawText(info, 10,10, paint); it displays great, but when i

Getting the physical screen size in inches for iPhone

南笙酒味 提交于 2019-12-01 18:03:27
How can I get the screen size programmatically in inches(for example iPhone 4, 3.5 inches). I found a way to do it by detecting the iPhone/iPad model but hard coding is not what I want so I am not looking something like that. This will find the diagonal screen size of a device: float scale = [[UIScreen mainScreen] scale]; float ppi = scale * ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? 132 : 163); float width = ([[UIScreen mainScreen] bounds].size.width * scale); float height = ([[UIScreen mainScreen] bounds].size.height * scale); float horizontal = width / ppi, vertical = height

Raspberry Pi Qt5 Set physical screen size

前提是你 提交于 2019-12-01 17:35:38
I am developping a qt5 application on my raspberry pi on raspbian using cross compilation. When I run it, I get a black screen trying display a Pop-up which is a QFrame. I suppose that it cannot be positioned because I have error messages arriving at the beginning : EGLFS: Unable to query physical screen size, defaulting to 100 dpi. EGLFS: To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters). EGLFS: Unable to query screen depth, defaulting to 32. EGLFS: To override, set QT_QPA_EGLFS_DEPTH. When I disable the QFrame, the application is launched in full