"; } } $g_androidStrings = array( "android", ); $scheme = "newxwgame"; $host = "10.0.2.2"; $lang = $_REQUEST["lang"]; $room = $_REQUEST["room"]; $np = $_REQUEST["np"]; $id = $_REQUEST["id"]; $wl = $_REQUEST["wl"]; $agent = $_SERVER['HTTP_USER_AGENT']; $onAndroid = false; for ( $ii = 0; $ii < count($g_androidStrings) && !$onAndroid; ++$ii ) { $needle = $g_androidStrings[$ii]; $onAndroid = 0 != stripos( $agent, $needle ); } $onFire = 0 != stripos( $agent, 'silk' ); $localurl = "$scheme://$host?room=$room&lang=$lang&np=$np"; if ( $id != "" ) { $localurl .= "&id=$id"; } if ( $wl != "" ) { $localurl .= "&wl=$wl"; } if ( $onAndroid || $onFire ) { print << Crosswords Invite redirect

Tap this link to launch Crosswords with your new game.

If this fails it's probably because you don't have a new enough version of Crosswords installed.

EOF; } else if ( $onFire ) { $langString = langToString($lang); $langText = "Make sure the language chosen is $langString"; if ( '' != $wl ) { $langText .= " and the wordlist is $wl."; } $langText .= " If you don't have a[n] $langString wordlist installed you'll need to do that first."; print << Crosswords Invite redirect

It appears you're running on a Kindle Fire, whose non-standard (from an Android perspective) OS doesn't support the custom schemes on which Crosswords invitations depend. If you want to accept this invitation you'll need to do it the manual way:

  1. Open Crosswords, and navigate to the main Games List screen
  2. Choose "Add game", either from the menu or the button at the bottom.
  3. Under "New Networked game", choose "Configure first".
  4. $langText
  5. As the room name, enter "$room".
  6. Make sure the total number of players shown is $np and that only one of them is not an "Off-device player".
  7. Now tap the "Play game" button at the bottom (above the keyboard). Your new game should open and connect.

I'm sorry this is so complicated. I'm trying to find a workaround for this limitation in the Kindle Fire's operating system but for now this is all I can offer.

(Just in case Amazon's fixed the problem, here is the link that should open your new game.)

EOF; } else { $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 script to recognize" . " this as an Android browser."); print << Crosswords Invite redirect

This page is meant to be viewed on a browser on your Android device. Please open the email that sent you here on that device and revisit this link to complete the invitation process.

(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; } ?>