Symfony 2 load different template depending on user agent properties

Ok, so I don’t have a full solution but a little more than where to look for one 🙂 You can specify loaders (services) for templating item in app/config/config.yml framework: esi: { enabled: true } #translator: { fallback: %locale% } secret: %secret% router: resource: “%kernel.root_dir%/config/routing.yml” strict_requirements: %kernel.debug% form: true csrf_protection: true validation: { enable_annotations: true … Read more

ADB is not recognizing my device

The problem was that windows does not recognize the device driver, therefore is needed install it manually. The way I solved this: 1. Open Device Manager and locate your device under “Other devices”. 2. Right click on your device and then click on “Update driver software”. 3. Now click on “Browse my computer for driver … Read more

iPhone WebApps, is there a way to detect how it was loaded? Home Screen vs Safari?

You can determine whether a webpage is displayed in full-screen mode using the window.navigator.standalone read-only Boolean JavaScript property. https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html if (window.navigator.standalone) { // fullscreen mode }

iTunes api, lookup by bundle ID?

Apple has changed their API, and removed the language code from the URL, so you should only the bundleId for the app you are looking for. For example: http://itunes.apple.com/lookup?bundleId=com.yelp.yelpiphone In addition, you can add the country parameter to the query, to get results for a specific country App Store. For example: http://itunes.apple.com/lookup?bundleId=com.yelp.yelpiphone&country=de The description, user … Read more

This request is missing a valid app identifier, meaning that neither safetyNet checks nor reCAPTCHA checks succeeded

Open android studio and click on gradle in right corner > click your project > select app > select tasks > select android > click on signing report > copy our SHA1 and SHA-256 from there. Add SHA1 and SHA-256 in your new firebase account . Add dependency in build.gradle(:app) implementation ‘androidx.browser:browser:1.3.0’ Go to google … Read more

What are best practices for detecting pixel ratio/density?

You should leverage the manufacturer’s hint via the <meta name=”viewport” content=”width=device-width”/> or @-ms-viewport {width:device-width} feature. It basically exposes the default zoom the device manufacturer considers optimal given the pixel density of the screen. After you do that, when you call window.innerWidth it will give you what your original equation was intended for but without relying … Read more

Hover effects using CSS3 touch events

Use the :active pseudo-class in your css, then add ontouchstart=”” and onmouseover=”” to the body tag. The following code is excerpted from my site, in which I have buttons that get smaller and glow white when hovered(on pcs) or held down(on touch devices) <style> .boxbutton:active{ -webkit-transform:scale(0.9); -moz-transform:scale(0.9); -ms-transform:scale(0.9); -o-transform:scale(0.9); transform:scale(0.9); -webkit-box-shadow:0px 0px 20px #FFF; -moz-box-shadow:0px … Read more

Mobile viewport height after orientation change

Use the resize event The resize event will include the appropriate width and height after an orientationchange, but you do not want to listen for all resize events. Therefore, we add a one-off resize event listener after an orientation change: Javascript: window.addEventListener(‘orientationchange’, function() { // After orientationchange, add a one-time resize event var afterOrientationChange = … Read more