package com.supinfo.jva.geocar;

import android.app.Activity;
import android.os.Bundle;

/**
 * Created by Martin on 29/03/2015.
 */
public class Home extends Activity{

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home);
    }

}

@@ -74,63 +74,192 @@
 oid.
-os.Bundle;%0A%0A/**%0A * Created by Martin on 29/03/2015.%0A */
+app.AlertDialog;%0Aimport android.content.DialogInterface;%0Aimport android.content.Intent;%0Aimport android.location.LocationManager;%0Aimport android.os.Bundle;%0Aimport android.widget.Toast;%0A
 %0Apub
@@ -442,16 +442,1579 @@
 t.home);
+%0A%0A        LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);%0A        Boolean isGPSenabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);%0A        if (isGPSenabled)%7B%0A            // Test if the GPS is enabled%0A            Toast.makeText(this, %22GPS is Enabled in your devide%22, Toast.LENGTH_SHORT).show();%0A        %7D%0A        else%7B%0A            showGPSDisabledAlertToUser();%0A        %7D%0A    %7D%0A%0A    private void showGPSDisabledAlertToUser()%7B%0A        AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);%0A        alertDialogBuilder.setMessage(%22You must enable the GPS to locate your car. Would you like to enable it?%22)%0A                .setCancelable(false)%0A                .setPositiveButton(%22Enable GPS%22,%0A                        new DialogInterface.OnClickListener()%7B%0A                            public void onClick(DialogInterface dialog, int id)%7B%0A                                Intent callGPSSettingIntent = new Intent(%0A                                        android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);%0A                                startActivity(callGPSSettingIntent);%0A                            %7D%0A                        %7D);%0A        alertDialogBuilder.setNegativeButton(%22Cancel%22,%0A                new DialogInterface.OnClickListener()%7B%0A                    public void onClick(DialogInterface dialog, int id)%7B%0A                        dialog.cancel();%0A                    %7D%0A                %7D);%0A        AlertDialog alert = alertDialogBuilder.create();%0A        alert.show();%0A    %7D
 %0A    %7D%0A%0A

Check if the user had the GPS enabled