Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Winter Is Coming"
android:id="@+id/txt"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/time"
android:text="..."/>
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Play"
tools:layout_editor_absoluteX="147dp"
tools:layout_editor_absoluteY="419dp" />
Button btn;
TextView txt;
MediaPlayer ply;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn = findViewById(R.id.btn);
txt = findViewById(R.id.txt);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
txt.setText("Winter is Coming".toString());
final MediaPlayer mp = MediaPlayer.create(MainActivity.this, R.raw.winter);
mp.start();
txt.setTextColor(Color.parseColor("#76FF03"));
}
});
new CountDownTimer(4, 1) {
@Override
public void onTick(long l) {
txt.setTextColor(Color.parseColor("#76FF03"));
}
@Override
public void onFinish() {
}
};
}}

package com.example.anitaa.studentadd;
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;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import java.util.HashMap;
import java.util.Map;
public class MainActivity extends AppCompatActivity {
EditText FirstName, LastName, Class;
Button button;
String url1="http://192.168.1.3/student/web/studentrecords";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate ( savedInstanceState );
setContentView ( R.layout.activity_main );
FirstName= (EditText) findViewById(R.id.firstname);
LastName= (EditText) findViewById(R.id.lastname);
Class= (EditText) findViewById(R.id.studentclass);
button = (Button) findViewById(R.id.studentinformation);
button.setOnClickListener ( new View.OnClickListener () {
@Override
public void onClick(View v) {
final String fname,lname,class2;
fname = FirstName.getText().toString();
lname = LastName.getText().toString();
class2 = Class.getText().toString();
StringRequest stringRequest1 = new StringRequest ( Request.Method.POST, url1, new Response.Listener<String> () {
@Override
public void onResponse(String response) {
Toast.makeText(MainActivity.this,response.toString (),Toast.LENGTH_SHORT).show();
}
}, new Response.ErrorListener () {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(MainActivity.this,error.toString (),Toast.LENGTH_SHORT).show();
error.printStackTrace();
}
} ){
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String> ();
params.put("FirstName",fname);
params.put("LastName",lname);
params.put("Class",class2);
return params;
}
};
MySingleton.getInstance ( MainActivity.this ).addToRequestque ( stringRequest1 );
}
} );
}
}