0% found this document useful (0 votes)
65 views

Wireless Technology Practical Journal

This document is a certificate from the K. J. Somaiya Institute of Engineering & Information Technology certifying that Mr. Charudatta S. Palvi of MCA Semester V has satisfactorily completed practicals in the subject of Wireless Technology & Mobile Computing as required by the University of Mumbai for the 2021-2022 academic year. It includes the signature of the staff member in charge of practicals and the PCP coordinator.

Uploaded by

Charudatt Palvi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

Wireless Technology Practical Journal

This document is a certificate from the K. J. Somaiya Institute of Engineering & Information Technology certifying that Mr. Charudatta S. Palvi of MCA Semester V has satisfactorily completed practicals in the subject of Wireless Technology & Mobile Computing as required by the University of Mumbai for the 2021-2022 academic year. It includes the signature of the staff member in charge of practicals and the PCP coordinator.

Uploaded by

Charudatt Palvi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 32

University of Mumbai

Institute of Distance and Open Learning (IDOL)


Dr. Shankardayal Sharma bhavan, Vidyanagari, Santacruz(E)

PCP CENTER:

K. J. Somaiya Institute of Engineering & Information Technology, Sion

Certificate

This is to certify that Mr _CHARUDATTA S. PALVI_ of MCA Semester V has


completed the specified Practical in the subject of _Wireless Technology &
Mobile Computing_ satisfactorily within this institute as laid down by University
of Mumbai during the academic year 2021 to 2022.

Staff Member Incharge PCP Co-ordinator

Examiner
University of Mumbai

Institute of Distance and Open Learning (IDOL)


Dr. Shankardayal Sharma bhavan, Vidyanagari, Santacruz(E)
PCP CENTER:

K. J. Somaiya Institute of Engineering & Information Technology, Sion

INDEX
Subject: _Wireless Technology & Mobile Computing

Sr. Pg. Sign. Remarks


No. NAME OF EXPERIMENT No.
1 To implement a lock diary app
in app lab of code.org.
2 To implement a Trex runner
game in app lab of code.org.
3 To implement a global chat app
in app lab of code.org.
4 To implement a real time
walkie-talkie app in app lab of
code.org.
5 To implement a phone unlock
app in app lab of code.org.
6 To implement a quiz game in
app lab of code.org.
Practical:- 1

Title:- To implement a lock diary application in app of code.org.

Code:

onEvent("button1", "click", function( ) {


setScreen("screen2")
});
onEvent("button2", "click", function( ) {
setScreen("screen3");
hideElement("label2")
});
onEvent("button3", "click", function( ) {
setScreen("screen4")
});
onEvent("image1", "click", function( ) {
setScreen("screen2")
});
onEvent("image2", "click", function( ) {
setScreen("screen2")
});
onEvent("button4", "click", function( ) {
createRecord("diaries", {date:
(getText("text_input2")),time:getText("text_input3"),title:getText("text_input4"),describe:getTe
xt("text_input5")}, function(record) {
showElement("label2");
setText("text_input2", "");
setText("text_input3", "");
setText("text_input4", "");
setText("text_input5", "");
});
});
var i = 0;

onEvent("image4", "click", function( ) {


showElement("image3");
readRecords("diaries", {}, function(records) {
if(i < records.length) {
setText("text_input6", records[i].date);
setText("text_input7", records[i].time);
setText("text_input8", records[i].title);
setText("text_input9", records[i].describe);
i++;
}
if(i>=records.length){
hideElement("image4");
}
});
});
onEvent("image3", "click", function( ) {
showElement("image4");
readRecords("diaries", {}, function(records) {
if(i <= records.length) {
i--;
setText("text_input6", records[i].date);
setText("text_input7", records[i].time);
setText("text_input8", records[i].title);
setText("text_input9", records[i].describe);
}
if(i<=0){
hideElement("image3");
}
});
});
Output:-

Label1

Text_input1

Button1
Button2

Button3

Image1

Text_input3

Text_input2

Text_input4

Text_input5

Button4

Label2
Image2

Text_input7
Text_input6

Text_input8

Text_input9

Image3 Image4
Practical 2:-

Title:- To implement a Trex runner game in app lab of code.org

Code:-

var condition = "", then = "";

/*
WHAT DO YOU THINK THE CONDITION WOULD BE IF YOU WANT THE TREX TO
CONTINUE TO LIVE.

While _____ IN FRONT


Cactus.
Cloud.
Man.
Nothing.

*/

/*
WHAT DO YOU THINK THE CONDITION WOULD BE IF YOU WANT THE TREX TO
CONTINUE TO LIVE.

THEN _____
Keep Running.
Stop.
Jump.
Do Nothing.

*/

/* Select the right COMBINATION. */

/* WHILE */ condition = "cactus";


/* DO */
then = "jump";

// Extra Pruning
condition = condition.trim().toLowerCase();
then = then.trim().toLowerCase();

//initiate Game STATEs


var PLAY = 1;
var END = 0;
var gameState = PLAY;

//create a trex sprite


var trex = createSprite(200,380,20,50);
trex.setAnimation("trex");
//set collision radius for the trex
trex.setCollider("rectangle",0,0,trex.width,trex.height);

//scale and position the trex


trex.scale = 0.5;
trex.x = 50;

//create a ground sprite


var ground = createSprite(200,380,400,20);
ground.setAnimation("ground2");
ground.x = ground.width /2;

//invisible Ground to support Trex


var invisibleGround = createSprite(200,385,400,5);
invisibleGround.visible = false;

//create Obstacle and Cloud Groups


var ObstaclesGroup = createGroup();
var CloudsGroup = createGroup();

//set text
textSize(18);
textFont("Georgia");
textStyle(BOLD);

//score
var count = 0;
function draw() {
//set background to white
background("white");
//display score
text("Score: "+ count, 250, 100);

if(gameState === PLAY){


//move the ground
ground.velocityX = -(6 + 3*count/100);
//scoring
count = Math.round(World.frameCount/4);

if (count>0 && count%100 === 0){


playSound("checkPoint.mp3");
}

if (ground.x < 0){


ground.x = ground.width/2;
}

//jump when the space key is pressed


if(keyDown("space") && trex.y >= 359){
trex.velocityY = -12 ;
playSound("jump.mp3");
}

//add gravity
trex.velocityY = trex.velocityY + 0.8;

//spawn the clouds


spawnClouds();

//spawn obstacles
spawnObstacles();

//End the game when trex is touching the obstacle


if(ObstaclesGroup.isTouching(trex) && condition == "cactus" && then == "jump"){
trex.velocityY = -12 ;
playSound("jump.mp3");
// gameState = END;
// playSound("die.mp3");
} else if (ObstaclesGroup.isTouching(trex)) {
playSound("jump.mp3");
gameState = END;
playSound("die.mp3");
}
}

else if(gameState === END) {


//set velcity of each game object to 0
ground.velocityX = 0;
trex.velocityY = 0;
ObstaclesGroup.setVelocityXEach(0);
CloudsGroup.setVelocityXEach(0);
//change the trex animation
trex.setAnimation("trex_collided");

//set lifetime of the game objects so that they are never destroyed
ObstaclesGroup.setLifetimeEach(-1);
CloudsGroup.setLifetimeEach(-1);

//place gameOver and restart icon on the screen


var gameOver = createSprite(200,300);
var restart = createSprite(200,340);

gameOver.setAnimation("gameOver");
gameOver.scale = 0.5;
restart.setAnimation("restart");
restart.scale = 0.5;
}

//stop trex from falling down


trex.collide(invisibleGround);

drawSprites();
}

function spawnObstacles() {
if(World.frameCount % 60 === 0) {
var obstacle = createSprite(400,365,10,40);
obstacle.velocityX = - (6 + 3*count/100);
//generate random obstacles
var rand = randomNumber(1,6);
obstacle.setAnimation("obstacle" + rand);

//assign scale and lifetime to the obstacle


obstacle.scale = 0.5;
obstacle.lifetime = 70;
//add each obstacle to the group
ObstaclesGroup.add(obstacle);
}
}

function spawnClouds() {
//write code here to spawn the clouds
if (World.frameCount % 60 === 0) {
var cloud = createSprite(400,320,40,10);
cloud.y = randomNumber(280,320);
cloud.setAnimation("cloud");
cloud.scale = 0.5;
cloud.velocityX = -3;

//assign lifetime to the variable


cloud.lifetime = 134;

//adjust the depth


cloud.depth = trex.depth;
trex.depth = trex.depth + 1;
//add each cloud to the group
CloudsGroup.add(cloud);
}

Output:-
Practical :- 3

Title:- To implement a global chat application in app lab of code.org

Code:-

onEvent("button1", "click", function(event){


createRecord("Message", {FromUsername:(getText("text_input3")), Message:
(getText("text_input1"))}, function (record) {
setText("text_input1","");
});
});
onEvent("button2","click", function(event){
setText("text_area1","");
readRecords("Message",{},function(records){
for(var i=0; i < records.length; i++){
setText("text_area1", "From: " +((records[i]).FromUsername + (" " + ("Message : " +
(records[i].Message)))));
}
});
});
onEvent("button3","click",function(){
setScreen("screen2");
hideElement("label2");
});
onEvent("Submit","click", function(){
createRecord("Reported Users",{Username:(getText("text_input2")), ReportingReason:
(getText("text_area2"))}, function (record) {
setText("text_input2","");
setText("text_area2","");
showElement("label2");
});
});

onEvent("button5","click",function(){
setScreen("screen1")
});
Output:-
Practical:- 4

Title:- To implement a real time walkie-talkie application in app lab of code.org.

Code:

onEvent("Login", "click", function( )

createRecord("Users", {Email:(getText("email")),Password:(getText("password")),Photo:
(getImageURL("photo"))},

function(record)

});

playSound("sound://default.mp3", false);

playSpeech(("Hi,"+", ")+getText("email")+", "+"Your Accout has been created


succesfully", "female", "English");

setScreen("screen3");

});

onEvent("image2", "click", function( ) {

readRecords("Users", {}, function(records)

var user=[];

for (vari=0; i<records.length; i++)

{
if(records[i].Email!=getText("email"))

appendItem(user, records[i].Email);

setText("useremail",records[i].Email);

setImageURL("userimage", records[i].Photo);

setProperty("dropdown1","options", user);

playSound("sound://default.mp3", false);

});

setScreen("screen2");

});

onEvent("dropdown1", "click", function( ) {

readRecords("Users", {}, function(records)

var user1=[];

for (vari=0; i<records.length; i++)

if(records[i].Email!=getText("email"))

appendItem(user1, records[i].Email);

}
setProperty("dropdown1","options", user1);

playSound("sound://category_bell/hollow_bell_notification.mp3", false);

});

});

onEvent("label3", "click", function( ) {

createRecord(getText("useremail")+getText("dropdown1"),
{Sender:getText("useremail"), Receiver:getText("dropdown1"),
Message:getText("messagebox")}, function (record){

});

playSpeech("Message to "+getText("dropdown1")+" has been sent succesfully", "female",


"English");

setText("messagebox"," ");

});

onEvent("image3", "click", function( ) {

readRecords(getText("dropdown1")+getText("useremail"),{}, function(records){

for (vari=0; i<records.length;i++){

playSpeech(records[i-1].Message, "female", "English");

});

});

Output:-
Practical :- 5

Title:- To implement a phone unlock app in code.org

Code:-

onEvent("screen1", "click", function( ) {

setScreen("screen2");

hideElement("label1");

});

onEvent("button1", "click", function( ) {

if (getText("text_input1") == "eduler11") {

setScreen("screen3");

} else {

showElement("label1");

});

Output:-
Practical:- 6

Aim:- To implement a quiz game in code.org

Code:-
var score = 0;
onEvent("button_start", "click", function( ) {
setScreen("quiz");
});
onEvent("dropdown1", "change", function( ) {
setScreen("quiz");
});
onEvent("radio_cat", "click", function( ) {
showElement("button_next1");
});
onEvent("radio_dog", "click", function( ) {
showElement("button_next1");
});
onEvent("button_next1", "click", function( ) {
setScreen("quiz2");
});
onEvent("radio_pushups", "click", function( ) {
showElement("button_next2");
});
onEvent("radio_jumping_jacks", "click", function( ) {
showElement("button_next2");
});
onEvent("button_next2", "click", function( ) {
setScreen("quiz3");
});
onEvent("button_true", "click", function( ) {
showElement("button_next3");
score = score;
});
onEvent("button_false", "click", function( ) {
score = score + 1;
showElement("button_next3");
});
onEvent("button_next3", "click", function( ) {
setScreen("quiz4");
});
onEvent("button_true2", "click", function( ) {
score = score + 1;
showElement("button_next4");
});
onEvent("button_false2", "click", function( ) {
score = score;
showElement("button_next4");
});
onEvent("button_next4", "click", function( ) {
setScreen("screen_result");
setText("labelscore", score);
});
Output:

You might also like