Ejemplo n.º 1
0
<?php

require_once "Android.php";
$obj = new Android();
$obj->dialogCreateAlert("It's time to do some crazy quizzing", "Developed By Amit Kumar Mondal");
$obj->dialogSetPositiveButtonText("Start");
$obj->dialogSetNegativeButtonText("No thanks");
$obj->dialogShow();
$inp = $obj->dialogGetResponse();
if ($inp["result"]->which == "positive") {
    //Question 1
    $qst1_opt = array("Windows 8", "Windows 7", "Windows Vista", "Windows XP");
    $qst1_ans = "Windows 7";
    $qst1 = question($obj, "Q1. Which has the codename Vienna?", $qst1_opt, $qst1_ans);
    //Question 2
    $qst2_opt = array("Go", "NoSQL", "Django", "AES");
    $qst2_ans = "Go";
    $qst2 = question($obj, "Q2. Amongst the following what is a Programming Language?", $qst2_opt, $qst2_ans);
    //Question 3
    $qst3_opt = array("Van Neuman", "Kernighan", "Rasmus Lerdorf", "Belly Deriath");
    $qst3_ans = "Rasmus Lerdorf";
    $qst3 = question($obj, "Q3. Who is the developer of PHP?", $qst3_opt, $qst3_ans);
    //Question 4
    $qst4_opt = array("Library Function", "Initialization Function", "Module Initialization Scheme", "Extension .so/.dll");
    $qst4_ans = "Module Initialization Scheme";
    $qst4 = question($obj, "Q4. What is the MINIT in PHP?", $qst4_opt, $qst4_ans);
    //Question 5
    $qst5_opt = array("echo()", "print()", "fread()", "printf()");
    $qst5_ans = "printf()";
    $qst5 = question($obj, "Q5. Amongst which takes unlimited arguments?", $qst5_opt, $qst5_ans);
    $result = $qst1 + $qst2 + $qst3 + $qst4 + $qst5;
Ejemplo n.º 2
0
<?php

require_once "Android.php";
$object = new Android();
$object->dialogCreateAlert("Quiz Game By", "Amit Kumar Mondal");
$object->dialogSetPositiveButtonText("Proceed");
$object->dialogSetNegativeButtonText("Exit");
$object->dialogShow();
$response = $object->dialogGetResponse();
$function = $response["result"]->which == "positive" ? "proceed" : "exit";
switch ($function) {
    case "proceed":
        $object->dialogCreateAlert("What is Codename for MAC OS X 10.7?");
        $ans11 = array("Lion", "Leopard", "Snow Leopard", "Tiger");
        $object->dialogSetItems($ans11);
        $object->dialogShow();
        $ans1 = $object->dialogGetResponse();
        $ans1m = "Lion";
        if ($ans11[$ans1["result"]->item] == $ans1m) {
            $object->dialogCreateAlert("Result", "Right Answer");
            $object->dialogSetPositiveButtonText("Next");
            $object->dialogShow();
            $next = $object->dialogGetResponse();
            if ($next["result"]->which == "positive") {
                $object->dialogCreateAlert("What is the new Database developed by Google?");
                $ans22 = array("NoSQL", "MongoDB", "F1", "CouchDB");
                $object->dialogSetItems($ans22);
                $object->dialogShow();
                $ans2 = $object->dialogGetResponse();
                $ans2m = "F1";
                if ($ans22[$ans2["result"]->item] == $ans2m) {
Ejemplo n.º 3
0
<?php

require_once "Android.php";
$droid = new Android();
/* Some GUI for the user */
$droid->dialogCreateAlert("Socket Program By", "Amit Kumar Mondal");
$droid->dialogSetNeutralButtonText("I'm Ready to fun!");
$droid->dialogShow();
$result = $droid->dialogGetResponse();
/* Get parameters */
/* 1- Remote AMI server */
$server = $droid->dialogGetInput("Please enter IP/Hostname of your Asterisk BOX", "");
/* 2- Remote AMI port */
$port = $droid->dialogGetInput("Please enter TCP Port", "");
/* 3- Remote user */
$user = $droid->dialogGetInput("Please enter username", "");
/* 4- Remote pass */
$pass = $droid->dialogGetPassword("Please enter password", "");
$server = $server['result'];
$port = $port['result'];
$user = $user['result'];
$pass = $pass['result'];
echo "Ready to connect to {$server}:{$port} with {$user}/{$pass}\n";
/* TCP Connection */
$astSocket = fsockopen($server, $port, $errno, $errstr, 30);
if (!$astSocket) {
    $droid->dialogCreateAlert("Socket Program", "Sorry, TCP Connection on {$server} : {$port} was not possible :r(");
    $droid->dialogSetNeutralButtonText("I will try again :D)");
    $droid->dialogShow();
    $result = $droid->dialogGetResponse();
    exit(1);