screen-size

Handling all screen sizes android

Deadly 提交于 2019-12-30 21:00:13
问题 I'm working on an android App,and it's designed with numbers (margins etc) no relative things so I think I'll find many problems with different screen sizes so I thought of making a function which will keep the data in DIMENSIONS file proportional to user screen size like ( User's screen size X dimen)/(the screen size which the app were designed on) , so I want to know if this won't cause any problem on App working etc .. Thank you =) 回答1: Create three different Layouts Folder in your res

php echo statement if screen is a certain size

落爺英雄遲暮 提交于 2019-12-29 08:12:13
问题 I have a series of jQuery scripts on my site that I want to only run if the users screen width is greater than 960px. I know that you can't detect screen size using php but is there a way to create something to this effect: <? php if [METHOD TO DETECT SCREEN SIZE] > 960px { echo '<script src="js/nbw-parallax.js" type="text/javascript"></script>'; } ?> 回答1: Why not use jQuery? if( $(window).width() > 960 ) { $.ajax({ url: 'js/nbw-parallax.js', dataType: "script", success: function() { /

How to get the screen size of the device?

老子叫甜甜 提交于 2019-12-28 12:06:11
问题 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)

Android phone or Android tablet detection by http headers

无人久伴 提交于 2019-12-25 18:47:31
问题 Is there a way to detect whether user is accessing your website from android powered tablet or phone on the server side? I don't own any android devices, so it's not possible for me to test what kind of headers those devices send. In my research I found: - many ways to detect it using javascript. But thats (IMHO) not the best moment, when you decide what web version should be sent to client. I prefer to server each version based on http headers sent by client. - database of http headers

How to stop sideloading a tablet only app on a handset in Android

拥有回忆 提交于 2019-12-25 01:35:06
问题 How can I stop the user from sideloading a tablet only application on a phone? 回答1: There are no mechanisms in the core Android OS to disable the ability to install an application based on the manifest filtration data for features like screen size, these values are only used by Google Play to determine which apps to show on which device. If a user somehow gets ahold of your APK through back channels, you cannot stop them from installing it. However, after the application is installed, you can

Android game working on all screen sizes

僤鯓⒐⒋嵵緔 提交于 2019-12-24 16:33:48
问题 I'm trying to specify the art sizes for an Android game with ~10 screens. I want the game to run on API 8+, and on all size screens except "small". Since we're using API 8, I use the old "4 categories of screen" feature - I plan to support normal (480 x 320, and up to 640 x 480) large (640 x 480, and up to 960 x 720) xlarge (960 x 720, and up to 1920 x 1200) A 1920x1200 png file is ~4.1MB. So 10 of them is 41MB, and we've almost blown our 50 MB app size limit (Play Store). So three questions:

How to get a screen resize dimension from a service in angular 2+?

帅比萌擦擦* 提交于 2019-12-23 21:32:23
问题 First this not duplicated take time to read, because there is lot of similar question but they are in the @Component decorator I got the idea to catch screen resizing in a service then sharing some css value by an observable, but it seem that my service is not working (not able to catch screen resize event). Here is my code import { Injectable, HostListener } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; @Injectable({ providedIn: 'root', }) export class BreakPointService {

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

不打扰是莪最后的温柔 提交于 2019-12-21 03:19:17
问题 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

Using jQuery to change image src when browser is resized

*爱你&永不变心* 提交于 2019-12-19 09:11:03
问题 I have two different sized images, one if for screens smaller than 759px, the other is for screens larger than 759px. I have managed to get the source of the images to change when the document loads depending on the window width. But I really would like to be able to do this when the browser is resized as well but for the life of me I can't get it to do that, it only seems to work when the page is initially loaded. This is my code: $(document).ready(function() { function imageresize() { var

Adjust GridView to all Screen Sizes

人盡茶涼 提交于 2019-12-18 12:24:28
问题 Im trying to implement a GridView as part of a image gallery. I followed the following example from the Android developer portal. The tutorial seems to work for all screen sizes. As you can see below the proportions for a small and a large screen size are displayed correctly (on the left - small screen size, on the right - large screen size. But now to my problem. When I want to implement exactly the same GridView within a LinearLayout from my Android Project - the correct proportions are