Android Project
Android Project
PROJECT ALMANAC
Submitted By :
SHWETA DUBEY NETCAMP SUMMER TRAINNING
22190106 HRIT CAMPUS
:
CERTIFICATE
This is to Certify that this minor-project report “PROJECT
ALMANAC” based on ANDROID is submitted by SHWETA
DUBEY who carried out this project work under my supervision.
I approve this project for submission in the Bachelor of
Engineering & technology in the
Department of Computer Science & Engineering.
Affiliation
Mr. Santu Purkait
Director
Netcamp Solutions Private Limited
ACKNOWLEDGEMENT
As part of our AKTU (APJ Abdul Kalam Technical University), in the 4th
semester Training is required. We can either do it in company, or in a
university (domestic or abroad). This is the option I chose when the
opportunity was given to me .
So it is in the NETCAMP, IPEC Ghaziabad there I did my training. I was
under the tutelage of Mr. SANTU PURKAIT , Director (NETCAMP)
who offered me a project to do on an android application. Android is an
operating system for mobile devices.
OVERVIEW/OBJECTIVE:
This project was conducted in two stages: the first is to familiarize myself
with the development in android (development tools, coding
instructions, setting up the display). For the first part of my project, I
needed a topic that can be useful and accessible for me because of my
low skills in Java. Mr. SANTU proposed the idea of a mobile application to
create a app related to database and the authorized user can use its
programs. The application is consisting of a database that any student
can use it by signing up in it. In the second step the app consist of
calculator, music player, camera, quiz, web browser, light censor. These
all features and programs are included inside this application which can
be used by the users.
Improvement
Acknowledgements.........................................................................................................................3
Abstract............................................................................................................................................4
Introdution.......................................................................................................................................5
1.1 Android................................................................................................................................8
1.1.1 What is android?...............................................................................................................8
1.1.2 Specifications:...................................................................................................................8
1.1.3Characteristic of the market: ............................................................................................9
1.1.4. Why Android is better?....................................................................................................11
Conclusion........................................................................................................................................70
1.My project: How to create Android application.
1.1 Android
1.1.2Specifications:
This operating system is based on version 2.6 of linux, so it has a
monolithic system kernel, what means that all system function and
drivers are grouped into one block of code.
• Architecture:
Android consists of five layers:
-The Linux kernel 2.6-which includes useful drivers that allow for example
WIFI or Bluetooth.
-The library written in C and C + + that provide higher level functionality such
as an HTML engine, or a database (SQLite).
-A runtime environment for applications based on a virtual machine, made for
inefficient machines such as telephones. The aim is to translate JAVA in
machine language understood by Android. It comprises of DVM (Dalvik
virtual machine)
• Competitors
• Key partners
• Market share
• Applications
-Google Applications
-Android Market
This is an online software store to buy applications.
Developers who created applications can add them into the store, and these
applications can be downloaded by users, they can be both free and paid.
• Multitasking
Android allows multitasking in the sense that multiple applications can run
simultaneously.
With Task Manager it is possible view all running tasks and to switch from one to
another easily.
• SDK
The method that allows launching a program in java is not present in an application
android. This example is only the first of a long list. So, I'll try to explain what I had to
learn to use to create my first application which is the Task name Project ALMANAC .
Activity:
An activity is a user interface that allows the user to interact with the screen, to perform
actions.
For example, a text messaging application could have an activity that displays a list of
contacts to send messages. Once the contact is selected, activity could send information
to a second activity that could serve to send the message to the contact.
When an application is launched, what it displays is the result of an activity. At the code
level, for create an activity, you must create a class that extends the Activity class. An
activity has a required onCreate () method. It is the main method. To interact with the
program, through the activity, there must be something displayed, that is why the activity,
contains what is called views.
View:
a View is the basic building block for user interface components. A View occupies a
rectangular area on the screen. View is the base class for widgets, which are used to
create interactive UI components (buttons, text fields, etc.).There is different kinds of
views, for example a ListView is able to display only an interactive list of what you want
to display, while a WebView allows you to to display a web page. As said before, A view
occupies a rectangular area on the screen. To organize these rectangles on the screen,
there is a text file written in XML for every different screen.
Xml:
Here is an example:
In the previous example, here's an XML layout that uses a vertical Linear
Layout to hold a TextView and a Button. It will be possible to modify
attributes the elements in the activity class that use this XML file.
Intent:
An activity can of course start another one, even if it but to do this, it will need
a special object called Intent. Intent is basis description of an operation to be
performed. It can launch an Activity, send a broadcast Intent to any interested
Broadcast Receiver components, and communicate with a background Service.
Intent performs binding between the codes in different applications. It can be
thought of as the link between activities. It is possible to add some
information’s to an Intent, thanks to an object called bundle, that you add to
the intent thanks to the method:
Intent.putExtras(Bundle objetbundle );
Android Manifest:
AndroidManifest.xml file is necessary for all android applications and must
have this name in its root directory. In the manifest you can find essential
information’s about the application for the Android system, information’s that
the system must have before it can run any of the application's code. Here is
what you can find in the Android manifest:
-The name of the Java package for the application. The package name serves
as a unique identifier for the application.
-The description of the components of the application: the activities, services,
broadcast receivers, and content providers that the application is composed of
and under what conditions they can be launched .
-The processes that will host application components.
-The permissions the application must have in order to access protected parts
of the API and interact with other applications.
-The permissions that others are required to have in order to interact with the
application's components.
-The list of the Instrumentation classes that provide profiling and other
information as the application is running. These declarations are present in the
manifest only while the application is being developed and tested; they're
removed before the application is published.
-The minimum level of the Android API that the application requires.
-The list of the libraries that the application must be linked against.
Whit all these elements, an application can be created.
For my first application, I was not really comfortable with android, so in this
application there are some different screen, and so different activities, but it was a
good training to try how to communicate between the activities, how to display
elements (TextView, Buttons, Radio buttons, Radio group, Image view, Plain text
view, Web view ...) on the screen and how to interact with them.
Activity_main.XML
MAIN ACTIVITY.JAVA
package com.example.star.projectalmanac;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
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);
b1 = (Button) findViewById(R.id.button);
b2 = (Button) findViewById(R.id.button2);
e1 = (EditText) findViewById(R.id.editText);
e2 = (EditText) findViewById(R.id.editText2);
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(MainActivity.this,second.class);
startActivity(i);
finish();
}
});
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String s1=e1.getText().toString();
String s2=e2.getText().toString();
if (s1.equals("")||s2.equals(""))
{
Toast.makeText(MainActivity.this, "please fill all entries",
Toast.LENGTH_SHORT).show();
}
else
{
SQLiteDatabasedb=openOrCreateDatabase("mahadev",MODE_PRIVATE,null);
db.execSQL("create table if not exists maa(name
varchar,passwordvarchar,emailvarchar,cityvarchar,phone varchar)");
String s3="select * from maa where name='"+s1+"'and
password='"+s2+"'";
Cursor cursor=db.rawQuery(s3,null);
if (cursor.getCount()>0)
{
Toast.makeText(MainActivity.this, "logged in successfully",
Toast.LENGTH_SHORT).show();
Intent j=new Intent(MainActivity.this,three.class);
startActivity(j);
finish();
}
else
{
Toast.makeText(MainActivity.this, "sorry user not found",
Toast.LENGTH_SHORT).show();
Intent k=new Intent(MainActivity.this,second.class);
startActivity(k);
finish();
}
}
}
});
}
}
Activity_second.XML
Signup.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
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_second);
b1=(Button)findViewById(R.id.button3);
b2=(Button)findViewById(R.id.button4);
e1=(EditText)findViewById(R.id.editText3);
e2=(EditText)findViewById(R.id.editText4);
e3=(EditText)findViewById(R.id.editText5);
e4=(EditText)findViewById(R.id.editText6);
e5=(EditText)findViewById(R.id.editText7);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(second.this,MainActivity.class);
startActivity(i);
finish();
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String s1=e1.getText().toString();
String s2=e2.getText().toString();
String s3=e3.getText().toString();
String s4=e4.getText().toString();
String s5=e5.getText().toString();
if (s1.equals("")||s2.equals("")||s3.equals("")||s4.equals("")||s5.equals(""))
{
Toast.makeText(second.this, "please fill all the entries",
Toast.LENGTH_SHORT).show();
}
else
{
SQLiteDatabasedb=openOrCreateDatabase("mahadev",MODE_PRIVATE,null);
db.execSQL(" create table if not exists maa(name
varchar,passwordvarchar,emailvarchar,cityvarchar,phone varchar)");
String s6="select * from maa where name='"+s1+"' and email='"+s3+"'
and phone='"+s5+"'";
Cursor cursor=db.rawQuery(s6,null);
if (cursor.getCount()>0)
{
Toast.makeText(second.this, "user already exist",
Toast.LENGTH_SHORT).show();
Intent j=new Intent(second.this,MainActivity.class);
startActivity(j);
finish();
}
else {
db.execSQL("insert into maa values('" + s1 + "','" + s2 + "','" + s3 + "','" + s4 +
"','" + s5 + "')");
Toast.makeText(second.this, "database updated successfully",
Toast.LENGTH_SHORT).show();
Intent k = new Intent(second.this, MainActivity.class);
startActivity(k);
finish();
}
}
}
});
}
}
ACTIVITY_THREE.XML
THREE.JAVA
package com.example.star.projectalmanac;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_three);
b1=(Button)findViewById(R.id.button5);
b2=(Button)findViewById(R.id.button6);
b3=(Button)findViewById(R.id.button7);
b4=(Button)findViewById(R.id.button8);
b5=(Button)findViewById(R.id.button9);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(three.this,MainActivity.class);
startActivity(i);
finish();
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent j=new Intent(three.this,mediaplayer.class);
startActivity(j);
finish();
}
});
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent k=new Intent(three.this,calculator.class);
startActivity(k);
finish();
}
});
b4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent l=new Intent(three.this,camera.class);
startActivity(l);
finish();
}
});
b5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent m=new Intent(three.this,special.class);
startActivity(m);
finish();
}
});
}
}
ACTIVITY_MEDIAPLAYER.xml
Mediaplayer.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.media.MediaPlayer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mediaplayer);
b1=(Button)findViewById(R.id.button10);
b2=(Button)findViewById(R.id.button11);
b3=(Button)findViewById(R.id.button12);
mp=MediaPlayer.create(this,R.raw.s);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(mediaplayer.this,three.class);
startActivity(i);
finish();
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mp.start();
}
});
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mp.pause();
}
});
}
}
Activity_calculator.xml
Calculator.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.speech.tts.TextToSpeech;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.util.Locale;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_calculator);
b1=(Button)findViewById(R.id.button13);
b2=(Button)findViewById(R.id.button14);
b3=(Button)findViewById(R.id.button15);
b4=(Button)findViewById(R.id.button16);
b5=(Button)findViewById(R.id.button17);
e1=(EditText)findViewById(R.id.editText8);
e2=(EditText)findViewById(R.id.editText9);
t1=(TextView)findViewById(R.id.textView);
ts1=new TextToSpeech(this, new TextToSpeech.OnInitListener() {
@Override
public void onInit(int i) {
ts1.setLanguage(Locale.US);
ts1.setSpeechRate(0.5f);
}
});
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(calculator.this,three.class);
startActivity(i);
finish();
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String s1=e1.getText().toString();
String s2=e2.getText().toString();
Float f1=Float.parseFloat(s1);
Float f2=Float.parseFloat(s2);
Float f3=f1+f2;
String s3=Float.toString(f3);
t1.setText(s3);
ts1.speak(s3,TextToSpeech.QUEUE_FLUSH,null);
}
});
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String s1=e1.getText().toString();
String s2=e2.getText().toString();
Float f1=Float.parseFloat(s1);
Float f2=Float.parseFloat(s2);
Float f3=f1-f2;
String s3=Float.toString(f3);
t1.setText(s3);
ts1.speak(s3,TextToSpeech.QUEUE_FLUSH,null);
}
});
b4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String s1=e1.getText().toString();
String s2=e2.getText().toString();
Float f1=Float.parseFloat(s1);
Float f2=Float.parseFloat(s2);
Float f3=f1*f2;
String s3=Float.toString(f3);
t1.setText(s3);
ts1.speak(s3,TextToSpeech.QUEUE_FLUSH,null);
}
});
b5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String s1=e1.getText().toString();
String s2=e2.getText().toString();
Float f1=Float.parseFloat(s1);
Float f2=Float.parseFloat(s2);
Float f3=f1/f2;
String s3=Float.toString(f3);
t1.setText(s3);
ts1.speak(s3,TextToSpeech.QUEUE_FLUSH,null);
}
});
}
}
Activity_camera1.xml
CAMERA1.JAVA
package com.example.star.projectalmanac;
import android.content.Intent;
import android.graphics.Bitmap;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_camera);
t1=(TextView)findViewById(R.id.textView);
b1=(Button)findViewById(R.id.button18);
b2=(Button)findViewById(R.id.button19);
w1=(ImageView)findViewById(R.id.imageView);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(camera.this,three.class);
startActivity(i);
finish();
}
});
b2.setOnClickListener(new View.OnClickListener() {
//for image capture
@Override
public void onClick(View view) {
Intent j=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivity(j);
finish();
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Bitmap b=(Bitmap)data.getExtras().get("data");
w1.setImageBitmap(b);
}
}
Activity_special.XML
Special.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_special);
b1=(Button)findViewById(R.id.button21);
b2=(Button)findViewById(R.id.button22);
b3=(Button)findViewById(R.id.button23);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(special.this,three.class);
startActivity(i);
finish();
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent j=new Intent(special.this,lightsensor.class);
startActivity(j);
finish();
}
});
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent k=new Intent(special.this,quiz1.class);
startActivity(k);
finish();
}
});
}
}
Magicalmediaplayer.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_special);
b1=(Button)findViewById(R.id.button21);
b2=(Button)findViewById(R.id.button22);
b3=(Button)findViewById(R.id.button23);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(special.this,three.class);
startActivity(i);
finish();
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent j=new Intent(special.this,lightsensor.class);
startActivity(j);
finish();
}
});
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent k=new Intent(special.this,quiz1.class);
startActivity(k);
finish();
}
});
}
}
Activity_quiz.XML
Quiz.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz1);
b1=(Button)findViewById(R.id.button24);
b2=(Button)findViewById(R.id.button25);
t1=(TextView)findViewById(R.id.textView2);
r1=(RadioButton)findViewById(R.id.radioButton);
r2=(RadioButton)findViewById(R.id.radioButton2);
r3=(RadioButton)findViewById(R.id.radioButton3);
r4=(RadioButton)findViewById(R.id.radioButton4);
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(quiz1.this,special.class);
startActivity(i);
finish();
}
});
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
score=0;
if (r3.isChecked())
{
++score;
}
else
{
--score;
}
Intent j=new Intent(quiz1.this,quiz2.class);
startActivity(j);
finish();
}
});
}
}
Activity_quiz2.XML
Quiz2.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz1);
b1=(Button)findViewById(R.id.button24);
b2=(Button)findViewById(R.id.button25);
t1=(TextView)findViewById(R.id.textView2);
r1=(RadioButton)findViewById(R.id.radioButton);
r2=(RadioButton)findViewById(R.id.radioButton2);
r3=(RadioButton)findViewById(R.id.radioButton3);
r4=(RadioButton)findViewById(R.id.radioButton4);
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(quiz1.this,special.class);
startActivity(i);
finish();
}
});
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
score=0;
if (r3.isChecked())
{
++score;
}
else
{
--score;
}
Intent j=new Intent(quiz1.this,quiz2.class);
startActivity(j);
finish();
}
});
}
}
Activity_quiz3.XML
Quiz3.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz3);
b1=(Button)findViewById(R.id.button27);
t1=(TextView)findViewById(R.id.textView4);
r1=(RadioButton)findViewById(R.id.radioButton9);
r2=(RadioButton)findViewById(R.id.radioButton10);
r3=(RadioButton)findViewById(R.id.radioButton11);
r4=(RadioButton)findViewById(R.id.radioButton12);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(r4.isChecked())
{
++quiz1.score;
}
else
{
--quiz1.score;
}
Intent i=new Intent(quiz3.this,quiz4.class);
startActivity(i);
finish();
}
});
}
}
activity_quiz4.XML
Quiz4.java
package com.example.star.projectalmanac
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz4);
b1=(Button)findViewById(R.id.button28);
t1=(TextView)findViewById(R.id.textView5);
r1=(RadioButton)findViewById(R.id.radioButton13);
r2=(RadioButton)findViewById(R.id.radioButton14);
r3=(RadioButton)findViewById(R.id.radioButton15);
r4=(RadioButton)findViewById(R.id.radioButton16);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(r2.isChecked())
{
++quiz1.score;
}
else
{
--quiz1.score;
}
Intent i=new Intent(quiz4.this,quiz5.class);
startActivity(i);
finish();
}
});
}
}
Activity_quiz5.XML
Quiz5.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz5);
b1=(Button)findViewById(R.id.button29);
t1=(TextView)findViewById(R.id.textView6);
r1=(RadioButton)findViewById(R.id.radioButton17);
r2=(RadioButton)findViewById(R.id.radioButton18);
r3=(RadioButton)findViewById(R.id.radioButton19);
r4=(RadioButton)findViewById(R.id.radioButton20);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(r1.isChecked())
{
++quiz1.score;
}
else
{
--quiz1.score;
}
Intent i=new Intent(quiz5.this,score.class);
startActivity(i);
finish();
}
});
}
}
Activity_score.XML
score.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_score);
b1=(Button)findViewById(R.id.button30);
b2=(Button)findViewById(R.id.button31);
b3=(Button)findViewById(R.id.button32);
b4=(Button)findViewById(R.id.button33);
t1=(TextView)findViewById(R.id.textView7);
t1.setText("your score is:" +quiz1.score);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(score.this,facebook.class);
startActivity(i);
finish();
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent j=new Intent(score.this,twitter.class);
startActivity(j);
finish();
}
});
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent k=new Intent(score.this,netcamp.class);
startActivity(k);
finish();
}
});
b4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent l=new Intent(score.this,three.class);
startActivity(l);
finish();
}
});
}
}
Activity_facebook.XML
Facebook.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.EditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_facebook);
b1=(Button)findViewById(R.id.button34);
b2=(Button)findViewById(R.id.button36);
e1=(EditText)findViewById(R.id.editText10);
w1=(WebView)findViewById(R.id.webView);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String s1=e1.getText().toString();
w1.loadUrl(s1);
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(facebook.this,score.class);
startActivity(i);
finish();
}
});
}
}
Activity_twitter.xml
Twitter.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.EditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_twitter);
e1=(EditText)findViewById(R.id.editText11);
b1=(Button)findViewById(R.id.button35);
b2=(Button)findViewById(R.id.button37);
w1=(WebView)findViewById(R.id.webView2);
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(twitter.this,score.class);
startActivity(i);
finish();
}
});
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String s1=e1.getText().toString();
w1.loadUrl(s1);
}
});
}
}
activity_netcamp.xml
Netcamp.java
package com.example.star.projectalmanac;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.EditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_netcamp);
b1=(Button)findViewById(R.id.button38);
b2=(Button)findViewById(R.id.button39);
e1=(EditText)findViewById(R.id.editText12);
w1=(WebView)findViewById(R.id.webView3);
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(netcamp.this,score.class);
startActivity(i);
finish();
}
});
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String s1=e1.getText().toString();
w1.loadUrl(s1);
}
});
}
}
1.3.3 IMPROVEMENTS
For this project, I had not time to do a better application. In fact it lacks
first interface easier to use with anything other than simple lists and text
boxes. The navigation could be improved, because right now it is only
repetitive actions that the user has the choice to make. Finally I have
managed to set up a camera, media player, calculator, quiz, lightsensor
music player ,web browser etc. but will some other application will be
introduced in it and also will be going to modify the give applications.
2. What did I learn?
2.1. Technically
First of all I gained additional skills in the Android language that was
difficult for me before. I learned also how to use a lot of the components in
Android studio such as the debugger. I also learned a new language that
is XML, a language I didn't know at all earlier. Finally, this project
allowed me to use my java skills acquired during my studies.
2.2. Humanly
This placement and this project brought me a lot of things on a human
level. First in relation to myself. I had to acquire a large autonomy.
Indeed I knew nothing about android before, and I had to learn how to
use, and create things on android by myself. This brought me a lot. This
autonomy is also linked to a research spirit. I had to try to find examples
by myself in the book, try to test new things, for having nowhere to find
answers.
Conclusion
Thanks to this training, which was also planned for this, I discovered a city, a
culture, and beautiful people also learned new skills, and used all the things
that I learned for two years. I do not regret anything in this experience and I
thank all those who have allowed such a thing feasible. The Android will
remain for in my life. I have learned many thing here which will definitely
going to help me in future not only in placement but also in my core and for my
final project.The people I met here are not just classmates, roommates and
professors, they are friends, and once again I thank you all.