scale fit mobile web content using viewport meta tag

In the head add this //Include jQuery <meta id=”Viewport” name=”viewport” content=”initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no”> <script type=”text/javascript”> $(function(){ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) { var ww = ( $(window).width() < window.screen.width ) ? $(window).width() : window.screen.width; //get proper width var mw = 480; // min width of site var ratio = ww / mw; //calculate ratio if( ww …

Read more

Concise way of writing new DialogPreference classes?

The bare minimum is: MyCustomDialogPreference(Context context, AttributeSet attrs) constructor. Don’t forget to call super(context, attrs). Call setPersistent(false) to indicate to the super Preference class that you persist the preference value on your own. If you want to inflate the dialog panel layout from a resource, then also call setDialogLayoutResource(int dialogLayoutResId). onBindDialogView(View view) – update the …

Read more

When using @media queries, does a phone load non-relevent queries and images?

Behaviour is browser depended but iOS Safari and Android Chrome will respect the media queries and only download the background images for the applicable media queries. If you want to inspect this behaviour, try loading the page with Mobitest (http://mobitest.akamai.com/) or a tethered device. If you use separate CSS files (and I’d urge you not …

Read more

Is there a way to Fix a Google Maps Marker to the Center of its Map always?

Rather than injecting an HTML component as suggested in @Dr.Molle’s answer, why don’t you use a CSS only solution. It is simpler, more efficient and doesn’t require you to even touch the DOM (so there won’t be any problems if Google changes their implementation). Also since Google Maps doesn’t apply any styles on the container …

Read more