⬆️ ⬇️

Build Your First PHP for Android Application

The Android operating system shocked the smartphone market :). Unlike Apple, which has quite strict requirements for developers who want to display their applications in the iPhone App Store, Google has created an Android platform open (in the original wide open). Currently you can write PHP applications. The Irontech guys created the essentials, and using the Scripting Layer for Android (SL4A), you can create PHP applications for Android.



Not!

In this article I will tell you how to install, configure and use PHP for Android and SL4A, we will also see demo applications and you will get the first experience of developing Android applications for PHP.



Install PHP for Android



To install PHP for Android, you must have a phone or an emulator that supports Android version 1.5 or more, also in the application installation settings, there should be a check mark for installing applications from unknown sources. After all this, simply install the two packages SL4A environment and PHP for Android APK .

')

Installing SL4A is quite simple, but after installing the PHP for Android application package, you need to start it and click “install” to complete the installation ( during the installation process, the program downloads somewhere around 2 MB ). If you have problems with installation, then there is a video demonstration on Vimeo (( or here )).



Setting up a PHP development environment for Android



If you installed PHP for Android, theoretically, you can write applications on your phone. But from a practical point of view, this would not be a good idea. What you need to do is download the Android SDK , install the emulator, and start writing code using your favorite editor.



After downloading the SDK, unzip the contents, launch the Android application in the tools directory, and install the emulator. In the Android SDK and AVD Manager menu, select Virtual Devices and tap the New button. Name your emulator (for example “Droid2”) and select Android 2.2. Enter 10 MB for the SD Card size and click Create AVD.



Now that you have a configured emulator, click the Start button. Some complexity arises here; you cannot simply copy the files to the virtual device you just created. You need to configure port forwarding and put your PHP script on a virtual device using a program called adb, which is part of the Android SDK. It is also located in the tools directory.



Next, you start the server on your virtual device, connect to the server to transfer your script. The following steps will help you run everything as fast as possible. (You can read the full documentation on this process here ).



On your running virtual device, go to the Applications screen and press SL4A.

# on the SL4A screen, press the Menu button, select View and select Interpreters.

# Press Menu again, select Start Server and select Private.

# Put the notification area (Android notification bar) down and you will see the SL4A Service. (Click on the service and write down the port number that your server is listening on, for example 47000.)

# Open a command prompt and install port forwarding using the adb command. For example, enter the command “adb forward tcp: 9999 tcp: 47000” (replace 47000 with your port number).

# Set the environment variable AP_PORT. On UNIX or Mac, run "export AP_PORT = 9999". On Windows, "set AP_PORT = 9999".

# To test emulator run "run adb push my_script.php / sdcard / sl4a / scripts" (replace my_script.php with the name of your script).



You can also work with a real phone. Follow the same steps as with the emulator. To facilitate the process, set the ANDROID_HOME environment variable, which will indicate the location of your Android SDK and add the path to the tools directory to the path list ( I didn’t really understand how to do this on the phone, if readers know, then write in the comments )



Creating Android applications in PHP



Writing PHP applications is a very easy process after you set up everything described above. The only thing worth noting is that the PHP version for Android is very curtailed. At your disposal will be the basic functions of PHP and JSON support. And if you are an Android developer who is familiar with the Java framework for Android, you will notice that Scripting Layer for Android does not provide access to all the components that you would get using Java for development ( hopefully this is only for now ).



What SL4A provides is only a facade to a subset of the Android API. (A full list of the methods provided by SL4A is available here ) What is the catch of PHP for Android - you can easily develop an application and see its work by writing just a few lines of code. Let's look at an application that works with quotes, which takes less than 60 lines of code.



<?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  1. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  2. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  3. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  4. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  5. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  6. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  7. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  8. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  9. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  10. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  11. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  12. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  13. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  14. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  15. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  16. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  17. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  18. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  19. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  20. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  21. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  22. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  23. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  24. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  25. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  26. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  27. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  28. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  29. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  30. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  31. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  32. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  33. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  34. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  35. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  36. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  37. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  38. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  39. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  40. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  41. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  42. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  43. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  44. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  45. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  46. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  47. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  48. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  49. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
  50. <?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .
<?php define( 'QUOTE_SERVER' , 'http://quoter.take88.com/?ticker=%s' ); require_once( "Android.php" ); $droid = new Android(); $action = 'get_tickers' ; $tickers = '' ; while (TRUE) { switch ($action) { case 'quote' : $droid->dialogCreateSpinnerProgress( "Querying stock information server ..." , "Please wait" ); $droid->dialogShow(); $quotes = @array_slice(json_decode(file_get_contents(sprintf(QUOTE_SERVER, $tickers))), 0, 3); $droid->vibrate(); $droid->dialogDismiss(); // Possible data points. // "SYMBOL","NAME","LAST_TRADE","MORE_INFO","LAST_TRADE_DATE","LAST_TRADE_TIME","OPEN","DAYS_HIGH","DAYS_LOW","DIVIDEND_SHARE","PE_RATIO","52_WEEK_LOW","52_WEEK_HIGH","VOLUME" $output = '' ; for ($i = 0, $cnt = count($quotes); $i < $cnt; $i++) { $output .= "Company: " . $quotes[$i]->NAME . "\n" ; $output .= "Ticker: " . $quotes[$i]->SYMBOL . "\n" ; $output .= "Last trade: $" . $quotes[$i]->LAST_TRADE . "\n" ; $output .= "\n" ; } $output = html_entity_decode($output, ENT_QUOTES, "UTF-8" ); // Something is wrong with ' $output = str_replace( "'" , "'" , $output); $droid->dialogCreateAlert( "Your stock quotes" , $output); $droid->dialogSetPositiveButtonText( "Get new quote" ); $droid->dialogSetNegativeButtonText( "Exit" ); $droid->dialogShow(); $response = $droid->dialogGetResponse(); if ($response[ 'result' ]->which == 'negative' ) { $action = "exit" ; } else { $action = 'get_tickers' ; } break ; case 'get_tickers' : $response = $droid->getInput( "Stock Tickers (max. 3)" , "Enter Tickers.\nSeparate with spaces." ); $tickers = str_replace( ' ' , '+' , $response[ 'result' ]); $droid->vibrate(); $action = 'quote' ; break ; case 'exit' : $droid->exit(); exit(); break ; } } ?> * This source code was highlighted with Source Code Highlighter .




Copy and put this code into the editor, save it under the name quoter4android.php and load it into the emulator. If the emulator is not running, start it, configure the forwarding port, and download quoter4android.php using adb.



To run the application in your emulator, go to the application screen, click the SL4A icon and click quoter4android.php.



To install quoter4android.php on your phone, you can configure forward ports, but it is easier to connect the phone to the computer via USB and copy the script to the sl4a / scripts directory. However, to run the script, you need to disconnect it from the computer, otherwise you will not see the installed scripts, and then click the SL4A icon.



Conclusion



With SL4A and PHP for Android you can do a lot of interesting things; This article is just a small demonstration of possibilities. All these applications are very young - the new version of SL4A was released when I wrote this article - and in the future we will receive more and more new features.

Source: https://habr.com/ru/post/106075/



All Articles