Formula for conversation of the equivalent of CPI/CGPA
For GTU student find CPI/CGPA equivalent to the percentage The formula is given below.
Percentage
Marks = (CPI/CGPA-0.5) * 10
CPI/CGPA The class should be given by below ratio.
Below 5.5
Pass Class
5.5 &
Above
Second Class
6.5 &
Above
First Class
7.1 &
Above
First Class
With Distinction
Award Of Degree
For all Courses, where the duration of the course is two years, students may find them Percentage on the basis of the CPI Cumulative Performance Index). If the course Duration is three or more than three they may find the percentage on the basis Of the CGPA (Cumulative Grade Point Average).
All the GTU Student calculates CPI/CGPA to percentage in online using the given calculator.
Here I made one Simple CPI/CGPA To Percentage Online Converter/Calculator..
Screen Shot :
Exercise : 18 Create an application to make Insert , update ,
Delete and retrieve operation on the database. Screen Shot:
a. Create an UI such that , one screen have list of all the types
of cars.
b. On selecting of any car name, next screen should show Car details
like : name , launched date ,company name, images(using gallery) if available,
show different colors in which it is available. Screen Shot:
Exercise : 10 Create an application that will have spinner
with list of animation names. On selecting animation name , that animation
should affect on the images displayed below. Screen Shot:
XML : main.xml :
~> in this problem we make “anim” folder to res. Directory and create an xml file like following:
alpha.xml :
rotate.xml :
scale.xml :
spin.xml :
translate.xml :
JAVA : TenActivity.java
package kmn.Ten;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ImageView;
import android.widget.Spinner;
public class TenActivity extends Activity implements OnItemSelectedListener
{
/** @author Y@@D */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Spinner s = (Spinner)findViewById(R.id.spinner1);
s.setOnItemSelectedListener(this);
}
public void onItemSelected(AdapterView arg0, View arg1, int arg2,
long arg3)
{
ImageView i = (ImageView)findViewById(R.id.imageView1);
if(arg3==1)
{
Animation a = AnimationUtils.loadAnimation(this, R.anim.alpha);
i.startAnimation(a);
}
if(arg3==2)
{
Animation a = AnimationUtils.loadAnimation(this, R.anim.rotate);
i.startAnimation(a);
}
if(arg3==3)
{
Animation a = AnimationUtils.loadAnimation(this, R.anim.scale);
i.startAnimation(a);
}
if(arg3==4)
{
Animation a = AnimationUtils.loadAnimation(this, R.anim.spin);
i.startAnimation(a);
}
if(arg3==5)
{
Animation a = AnimationUtils.loadAnimation(this, R.anim.translate);
i.startAnimation(a);
}
}
public void onNothingSelected(AdapterView arg0)
{
}
}
Exercise : 9 Create a background application that will open
activity on specific time.
Screen Shot:
XML : main.xml :
JAVA :
MyService.java
package kmn.Nine;
import kmn.servicedemo.R;
import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;
import android.util.Log;
import android.widget.Toast;
public class MyService extends Service
{
/** @author Y@@D */
private static final String TAG = "MyService";
MediaPlayer player;
public IBinder onBind(Intent intent)
{
return null;
}
public void onCreate()
{
Toast.makeText(this, "My Service Created", Toast.LENGTH_LONG).show();
Log.d(TAG, "onCreate");
player = MediaPlayer.create(this, R.raw.braincandy);
player.setLooping(false); // Set looping
}
public void onDestroy()
{
Toast.makeText(this, "My Service Stopped", Toast.LENGTH_LONG).show();
Log.d(TAG, "onDestroy");
player.stop();
}
public void onStart(Intent intent, int startid)
{
Toast.makeText(this, "My Service Started", Toast.LENGTH_LONG).show();
Log.d(TAG, "onStart");
player.start();
}
}
a. Create spinner with strings taken from resource
folder(res >> value folder).
b. On changing spinner value, change image. Screen Shot:
XML : main.xml :
JAVA : SixActivity.java :
package kmn.Six;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.Toast;
import android.widget.AdapterView.OnItemSelectedListener;
public class SixActivity extends Activity implements OnItemSelectedListener
{
/** @author Y@@D */
Integer[] imageIDs =
{
R.drawable.keval1,
R.drawable.keval2,
R.drawable.keval3,
R.drawable.keval4,
R.drawable.keval5
};
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Spinner s = (Spinner)findViewById(R.id.spinner1);
s.setOnItemSelectedListener(this);
}
public void onItemSelected(AdapterView arg0, View arg1, int arg2,
long arg3)
{
Toast.makeText(this, "Selected Item is = "+ arg0.getSelectedItem().toString(), Toast.LENGTH_SHORT).show();
ImageView i = (ImageView)findViewById(R.id.imageView1);
i.setImageResource(imageIDs[arg2]);
}
public void onNothingSelected(AdapterView arg0)
{
}
}
Exercise : 5 Create an application
that will pass some number to the next screen , and on the next screen that number
of items should be display in the list. Screen Shot:
XML : main.xml :
main1.xml :
JAVA : FifthActivity.java :
package kmn.Fifth;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class FifthActivity extends Activity implements OnClickListener
{
/** @author Y@@D */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button b = (Button)findViewById(R.id.btnnext);
b.setOnClickListener(this);
}
public void onClick(View v)
{
Intent i = new Intent(this,S2.class);
EditText item = (EditText)findViewById(R.id.txtitem);
i.putExtra("item", item.getText().toString());
startActivity(i);
}
}
s2.java :
package kmn.Fifth;
import java.util.ArrayList;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
public class S2 extends ListActivity
{
/** @author Y@@D */
ArrayList arr=new ArrayList();
ArrayAdapter a;
int i=0;
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main1);
a = new ArrayAdapter(this,android.R.layout.simple_list_item_1 ,arr);
setListAdapter(a);
for(i=1; i<= Integer.parseInt(getIntent().getStringExtra("item")); i++)
{
arr.add("Item : "+i);
}
//Toast.makeText(this, "Welcome", Toast.LENGTH_LONG).show();
}
}
Exercise : 4 Create and Login
application as above . On successful login , open browser with any URL. Screen Shot:
XML : main.xml :
JAVA : FourthActivity.java :
package kmn.Fourth;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class FourthActivity extends Activity implements OnClickListener,TextWatcher
{
/** @author Y@@D */
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
EditText username = (EditText)findViewById(R.id.txtusername);
EditText password = (EditText)findViewById(R.id.txtpassword);
username.addTextChangedListener(this);
password.addTextChangedListener(this);
Button login = (Button)findViewById(R.id.btnlogin);
login.setOnClickListener(this);
}
public void onClick(View v)
{
Intent i= new Intent("android.intent.action.VIEW");
i.setData(Uri.parse("http://www.kevalnagaria.blogspot.com"));
startActivity(i);
}
public void afterTextChanged(Editable s)
{
EditText e = (EditText)findViewById(R.id.txtusername);
EditText p = (EditText)findViewById(R.id.txtpassword);
Button b = (Button)findViewById(R.id.btnlogin);
if(e.getText().toString().equals("keval") && p.getText().toString().equals("nagaria"))
{
b.setEnabled(true);
}
else
{
b.setEnabled(false);
}
}
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
int arg3) {
// TODO Auto-generated method stub
}
public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
// TODO Auto-generated method stub
}
}