Академический Документы
Профессиональный Документы
Культура Документы
BONAFIDE CERTIFICATE
________________________________
REGISTER NUMBER
1
Experimental Evaluation Summary
Name: Reg.No:
Class: Faculty:
4 Mobile Network
application(SMS/E-mail)
2
Ex.No:1 General Form Design
Date:
Coding:
ACTIVITYMAIN.XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="28dp"
android:text="STUDENT FORM"
android:textColor="#000000"
android:layout_marginLeft="80dp"
android:layout_marginTop="70dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="150dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="200dp"
android:id="@+id/name"
/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Department"
android:textColor="#000000"
3
android:textSize="25dp"
android:layout_marginTop="250dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="300dp"
android:id="@+id/department"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RegisterNumber"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="350dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="400dp"
android:id="@+id/regno"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CGPA"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="450dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="500dp"
android:id="@+id/cgpa"
/>
<Button
android:layout_width="110dp"
android:layout_height="50dp"
android:layout_marginTop="600dp"
android:text="Submit"
4
android:layout_marginLeft="150dp"
android:onClick="Submit"
/>
</RelativeLayout>
ACTIVITY_DISPLAY.XML
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Department"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="250dp"
/>
<TextView
android:layout_width="match_parent"
5
android:layout_height="wrap_content"
android:layout_marginTop="300dp"
android:id="@+id/ddepartment"
android:textSize="25dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RegisterNumber"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="350dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="400dp"
android:id="@+id/dregno"
android:textSize="25dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CGPA"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="450dp"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="500dp"
android:id="@+id/dcgpa"
android:textSize="25dp"
/>
</RelativeLayout>
MAINACTIVITY.JAVA
package com.stn.formsstn;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.EditText;
6
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Studentname=findViewById(R.id.name);
Studentdept=findViewById(R.id.department);
Studentregno = findViewById(R.id.regno);
Studentcgpa = findViewById(R.id.cgpa);
}
i.putExtra("name",sname);
i.putExtra("dept",sdept);
i.putExtra("regno",sregno);
i.putExtra("cgpa",scgpa);
startActivity(i);
}
DISPLAYACTIVITY.JAVA
package com.stn.formsstn;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
tv1.setText(""+getIntent().getStringExtra("name"));
7
tv2.setText(""+getIntent().getStringExtra("dept"));
tv3.setText(""+getIntent().getStringExtra("regno"));
tv4.setText(""+getIntent().getStringExtra("cgpa"));
}
}
Output
8
EVALUATION
Faculty Signature
RESULT:
Thus the general form design program is executed successfully in Android studio.
9
Ex.No:2 Name: Mobile browser based interactive application
Date:
Aim: To design the Mobile browser based interactive application in Android studio.
Coding:
• Include Internet permission, to access the internet feature of the mobile. Add this permission
above the <application >tag.
<uses-permission android:name="android.permission.INTERNET"/>
ANDROIDMANIFEST.XML
10
android:onClick="google"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2.Facebook"
android:textColor="#000000"
android:layout_marginLeft="70dp"
android:layout_marginTop="150dp"
android:onClick="facebook"
/>
</RelativeLayout>
ACTIVITY_FACEBOOK.XML
ACTIVITY_GOOGLE.XML
11
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/w1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:usesCleartextTraffic="true"
/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
MAINACTIVITY.JAVA
package com.stn.exp2;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity
{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void google(View v)
{
Intent i = new Intent(MainActivity.this,google.class);
startActivity(i);
}
12
FACEBOOK.JAVA
package com.stn.exp2;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_twitter);
WebView mywebview2=(WebView)findViewById(R.id.w3);
mywebview2.loadUrl("https://www.facebook.com");
}
}
GOOGLE.JAVA
package com.stn.exp2;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_twitter);
WebView mywebview2=(WebView)findViewById(R.id.w3);
mywebview2.loadUrl("https://www.google.com");
}}
Output :
13
EVALUATION
Faculty Signature
RESULT:
Thus the Mobile browser based interactive application program is executed successfully in Android
studio.
14
Ex.No:3 Application using Controls (Simple Calculator)
Date:
ACTIVITYMAIN.XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Calculator"
android:textStyle="bold"
android:textColor="#000000"
android:textAllCaps="true"
android:textSize="25dp"
android:layout_marginLeft="60dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="Enter the first number"
android:layout_marginTop="60dp"
android:textAllCaps="true"
android:textStyle="bold"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="80dp"
android:id="@+id/firstnumber"
/>
<TextView
15
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="Enter the Second number"
android:layout_marginTop="150dp"
android:textAllCaps="true"
android:textStyle="bold"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="190dp"
android:id="@+id/secondnumber"
/>
<Button
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="250dp"
android:id="@+id/plus"
android:text="+"
android:textStyle="bold"
android:textSize="20dp"
android:onClick="addition"
/>
<Button
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="250dp"
android:layout_marginLeft="70dp"
android:id="@+id/minus"
android:text="-"
android:textStyle="bold"
android:textSize="20dp"
android:onClick="subtraction"
/>
<Button
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="250dp"
android:layout_marginLeft="140dp"
android:id="@+id/star"
android:text="*"
android:textStyle="bold"
android:textSize="20dp"
android:onClick="multiply"
/>
16
<Button
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="250dp"
android:layout_marginLeft="210dp"
android:id="@+id/slash"
android:text="/"
android:textStyle="bold"
android:textSize="20dp"
android:onClick="divide"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Result is"
android:textColor="#000000"
android:textStyle="bold"
android:layout_marginTop="420dp"
android:textAllCaps="true"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="450dp"
android:id="@+id/result" />
</RelativeLayout>
MainActivity.java
package com.stn.exp3;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
num1=findViewById(R.id.firstnumber);
num2=findViewById(R.id.secondnumber);
17
res=findViewById(R.id.result);
}
public void subtraction(View view)
{
int n1 = Integer.parseInt(num1.getText().toString());
int n2 = Integer.parseInt(num2.getText().toString());
int n3;
n3=n1-n2;
res.setText(Integer.toString(n3));
}
public void multiply(View view)
{
int n1 = Integer.parseInt(num1.getText().toString());
int n2 = Integer.parseInt(num2.getText().toString());
int n3;
n3=n1*n2;
res.setText(Integer.toString(n3));
}
public void divide(View view)
{
int n1 = Integer.parseInt(num1.getText().toString());
int n2 = Integer.parseInt(num2.getText().toString());
int n3;
n3=n1/n2;
res.setText(Integer.toString(n3)) }}}
18
OUTPUT
19
EVALUATION
Faculty Signature
RESULT:
Thus the applications using controls program is executed successfully in Android studio.
20
Ex.No:4 Sending SMS to Android
Date:
Coding
• Include Internet permission, to access the internet feature of the mobile. Add this permission
above the <application >tag.
<uses-permission android:name="android.permission.SEND_SMS"/>
ANDROIDMANIFEST.XML
ACTIVITYMAIN.XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SMS SENDER"
android:textSize="30dp"
android:textStyle="bold"
android:textColor="#000000"
android:layout_marginLeft="100dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Contact number"
android:textColor="#000000"
android:textSize="25dp"
21
android:textStyle="bold"
android:layout_marginTop="100dp”
/>
<EditText
android:id="@+id/contactnumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="phone"
android:layout_marginTop="130dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter the message"
android:textColor="#000000"
android:textSize="25dp"
android:textStyle="bold"
android:layout_marginTop="200dp"
/>
<EditText
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginTop="250dp"
/>
<Button
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_marginTop="350dp"
android:layout_marginLeft="100dp"
android:text="SEND"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="20dp"
android:id="@+id/sendbtn"
android:onClick="sendmsg"
/>
</RelativeLayout>
ACTIVTYMAIN.JAVA
package com.stn.exp4;
import android.Manifest;
import android.content.pm.PackageManager;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.telephony.SmsManager;
22
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
CN=(EditText)findViewById(R.id.contactnumber);
Msg=(EditText)findViewById(R.id.message);
send=(Button)findViewById(R.id.sendbtn);
send.setEnabled(false); //disable the button
if(checkpermission(Manifest.permission.SEND_SMS))
{
send.setEnabled(true);
}
else
{
ActivityCompat.requestPermissions(this,new
String[]{Manifest.permission.SEND_SMS},SEND_SMS_PERMISSION_REQUEST_CODE);
}
}
public void sendmsg(View view)
{ String scn = CN.getText().toString();
String smsg = Msg.getText().toString();
if(scn.length()==0 || smsg.length()==0)
{
Toast.makeText(this,"Fill all columns",Toast.LENGTH_LONG).show();
return;
}
if(checkpermission(Manifest.permission.SEND_SMS)) {
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(scn, null, smsg, null, null);
Toast.makeText(this, "Message sent Successfully", Toast.LENGTH_LONG).show();
}else
{
Toast.makeText(this, "Error in sending message ", Toast.LENGTH_LONG).show();
}
}
public boolean checkpermission(String permission)
{
int check = ContextCompat.checkSelfPermission(this,permission);
return (check == PackageManager.PERMISSION_GRANTED);
23
}
}
OUTPUT
24
EVALUATION
Faculty Signature
RESULT:
Thus the applications using controls program is executed successfully in Android studi
25
Ex.No:5 Application using Data retrieval
Date:
Aim: To design the Application using Data retrieval to Android in Android studio.
Step 2: Register your app with Firebase.After you have a Firebase project, you can add your Android
app to it.In the center of the Firebase console's project overview page, click the Android icon to
Step 3: Enter your app's package name in the Android package name field.Make sure that you
Packagename that your app is actually using.Find this package name in manifest.Click Register app.
Step 4: Click Download google-services.json to obtain your Firebase Android config file (google-
Step5: Add the following dependencies to the android project in bulid.gradle(Module:app) folder.
implementation 'com.google.firebase:firebase-database:17.0.0'
implementation 'com.google.firebase:firebase-database:17.0.0'
//predefined code}
26
ActivityMain.xml
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="28dp"
android:text="STUDENT FORM"
android:textColor="#000000"
android:layout_marginLeft="80dp"
android:layout_marginTop="70dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="150dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="200dp"
android:id="@+id/name"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Department"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="250dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
27
android:layout_marginTop="300dp"
android:id="@+id/department"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RegisterNumber"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="350dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="400dp"
android:id="@+id/regno"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CGPA"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="450dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="500dp"
android:id="@+id/cgpa"
/>
<Button
android:layout_width="110dp"
android:layout_height="50dp"
android:layout_marginTop="600dp"
android:text="Submit"
android:layout_marginLeft="150dp"
android:onClick="submit"
/>
</RelativeLayout>
28
MainActivity.java
package com.stn.exp5;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.stn.exp5.R;
EditText Studentname;
EditText Studentdep;
EditText Studentregno;
EditText Studentcgpa;
DatabaseReference databaseReference;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
databaseReference = FirebaseDatabase.getInstance().getReference("student");
Studentname = (EditText)findViewById(R.id.name);
Studentdep = (EditText)findViewById(R.id.department);
Studentregno = (EditText)findViewById(R.id.regno);
Studentcgpa=(EditText)findViewById(R.id.cgpa);
if(!TextUtils.isEmpty(sname)) {
Student student = new Student(sname, sdep, sregno, scgpa);
databaseReference.setValue(student);
Toast.makeText(getApplicationContext(),"Successfull",Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(getApplicationContext(),"UnSuccessfull",Toast.LENGTH_LONG).show();
29
} }
}
Student.java
package com.stn.exp5;
public Student() {
}
30
OUTPUT
31
AFTER ADDING DATA
32
EVALUATION
Faculty Signature
RESULT:
Thus the applications using data retrieval program is executed successfully in Android studio.
33
Ex.No:6 Launching service in a mobile phone
Date:
AndroidManifest.xml
• Include Location permission, to access the Location feature of the mobile. Add this
permission above the <application >tag.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application>
//predefined code
</application>
</manifest>
build.gradle(Module:app)
• To include Play services feature ,we have to include the following dependency
implementation 'com.google.android.gms:play-services:11.0.1'
dependencies {
//predefined code
implementation 'com.google.android.gms:play-services:11.0.1'
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GETTING LOCATION SERVICES"
34
android:textStyle="bold"
android:textColor="#000000"
android:layout_marginTop="30dp"
android:layout_marginLeft="50dp"
android:textSize="20dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="200dp"
android:layout_marginLeft="70dp"
android:textSize="15dp"
android:textStyle="bold"
android:id="@+id/location"
/>
<Button
android:layout_width="150dp"
android:layout_height="75dp"
android:text="Get location"
android:layout_marginTop="290dp"
android:layout_marginLeft="110dp"
android:onClick="getlocation"
/>
</RelativeLayout>
MainActivity.java
package com.stn.exp6;
import android.Manifest;
import android.content.pm.PackageManager;
import android.location.Location;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.tasks.OnSuccessListener;
35
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
client = LocationServices.getFusedLocationProviderClient(this);
requestPermission();
}
public void getlocation(View view) {
if (ActivityCompat.checkSelfPermission(MainActivity.this, ACCESS_FINE_LOCATION) !=
PackageManager.PERMISSION_GRANTED ) {
return;
}
client.getLastLocation().addOnSuccessListener(MainActivity.this, new
OnSuccessListener<Location>() {
@Override
public void onSuccess(Location location) {
if(location!=null)
{
Location=(TextView)findViewById(R.id.location);
Location.setText(location.toString());
}
}
});
}
36
OUTPUT
37
EVALUATION
Faculty Signature
RESULT:
38
Ex.No:7 Web port development
Date:
Step 2: Register your app with Firebase.After you have a Firebase project, you can add your Android
app to it.In the center of the Firebase console's project overview page, click the Android icon to
Step 3: Enter your app's package name in the Android package name field.Make sure that you
Packagename that your app is actually using.Find this package name in manifest.Click Register app.
Step 4: Click Download google-services.json to obtain your Firebase Android config file (google-
Step5: Add the following dependencies to the android project in bulid.gradle(Module:app) folder.
implementation 'com.google.firebase:firebase-database:17.0.0'
implementation 'com.google.firebase:firebase-database:17.0.0'
//predefined code}
39
ACTIVITY MAIN.XML:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Web Portal"
android:textColor="#000000"
android:textSize="40dp"
android:textStyle="bold|italic"
android:layout_marginTop="220dp"
android:layout_marginLeft="80dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1 Makeup Registration"
android:textSize="30dp"
android:textColor="#000000"
android:layout_marginLeft="40dp"
android:layout_marginTop="300dp"
android:onClick="makeup"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2 Arrear Registration"
android:textSize="30dp"
android:textColor="#000000"
android:layout_marginLeft="40dp"
android:layout_marginTop="360dp"
android:onClick="arrear"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3 Course Registration"
40
android:textSize="30dp"
android:textColor="#000000"
android:layout_marginLeft="40dp"
android:layout_marginTop="420dp"
android:onClick="course"
/>
</RelativeLayout>
ACTIVITY_MAKEUP.XML
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="27dp"
android:text="Makeup Registration"
android:textColor="#000000"
android:layout_marginLeft="50dp"
android:layout_marginTop="40dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="120dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="160dp"
android:id="@+id/mkname"
/>
<TextView
41
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Department"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="220dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="270dp"
android:id="@+id/mkdepartment"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RegisterNumber"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="320dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="370dp"
android:id="@+id/mkregno"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="No.of.Makeup"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="420dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="470dp"
android:id="@+id/mkcount"
/>
42
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="List of Makeup"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="520dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="570dp"
android:id="@+id/mklist"
/>
<Button
android:layout_width="150dp"
android:layout_height="75dp"
android:text="Register"
android:layout_marginTop="640dp"
android:layout_marginLeft="120dp"
android:onClick="mkregister"
/>
</RelativeLayout>
</ScrollView>
ACTIVITY_ARREAR.XML
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
43
android:layout_height="wrap_content"
android:textSize="27dp"
android:text="Arrear registration"
android:textColor="#000000"
android:layout_marginLeft="50dp"
android:layout_marginTop="40dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="120dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="160dp"
android:id="@+id/arrname"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Department"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="220dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="270dp"
android:id="@+id/arrdepartment"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RegisterNumber"
44
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="320dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="370dp"
android:id="@+id/arrregno"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="No.of.Arrears"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="420dp" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="470dp"
android:id="@+id/arrearcount"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="List of Arrears"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="520dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="570dp"
android:id="@+id/arrearlist"
/>
<Button
android:layout_width="150dp"
android:layout_height="75dp"
android:text="Register"
android:layout_marginTop="640dp"
android:layout_marginLeft="120dp"
android:onClick="arrearregister"
45
/>
</RelativeLayout>
</ScrollView>
ACTIVITY_COURSE.XML
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="27dp"
android:text="Course registration"
android:textColor="#000000"
android:layout_marginLeft="50dp"
android:layout_marginTop="40dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="120dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="160dp"
android:id="@+id/crname"
/>
46
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Department"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="220dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="270dp"
android:id="@+id/crdepartment"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RegisterNumber"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="320dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="370dp"
android:id="@+id/crregno"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Subjects/semester"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="420dp"
/>
47
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="470dp"
android:id="@+id/crcount"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="List of Subjects"
android:textColor="#000000"
android:textSize="25dp"
android:layout_marginTop="520dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="570dp"
android:id="@+id/crlist"
/>
<Button
android:layout_width="150dp"
android:layout_height="75dp"
android:text="Register"
android:layout_marginTop="640dp"
android:layout_marginLeft="120dp"
android:onClick="courseregister"
/>
</RelativeLayout>
</ScrollView>
MAINACTIVITY.JAVA
package com.stn.exp7;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
48
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
GETTER.JAVA
package com.stn.exp7;
public Getter() {
}
49
public String getName() {
return name;
}
MAKEUP.JAVA
package com.stn.exp7;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_makeup);
MKNAME=(EditText)findViewById(R.id.mkname);
MKDEP=(EditText)findViewById(R.id.mkdepartment);
MKREG=(EditText)findViewById(R.id.mkregno);
MKCOUNT=(EditText)findViewById(R.id.mkcount);
MKLIST=(EditText)findViewById(R.id.mklist);
}
50
public void mkregister(View view)
{
String name=MKNAME.getText().toString();
String dep=MKDEP.getText().toString();
String reg=MKREG.getText().toString();
String count=MKCOUNT.getText().toString();
String list=MKLIST.getText().toString();
reference= FirebaseDatabase.getInstance().getReference("Makeup Registration").child(name);
if(!TextUtils.isEmpty(name))
{
Getter gt =new Getter(name,dep,count,list);
reference.setValue(gt);
Toast.makeText(getApplicationContext(),"Registration
Successful",Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(getApplicationContext(),"Registration
Failed",Toast.LENGTH_LONG).show();
}
}
ARREAR.JAVA
package com.stn.exp7;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
ARRNAME=(EditText)findViewById(R.id.arrname);
ARRDEP = (EditText)findViewById(R.id.arrdepartment);
ARRREG = (EditText)findViewById(R.id.arrregno);
ARRCOUNT = (EditText)findViewById(R.id.arrearcount);
ARRLIST = (EditText)findViewById(R.id.arrearlist);
}
if(!TextUtils.isEmpty(name))
{
Getter gt = new Getter(name,dep,count,list);
reference.setValue(gt);
Toast.makeText(getApplicationContext(),"ArrearRegistrationSuccessful",Toast.LENGTH_LONG)
.show();
}
else
{
Toast.makeText(getApplicationContext(),"FAILED",Toast.LENGTH_LONG).show();
}
}
}
COURSE.JAVA
package com.stn.exp7;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
52
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
CRNAME = (EditText)findViewById(R.id.crname);
CRDEP=(EditText)findViewById(R.id.crdepartment);
CRREG=(EditText)findViewById(R.id.crregno);
CRCOUNT =(EditText)findViewById(R.id.crcount);
CRLIST =(EditText)findViewById(R.id.crlist);
if(!TextUtils.isEmpty(name)) {
Getter gt = new Getter(name, dep, count, list);
reference.setValue(gt);
Toast.makeText(getApplicationContext(),"Registration
successfull",Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(getApplicationContext(),"Registration
Failed",Toast.LENGTH_LONG).show();
}
}
}
53
OUTPUT
54
EVALUATION
Faculty Signature
RESULT:
Thus the web port development program is executed successfully in Android studio.
55
Ex.No:8 video application
Date:
Now that we’ve created the app and its initial files let’s make a few changes to the layout to
accommodate our video conversations.
<android.support.design.widget.FloatingActionButton
android:id="@+id/call_action_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@android:drawable/ic_menu_call"
app:backgroundTint="@android:color/holo_green_dark"/>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.twilio.twiliovideo.MainActivity"
tools:showIn="@layout/activity_main">
56
<FrameLayout
android:id="@+id/previewFrameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<LinearLayout
android:id="@+id/videoLinearLayout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/localContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"/>
<RelativeLayout
android:id="@+id/participantContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"/>
</LinearLayout>
</RelativeLayout>
In order to get access to the device’s camera, we need to install and initialise the Twilio SDK. To
install it, change TwilioVideo/app/build.gradle to have the following added to it:
repositories{
57
// Twilio Maven repository - currently required for TwilioCommon
maven{
url"http://media.twiliocdn.com/sdk/maven/"
dependencies{
compilefileTree(dir:'libs',include:['*.jar'])
testCompile'junit:junit:4.12'
compile'com.android.support:appcompat-v7:23.2.0'
compile'com.android.support:design:23.2.0'
compile'com.twilio:conversations-android:0.8.1'
compile'com.squareup.okhttp3:okhttp:3.1.2'
At this point Android Studio will tell you that “Gradle files have changed since last project sync”.
Click Sync Now, and all the dependencies will be downloaded and properly referenced.
<uses-featureandroid:name="android.hardware.camera"/>
<uses-featureandroid:name="android.hardware.camera.autofocus"/>
<uses-permissionandroid:name="android.permission.CAMERA"/>
<uses-permissionandroid:name="android.permission.INTERNET"/>
<uses-permissionandroid:name="android.permission.RECORD_AUDIO"/>
<uses-permissionandroid:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permissionandroid:name="android.permission.ACCESS_WIFI_STATE"/>
<application
58
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"Open TwilioVideo/app/src/main/java/com/twilio/twiliovideo/
MainActivity.java and create a condition to check that the permissions have indeed been given. We
can do that by creating a couple of new methods inside the class to check and then request when the
permissions have not been granted.
We can also remove some of the unnecessary methods in this class so it looks like the following
code.
publicclassMainActivityextendsAppCompatActivity{
@Override
protectedvoidonCreate(BundlesavedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
privatebooleancheckPermissionForCameraAndMicrophone(){
intresultCamera=ContextCompat.checkSelfPermission(this,Manifest.permission.CAMERA);
intresultMic=ContextCompat.checkSelfPermission(this,Manifest.permission.RECORD_AUDIO);
return(resultCamera==PackageManager.PERMISSION_GRANTED)&&(resultMic==PackageMana
ger.PERMISSION_GRANTED);
privatevoidrequestPermissionForCameraAndMicrophone(){
if(ActivityCompat.shouldShowRequestPermissionRationale(this,Manifest.permission.CAMERA)||A
ctivityCompat.shouldShowRequestPermissionRationale(this,Manifest.permission.RECORD_AUDIO
)){
Toast.makeText(this,"Camera and Microphone permissions needed. Please allow in App Settings for
additional functionality.",Toast.LENGTH_LONG).show();
}else{
ActivityCompat.requestPermissions(this,newString[]{Manifest.permission.CAMERA,Manifest.perm
ission.RECORD_AUDIO},1);
59
}We’re now going to add a few member variables to the class, and replace the whole
of onCreate with the following.
privateStringmAccessToken;
privatestaticfinalStringTAG=MainActivity.class.getName();
/*
*/
privateFrameLayoutpreviewFrameLayout;
privateViewGrouplocalContainer;
privateViewGroupparticipantContainer;
privateFloatingActionButtoncallActionFab;
privateOkHttpClientclient=newOkHttpClient();
privateTwilioAccessManageraccessManager;
privateConversationsClientconversationsClient;
privateCameraCapturercameraCapturer;
privateConversationconversation;
privateOutgoingInviteoutgoingInvite;
privateContextmContext;
/*
* A VideoViewRenderer receives frames from a local or remote video track and renders the frames
to a provided view
*/
privateVideoViewRendererparticipantVideoRenderer;
privateVideoViewRendererlocalVideoRenderer;
@Override
protectedvoidonCreate(BundlesavedInstanceState){
60
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mContext=this.getApplicationContext();
/*
*/
if(!checkPermissionForCameraAndMicrophone()){
requestPermissionForCameraAndMicrophone();
/*
*/
previewFrameLayout=(FrameLayout)findViewById(R.id.previewFrameLayout);
localContainer=(ViewGroup)findViewById(R.id.localContainer);
participantContainer=(ViewGroup)findViewById(R.id.participantContainer);
getCapabilityToken();
}This will make use of our new permission methods to check whether access to the camera and
microphone have been granted, then create references to our layout widgets which we will use later
on. Lastly, it will make a call to the method getCapabilityToken which we’re just about to create.
Very soon you will be wondering which are the correct imports to use because you will have a lot of
red squiggles under your code. To make things easier, just copy all the imports from this file and
replace what you currently have.
In MainActivity.java create a new method called getCapabilityToken inside the class. This will make
use of our ngrok URL.
61
privatevoidgetCapabilityToken(){
try{
run("http://[your-ngrok-url].ngrok.io/token",newCallback(){
@Override
publicvoidonFailure(Callcall,IOExceptione){
e.printStackTrace();
@Override
publicvoidonResponse(Callcall,Responseresponse)throwsIOException{
try{
Stringtoken=response.body().string();
JSONObjectobj=newJSONObject(token);
mAccessToken=obj.getString("token");
Log.d(TAG,token);
initializeTwilioSdk(mAccessToken);
}catch(Exceptione){
e.printStackTrace();
});
}catch(IOExceptione){
e.printStackTrace();
privateCallrun(Stringurl,Callbackcallback)throwsIOException{
62
Requestrequest=newRequest.Builder()
.url(url)
.build();
Callresponse=client.newCall(request);
response.enqueue(callback);
returnresponse;
}Notice that we have also created a method called run, which uses OkHttp – one of our dependencies
– to make an HTTP request to our backend application. Make sure you replace the contents of [your-
ngrok-url] with the URL you got from ngrok.
The new method overrides OnResponse with a call to initializeTwilioSDK which we will create in a
minute. That method will only be called when we get a response from the server with a capability
token.
privatevoidinitializeTwilioSdk(finalStringaccessToken){
TwilioConversations.setLogLevel(TwilioConversations.LogLevel.DEBUG);
if(!TwilioConversations.isInitialized()){
TwilioConversations.initialize(this.mContext,newTwilioConversations.InitListener(){
@Override
63
publicvoidonInitialized(){
accessManager=TwilioAccessManagerFactory.createAccessManager(accessToken,accessManagerLi
stener());
conversationsClient=TwilioConversations.createConversationsClient(accessManager,conversationsC
lientListener());
conversationsClient.setAudioOutput(AudioOutput.SPEAKERPHONE);
cameraCapturer=CameraCapturerFactory.createCameraCapturer(MainActivity.this,CameraCapturer.
CameraSource.CAMERA_SOURCE_FRONT_CAMERA,previewFrameLayout,capturerErrorListen
er());
startPreview();
conversationsClient.listen();
@Override
publicvoidonError(Exceptione){
Toast.makeText(MainActivity.this,
Toast.LENGTH_LONG).show();
});
}There are four important things to notice on the code above. We first get access to
the TwilioAccessManager interface which will authenticate the application using the capability token
we got earlier and listen to any expirations or errors on that. Once we have that, we pass this
information to a listener.
64
Once the conversation is established we get access to the camera and when that’s granted, we start
previewing it to the screen.
Let’s add these event listeners to the bottom of the class and a method to start and stop previewing
the camera on the screen. We will bind the camera to the previewFrameLayout we created earlier.
privateTwilioAccessManagerListeneraccessManagerListener(){
returnnewTwilioAccessManagerListener(){
@Override
publicvoidonAccessManagerTokenExpire(TwilioAccessManagertwilioAccessManager){
@Override
publicvoidonTokenUpdated(TwilioAccessManagertwilioAccessManager){
@Override
publicvoidonError(TwilioAccessManagertwilioAccessManager,Strings){
};
privateConversationsClientListenerconversationsClientListener(){
returnnewConversationsClientListener(){
@Override
publicvoidonStartListeningForInvites(ConversationsClientconversationsClient){
@Override
publicvoidonStopListeningForInvites(ConversationsClientconversationsClient){
@Override
65
publicvoidonFailedToStartListening(ConversationsClientconversationsClient,TwilioConversationsE
xceptione){
@Override
publicvoidonIncomingInvite(ConversationsClientconversationsClient,IncomingInviteincomingInvite
){
@Override
publicvoidonIncomingInviteCancelled(ConversationsClientconversationsClient,IncomingInviteinco
mingInvite){
};
privateCapturerErrorListenercapturerErrorListener(){
returnnewCapturerErrorListener(){
@Override
publicvoidonError(CapturerExceptione){
};
privatevoidstartPreview(){
cameraCapturer.startPreview();
privatevoidstopPreview(){
if(cameraCapturer!=null&&cameraCapturer.isPreviewing()){
cameraCapturer.stopPreview();
66
}
OUTPUT
EVALUATION
Faculty Signature
RESULT:
67
Ex.No:9 Name: Application using iphone SDK framework
Date:
Procedure:
Framework Set Up
In Xcode 6, Apple introduced the Cocoa Touch Framework template along with access control, so
creating frameworks has never been easier. The first thing to do is to create the project for the
framework.
Choose iOS -> Framework & Library -> Cocoa Touch Framework.
Click Next.
Set the Product Name to KnobControl. Use your own Organization Name and Organization
Identifier.
68
Click Next.
In the file chooser, choose to create the project at the same level as the KnobShowcase root
folder.
Click Create.
Now you have a project (albeit a boring one) that creates a framework!
Add Code
Your current state is a framework without code, and that is about as appealing as straight chocolate
without sugar. In this section, you’ll introduce code by adding the existing files to the framework.
69
From the KnobShowcase source directory, drag the Knob.swift file into the KnobControl project in
Xcode. Make sure to check Copy items if needed so that the files actually copy into the new project
instead of just adding a reference. Frameworks need their own code, not references, to be
independent.
Double-check that Knob.swift has Target Membership in KnobControl to make sure it appears in the
final framework. You can verify this in the File inspector.
70
Build the framework project to make sure that you get Build Succeeded with no build warnings or
errors. If you read the How to Make a Custom Control tutorial, you may recall Knob.swift contains
three different classes:
Your next task is to separate those components into different files. Start by moving KnobRenderer:
1. Go to File -> New -> File… and select iOS -> Source -> Swift File.
2. Click Next.
3. On the next screen, specify the class name as KnobRenderer and choose the KnobControl ->
KnobControl directory.
4. Click Create.
5. Open Knob.swift, cut (Command-X) the entire KnobRenderer class and paste it (Command-
V) into KnobRenderer.swift just below the import Foundation statement.
6. Remove the private modifier for KnobRenderer. When the code was all contained
in Knob.swift this was fine, but now it must be accessible throughout the module with the
default internal modifier.
Repeat steps 1 to 6 for the RotationGestureRecognizer class. In this case, when you perform the fifth
step, make sure you also grab the import UIKit.UIGestureRecognizerSubclass statement, otherwise
the compiler will complain during the build phase.
With your two new files created, Knob.swift now only contains the Knob class.
71
Note: Separating classes into their own files is not strictly necessary, but it’s a good practice in order
to make your code organized. You don’t want to have a huge file that is hard to comprehend and
maintain.
Build the project, and you’ll see several predictable errors where Xcode complains about not
knowing what the heck a Knob is. Well, you’ll actually see Use of undeclared type ‘Knob’ error
message.
Adding the KnobControl framework project is the solution to these problems.Embed Your Binary
Right-click on the root KnobShowcase node in the project navigator. Click Add Files to
“KnobShowcase”. In the file chooser, navigate to and select KnobControl.xcodeproj. Click Add to
add KnobControl.xcodeproj as a sub-project.
72
Note: It isn’t strictly necessary to add the framework project to the app project; you could just add
the KnobControl.framework output.
However, combining the projects makes it easier to develop both the framework and app
simultaneously. Any changes you make to the framework project are automatically propagated up to
the app. It also makes it easier for Xcode to resolve the paths and know when to rebuild the project.
Build and run, and you’ll see that same compile error!
Even though the two projects are now together, KnobShowcase still doesn’t get KnobControl. It’s
like they’re sitting in the same room, but KnobShowcase can’t see the new framework.
You’ll link the framework to the app’s target to fix this problem. First, expand
the KnobControl project to see the Products folder, and then look
for KnobControl.framework beneath it. This file is the output of the framework project that packages
up the binary code, headers, resources and metadata.
73
Select the top level KnobShowcase node to open the project editor. Click the KnobShowcase target,
and then go to the General tab.
You just added an entry for the framework in both Embedded Binaries and Linked Frameworks and
Binaries.
74
Ex.No:10 Testing the application using emulator
Date:
Aim: To study for testing the application using emulator in iOS environment.
Procedure:
Mobile web testing can be challenging because of a variety of mobile devices, platforms and screen sizes.
Test Complete addresses this challenge by letting you test mobile web applications using an emulator
with preconfigured phone and tablet browser profiles. You do not need real devices for testing, which
simplifies your testing setup and maintenance.
Web developers use various techniques to make mobile web applications compatible with different
mobile devices and screen sizes. For example:
• Responsive web design lets web sites adapt the page layout to various screen sizes.
Testing helps verify that your mobile web site application looks and works fine on various devices.
Using Test Complete, you can record automated tests in the mobile browser emulator and play them back
using different browser profiles. This way you can –
• Create and run functional tests for a web application’s business logic.
• Verify that a web site with mobile device detection returns the correct content to different
devices.
Mobile web testing with Test Complete is similar to testing regular (non-mobile) web sites, with a few
exceptions described. For example, Test Complete uses the same test objects, methods and properties for
both mobile and non-mobile browsers, web pages and web page elements. If necessary, see the following
topics first to get a general understanding of how to perform web testing with Test Complete:
• User agent – The string that identifies the browser to web servers. It includes the browser version,
operating system and its version, and other information. The user agent makes the web sites
“think” they are viewed on a mobile device. As a result, web sites return mobile content even
though you test on a desktop computer.
75
• Browser screen size and device pixel ratio (to emulate Retina displays).
Test Complete includes predefined mobile browser profiles for Apple iPhone, iPad, Google Nexus,
Samsung Galaxy, and other devices.
1. (Optional.) Add custom mobile devices you want to test your site with.
• Select a mobile browser profile from the Run App | Virtual Browser drop-down list on
the Recording toolbar. Test Complete will launch the emulator with the selected profile.
76
• Open your tested web site in the mobile browser emulator.
• Perform test actions (navigate through web pages, fill out forms and so on) and
create checkpoints for the tested web site.
4. Run the test to make sure it passes. If needed, debug the test to find and fix the issues.
5. Configure the test so that it runs using all needed mobile browser profiles. For more information,
see Creating Cross-Browser Mobile Web Tests Using Emulator.
RESULT: Thus the testing for the application using emulator in iOS environment is studied.
77