What is Android and what is an Android phone?

Android is now over five years old and despite the little green robot android peeking out of phone shops up and down the highstreet, there are still those who don’t know what it is or what it’s all about.

Coding Horror

I’ve come to discover that people who struggle to code don’t just struggle on big problems, or even smallish problems (i.e. write a implementation of a linked list). They struggle with tiny problems.

Desigen Pattens

Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development.

Wanna Make Game...!

Highly praised tutorial will explain everything in detail to cater to both beginners and advanced programmers alike. When you walk away from this course, you will have created the above game in Java and ported it to Android.

Web Services

Web services are open standard ( XML, SOAP, HTTP etc.) based Web applications that interact with other web applications for the purpose of exchanging data

Saturday, April 30, 2016

Alert Dialogue Example

package activity.fairline.com.alerttest;

import android.app.DatePickerDialog;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
 

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

// Get the Builder to create the AlertDialog

        AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);

// Set the Properties
        alertBuilder.setMessage("Do you want to exit from the application?");
        alertBuilder.setCancelable(false);
        alertBuilder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {

                MainActivity.this.finish();
            }
        });
            alertBuilder.setNegativeButton("No", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.cancel();
            }
        });

   // crate the AlertDialog      
AlertDialog ald = alertBuilder.create();
       
// Display the AlertDialog
ald.show();
    }
}