EOF; } function printTail() { print << EOF; } function printNonAndroid($agent) { $subject = "Android device not identified"; $body = htmlentities("My browser is running on an android device but" . " says its user agent is: \"$agent\"." . " Please fix your website to recognize" . " this as an Android browser."); print <<

This page is meant to be viewed on an Android device.


(If you are viewing this on an Android device, you've found a bug! Please email me (and be sure to leave the user agent string in the email body.)

EOF; } function printAndroid() { print <<

You'll have come here after clicking a link in an email or text inviting you to a Crosswords game. But you should not be seeing this page.

If you got this page on your device, it means either

  • The copy of Crosswords you have is NOT beta 56 or newer (dating from about Dec. 1, 2012).
  • OR
  • that your copy of Crosswords is new enough BUT that when you clicked on the link and were asked to choose between a browser and Crosswords you chose the browser.

In the first case, install the latest Crosswords, either via the Google Play store or (sideloading) via Sourceforge.net. After the install is finished go back to the invite email (or text) and tap the link again.

In the second case, hit your browser's back button, click the link in your invite email (or text) again, and this time let Crosswords handle it.

(If you get tired of having to having to make that choice, Android will allow you to make Crosswords the default. If you do that Crosswords will be given control of all URLs that start with "http://eehouse.org/and/" -- not all URLs of any type.)

Have fun. And as always, let me know if you have problems or suggestions.

EOF; } /********************************************************************** * Main() **********************************************************************/ $agent = $_SERVER['HTTP_USER_AGENT']; $onAndroid = false; for ( $ii = 0; $ii < count($g_androidStrings) && !$onAndroid; ++$ii ) { $needle = $g_androidStrings[$ii]; $onAndroid = false !== stripos( $agent, $needle ); } $onFire = false !== stripos( $agent, 'silk' ); printHead(); if ( /*true || */ $onFire || $onAndroid ) { printAndroid(); } else { printNonAndroid($agent); } printTail(); ?>