screen

How to get screen size on Windows Phone 7 Series?

半腔热情 提交于 2019-12-17 23:06:55
问题 How do I programatically get the screen resolution on WP7? Here are a bunch of links that get the same job done in desktop WPF and Silverlight, but none of them are in the Phone SDK. Any ideas? http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/f0639904-a368-44db-9ddd-efcaf8fc736e http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6b6b832f-0dfd-428c-84cd-b1b9e7f236cf How can I get the active screen dimensions? http://social.msdn.microsoft.com/Forums/en-US

Set background image according to screen resolution

寵の児 提交于 2019-12-17 22:33:32
问题 I would like to be able to change my webpage background image according to the screen resolution the user uses so: if screen resolution is greater than or equal to 1200*600 then background = mybackground.jpg no-repeat or else. How can I do this? 回答1: Pure CSS approaches that work very well are discussed here. Two techniques are examined in particular and I personally prefer the second as it not CSS3 dependent, which suits my own needs better. If most/all of your traffic has a CSS3 capable

Detect current screen bounds

允我心安 提交于 2019-12-17 20:56:18
问题 I am working on an application that has setDecoration(false) and I have a MouseMotionlistener so I can move it around, and at the moment I am trying to make a maximize button. On the default monitor it works perfectly, but on a second monitor if I click the maximize button it will maximize to the default screen. How would I get the X & Y coordinates of the screen the application is currently on? I.E. I have 2 monitors both at 1600x900, so if the application is on monitor 1, the X & Y would be

Multiple screen support do we need different layouts for each screen

北战南征 提交于 2019-12-17 19:56:12
问题 For Multiple screen support do we need different layouts for each screen which goes in hdpi, ldpi and mdpi folders, I read this on android site, but not sure how to implement this one. Thanks Max 回答1: The following is a list of resource directories in an application that provides different layout designs for different screen sizes and different bitmap drawables for medium, high, and extra high density screens. res/layout/my_layout.xml // layout for normal screen size ("default") res/layout

Brightness Screen Filter

半城伤御伤魂 提交于 2019-12-17 17:29:34
问题 Does anyone have an idea how to implement an Brightness Screen Filter like the one here: http://www.appbrain.com/app/screen-filter/com.haxor I need a starting point and I can't figure out how to do it. 回答1: Just make a transparent full screen activity that lets touches pass through. To make touches pass through use the following Window flags before setting the contentView: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Window window = getWindow

How to check if my activity is the current activity running in the screen

百般思念 提交于 2019-12-17 15:37:48
问题 I used Toast to make notification, but it seems it will appear even its activity is not in the current screen and some other activity has been started. I want to check this situation, when the activity is not the current one, I'd not send the Toast notification. But how to do ? 回答1: When your Activity comes to the foreground, its onResume() method will be invoked. When another Activity comes in front of your Activity, its onPause() method will be invoked. So all you need to do is implement a

Calculating pixel size on an iPhone

人盡茶涼 提交于 2019-12-17 15:36:46
问题 Is there a way in the iPhone SDK to calculate the size (in millimeters) of a single pixel? 回答1: Well, the size of a pixel is a constant. The screen size of a current iPhone or iPod touch 2" x 3" (50.8 mm x 76.2 mm) and the resolution is 320 x 480 pixel. 50.8 / 320 (or 76.2 / 480) => the size of 1 pixel is 0.15875 mm x 0.15875 mm 回答2: Answering the question as asked about the size of pixels: Pixel size on an iPhone and iPod Touch The earlier iPhones (pre-iPhone 4) Apple iPhone Technical

How to check if my activity is the current activity running in the screen

大憨熊 提交于 2019-12-17 15:36:37
问题 I used Toast to make notification, but it seems it will appear even its activity is not in the current screen and some other activity has been started. I want to check this situation, when the activity is not the current one, I'd not send the Toast notification. But how to do ? 回答1: When your Activity comes to the foreground, its onResume() method will be invoked. When another Activity comes in front of your Activity, its onPause() method will be invoked. So all you need to do is implement a

How can I prevent the display on an iOS device from dimming and turning off? [duplicate]

本秂侑毒 提交于 2019-12-17 15:13:26
问题 This question already has answers here : How do I prevent the iPhone screen from dimming or turning off while my application is running? (5 answers) Closed 5 years ago . I'm diving into iOS development and am building my own alarm clock app to become familiar with platform and SDK. I've noticed some alarm clock apps in the app store keep the screen from dimming and/or turning off when their app is running. How is this implemented? 回答1: Add this line of code on your application delegate:

android unlock screen intent?

社会主义新天地 提交于 2019-12-17 12:31:19
问题 Is there an intent that is fired when a user unlocks their screen? I want my app to adjust the brightness when the screen turns on, but the problem im running into is that the screen on intent is fired on the lock screen and it does not adjust the display on that screen. 回答1: Look at the disableKeyguard method in the KeyguardLock class. 回答2: Yes, the ACTION_USER_PRESENT is broadcasted after the user unlocks: http://developer.android.com/reference/android/content/Intent.html#ACTION_USER