How do you programmatically access the ambient light sensor on Mac OS X 10.5+?

I’m trying to programmatically access the ambient light sensor in a Mac application running on OS X 10.5 and above, but can’t find a way to do this. Two other questions had been posed about this here, “Accessing mac’s sensor data” and “Disable ambient-light sensor screen dimming programmatically on OS X”, but they either didn’t … Read more

android How to stretch rows in the gridview to fill screen?

I have simple GridView (with one column and six rows), that displays ImageView with TextView in the cell (I create adapter). How to stretch rows to fill entire screen height?? Now I have some space below cells… main.xml <LinearLayout xmlns:android=”” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”horizontal”> <LinearLayout android:layout_height=”fill_parent” android:layout_width=”150dp” android:orientation=”vertical” android:id=”@+id/left”> <include layout=”@layout/menu_grid”></include> </LinearLayout> <LinearLayout android:layout_height=”fill_parent” android:layout_width=”fill_parent” android:orientation=”vertical” … Read more

How to make a div fullscreen and atop of all other elements with jQuery?

<div style=”background-color:grey”> </div> Is there an easy way to do it? Answer Define a style overlay or something like so: <style> .overlay { position:absolute; top:0; left:0; width:100%; height:100%; z-index:1000; } </style> Then you can add the new class like this using jQuery: $(‘#myDiv’).addClass(‘overlay’); If you want to add with a click event you would do … Read more

how to get user’s screen resolution with PHP [duplicate]

This question already has answers here: Closed 11 years ago. Possible Duplicate: Getting the screen resolution using PHP well the question is self explanatory where i want to reach is $width = ; //user screen width in here F1! F1! Answer You need JavaScript, not PHP. var screenWidth = window.screen.width, screenHeight = window.screen.height; You can … Read more

Android emulator – Screen rotation

I would like to test the rotation of a phone on the emulator, I see everywhere that we have to use Ctrl+F11 but it only rotates the image of the emulator and does not launch a configuration change event or redraw the activity. Here is what I have with Ctrl+F11 : So, what do I … Read more

Make my wpf application Full Screen (Cover taskbar and title bar of window)

I would like to make my application such that it can maximize to full screen means it hide the windows task bar and the title bar as well. And it should triggered by a button. I am trying to develop the my application window like this. Add my code snippet below <controls:MetroWindow x:Class=”EDUI.MainWindow” xmlns:controls=”clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro” xmlns=”” … Read more

How to get screen size on Windows Phone 7 Series?

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? How can I get the active screen dimensions? Answer I use this: this.ScreenWidth = … Read more

Immersive fullscreen below 4.4

I have an app that I want to run in fullscreen. If i have a device with 4.4 KitKat it is easy to set the SYSTEM_UI_FLAG_IMMERSIVE to make the app go pure fullscreen. However if i have a device with a lower API than 4.4. I have no idea how to make it fullscreen as … Read more

Playing a sound while app is in the foreground and the screen is locked – iOS

Preface: I’m building an alarm clock app. Many other alarm apps such as Alarm Clock Pro are able to play an alarm while the screen is locked and the app is in the foreground. Their alarms can play for an unlimited amount of time and can progressively increase in volume using the system volume. They … Read more