LOVA CAB App Design in Android Application

LOVA CAB App Design, In this tutorial provide the cab booking all city. It is a simple and faster, with the all new different type of car book in mobile app. Also you can track your cab features. In this app multiple cab categories, very good prices with no surge pricing, well maintainec cabs with professionally trained driver’s facilities, Advance booking options with instant confirmation, Exciting offers & deals for you, Safe rides & transparent pricing, all are facilities in this android application coding and design also ect.

1. MainActivity

package com.tutorialsee.lovacab;

import static android.view.KeyEvent.KEYCODE_BACK;
import java.util.ArrayList;
import java.util.List;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class MainActivity extends Activity implements OnClickListener, OnPageChangeListener{

private ViewPager vp;
private ViewPagerAdapter vpAdapter;
private List<View> views;
Button _login, _signup;


private static final int[] pics = { R.drawable.sw, R.drawable.splash_saftey, R.drawable.splash_fav, R.drawable.splash_saftey, R.drawable.splash_track, R.drawable.splash_track, R.drawable.splash_track};

private ImageView[] dots ;
private int currentIndex;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);

_login = (Button)findViewById(R.id.btn_login);
_signup = (Button)findViewById(R.id.btn_signup);
views = new ArrayList<View>();

LinearLayout.LayoutParams mParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT);

String fontPath = "fonts/Roboto-Regular.ttf";      
/*Typeface tf = Typeface.createFromAsset(getAssets(), fontPath);
TextView title = (TextView)findViewById(R.id.txttitle);
title.setTypeface(tf);*/



for(int i=0; i<pics.length; i++) {
ImageView iv = new ImageView(this);
iv.setLayoutParams(mParams);
iv.setImageResource(pics[i]);
views.add(iv);
}
vp = (ViewPager) findViewById(R.id.viewpager);
vpAdapter = new ViewPagerAdapter(views);
vp.setAdapter(vpAdapter);

vp.setOnPageChangeListener(this);

initDots();

_login.setOnClickListener(this);
_signup.setOnClickListener(this);
}

private void initDots() {
LinearLayout ll = (LinearLayout) findViewById(R.id.lin2);

dots = new ImageView[pics.length];

for (int i = 0; i < pics.length; i++) {
dots[i] = (ImageView) ll.getChildAt(i);
dots[i].setEnabled(true);
dots[i].setOnClickListener(this);
dots[i].setTag(i);
}

currentIndex = 0;
dots[currentIndex].setEnabled(false);
}


private void setCurView(int position)
{
if (position < 0 || position >= pics.length) {
return;
}

vp.setCurrentItem(position);
}


private void setCurDot(int positon)
{
if (positon < 0 || positon > pics.length - 1 || currentIndex == positon) {
return;
}

dots[positon].setEnabled(false);
dots[currentIndex].setEnabled(true);
currentIndex = positon;

}


@Override
public void onPageScrollStateChanged(int arg0) {
// TODO Auto-generated method stub

}


@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
// TODO Auto-generated method stub

}


@Override
public void onPageSelected(int arg0) {
setCurDot(arg0);

}
private void backToMainDesk() {
//startActivity(new Intent(this, QQActivity.class));
finish();
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
        moveTaskToBack(true);
        return true;
    }
    return super.onKeyDown(keyCode, event);
}

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
//int position = (Integer)v.getTag();
// setCurView(position);
// setCurDot(position);

if(v == _login){
Intent ii = new Intent(MainActivity.this,LoginActivity.class);
startActivity(ii);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);
}else if (v== _signup){
Intent ui = new Intent(MainActivity.this,SignupActivity.class);
startActivity(ui);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);
}
}

@Override
public void onBackPressed() {
super.onBackPressed();
moveTaskToBack(true);
overridePendingTransition(R.anim.left_slide_in, R.anim.right_slide_out);  
}

/*public boolean onKeyDown1(int keyCode, KeyEvent event)  {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
System.exit(0);
return true;
}
return super.onKeyDown(keyCode, event);
}*/
}

2. MapsActivity

package com.tutorialsee.lovacab;

import android.Manifest;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.drawable.BitmapDrawable;
import android.location.Location;
import android.os.Build;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewPager;
import android.view.KeyEvent;
import android.view.View;
import android.widget.DatePicker;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.CameraPosition;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class MapsActivity extends FragmentActivity implements OnMapReadyCallback,GoogleApiClient.ConnectionCallbacks,GoogleApiClient.OnConnectionFailedListener,LocationListener, View.OnClickListener {

    private GoogleMap mMap;
    GoogleApiClient mGoogleApiClient;
    Location mLastLocation;
    Marker mCurrLocationMarker;
    LocationRequest mLocationRequest;
    Context context;
    int flag = 0;
    ImageView _overflow, mini, minisedan, miniprime, dil;
    PopupWindow mpopup;
    LinearLayout l1, l2, l3, l4;
    TextView text5, t2, t3, t4;
    private DatePicker datePicker;
    private Calendar calendar;
    private int year, day;
    int month;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_maps);
        context = this;

        dil = (ImageView) findViewById(R.id.searc);
        PrefernceSettings.openDataBase(this);
        t3 = (TextView) findViewById(R.id.text5);
        t4 = (TextView) findViewById(R.id.text6);
        l1 = (LinearLayout) findViewById(R.id.llbtnssn);
        l2 = (LinearLayout) findViewById(R.id.llbstnn);
        l3 = (LinearLayout) findViewById(R.id.llbtns);
        l4 = (LinearLayout) findViewById(R.id.llbstn);
        t2 = (TextView) findViewById(R.id.text6ghgf);
        text5 = (TextView) findViewById(R.id.tefgfxt5);
        calendar = Calendar.getInstance();
        year = calendar.get(Calendar.YEAR);
        month = calendar.get(Calendar.MONTH);
        day = calendar.get(Calendar.DAY_OF_MONTH);
        showDate(year, month + 1, day);
        SimpleDateFormat dateFormat = new SimpleDateFormat("MMM dd yyyy");
        Date date = new Date();

        _overflow = (ImageView) findViewById(R.id.iv_overflow);
        mini = (ImageView) findViewById(R.id.mini);
        minisedan = (ImageView) findViewById(R.id.minisedan);
        miniprime = (ImageView) findViewById(R.id.miniprime);

        _overflow.setOnClickListener(this);
        mini.setOnClickListener(this);
        minisedan.setOnClickListener(this);
        miniprime.setOnClickListener(this);
        l1.setOnClickListener(this);
        l2.setOnClickListener(this);
        l3.setOnClickListener(this);
        l4.setOnClickListener(this);
        t2.setOnClickListener(this);
        t3.setOnClickListener(this);
        t4.setOnClickListener(this);
        dil.setOnClickListener(this);


        if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            checkLocationPermission();
        }
        SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
    }


    public void popUpOnrecordingmoreoption() {
        View popUpView = MapsActivity.this.getLayoutInflater().inflate(
                R.layout.optionlist_layout, null);
        mpopup = new PopupWindow(popUpView, ViewPager.LayoutParams.MATCH_PARENT,
                ViewPager.LayoutParams.MATCH_PARENT, true);
        mpopup.setAnimationStyle(android.R.style.Animation_Dialog);
        mpopup.setBackgroundDrawable(new BitmapDrawable());
        mpopup.showAsDropDown(_overflow, -2, 0);

        LinearLayout _order = (LinearLayout) popUpView.findViewById(R.id._order);
        LinearLayout about = (LinearLayout) popUpView.findViewById(R.id.about);
        LinearLayout reportissue = (LinearLayout) popUpView.findViewById(R.id.reportissue);
        LinearLayout emergencycontact = (LinearLayout) popUpView.findViewById(R.id.emergencycontact);
        LinearLayout _dash = (LinearLayout) popUpView.findViewById(R.id.userid);
        LinearLayout _dashs = (LinearLayout) popUpView.findViewById(R.id.clearorder);
        LinearLayout _dashss = (LinearLayout) popUpView.findViewById(R.id._myaccount);
        LinearLayout _dashsss = (LinearLayout) popUpView.findViewById(R.id._neworder);
        LinearLayout ratecard = (LinearLayout) popUpView.findViewById(R.id.ratecard);
        TextView name = (TextView) popUpView.findViewById(R.id.name);
        TextView mobile = (TextView) popUpView.findViewById(R.id.mobile);
        name.setText("Ruchika Sharma");
        mobile.setText(PrefernceSettings.getPassword());
        mobile.setText("9829854789");


        _order.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {


                Intent dash_int = new Intent(getApplicationContext(), MapsActivity.class);
                startActivity(dash_int);
                overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

                mpopup.dismiss();
            }

        });
        about.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
/*Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + 123456789));
startActivity(callIntent);*/
                mpopup.dismiss();
            }

        });
        reportissue.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent shareIntent = new Intent(Intent.ACTION_SEND);
                shareIntent.setType("text/plain");
                shareIntent.putExtra(Intent.EXTRA_SUBJECT, "subject here");
                shareIntent.putExtra(Intent.EXTRA_TEXT, "body here");
                startActivity(Intent.createChooser(shareIntent, "Complete action using"));
                EndTextElementListener(Intent.createChooser(shareIntent, "fvdfdfdfdfdfd"));
            }

            private void EndTextElementListener(Intent createChooser) {
                // TODO Auto-generated method stub

            }

        });
        emergencycontact.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent dash_int = new Intent(getApplicationContext(), EmergencyContact.class);
                startActivity(dash_int);
                overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

                mpopup.dismiss();
            }

        });
        ratecard.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent dash_int = new Intent(getApplicationContext(), RateCard.class);
                startActivity(dash_int);
                overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

                mpopup.dismiss();
            }

        });
        _dashsss.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent dash_int = new Intent(getApplicationContext(), MyRides.class);
                startActivity(dash_int);
                overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

                mpopup.dismiss();
            }

        });

        _dashss.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent dash_int = new Intent(getApplicationContext(), InviteFriend.class);
                startActivity(dash_int);
                overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

                mpopup.dismiss();
            }

        });

        _dashs.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent dash_int = new Intent(getApplicationContext(), OlaMoney.class);
                startActivity(dash_int);
                overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

                mpopup.dismiss();
            }

        });

        _dash.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent dash_int = new Intent(getApplicationContext(), Profile.class);
                startActivity(dash_int);
                overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

                mpopup.dismiss();
            }

        });

    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        this.finish();
        overridePendingTransition(R.anim.left_slide_in, R.anim.right_slide_out);
    }

    public void setDate(View view) {
        showDialog(999);
    }

    @Override
    protected Dialog onCreateDialog(int id) {
        // TODO Auto-generated method stub
        if (id == 999) {
            return new DatePickerDialog(this, myDateListener, month, day, year);
        }
        return null;
    }

    private DatePickerDialog.OnDateSetListener myDateListener
            = new DatePickerDialog.OnDateSetListener() {

        @Override
        public void onDateSet(DatePicker arg0, int arg1, int arg2, int arg3) {

            showDate(arg1, arg2 + 1, arg3);
        }
    };

    private void showDate(int year, int month, int day) {
        @SuppressWarnings("unused")
        String mont = "";
        if (month == 1) {
            mont = "JAN";
        } else if (month == 2) {
            mont = "FEB";
        } else if (month == 3) {
            mont = "MAR";
        } else if (month == 4) {
            mont = "APR";
        } else if (month == 5) {
            mont = "MAY";
        } else if (month == 6) {
            mont = "JUN";
        } else if (month == 7) {
            mont = "JULY";
        } else if (month == 8) {
            mont = "AUG";
        } else if (month == 9) {
            mont = "SEPT";
        } else if (month == 10) {
            mont = "OCT";
        } else if (month == 11) {
            mont = "NOV";
        } else if (month == 12) {
            mont = "DEC";
        }

    }

    private void init() {
        CameraPosition cameraPosition = new CameraPosition.Builder().target(
                new LatLng(26.850956, 75.822890)).zoom(12).build();
        mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
        MarkerOptions marker = new MarkerOptions().position(new LatLng(26.850956, 75.822890)).title("Hello Maps ");
        marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_map_marker));
        mMap.addMarker(marker);
    }

    private void initw() {
        CameraPosition cameraPosition = new CameraPosition.Builder().target(
                new LatLng(26.912434, 75.787271)).zoom(16).build();

        mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
//map.getUiSettings().setMyLocationButtonEnabled(true);
        //map.getUiSettings().setZoomControlsEnabled(false); // true to enable
//map.setMyLocationEnabled(true); // false to disable
        // create marker
        MarkerOptions marker = new MarkerOptions().position(new LatLng(26.912434, 75.787271)).title("Hello Maps ");
        marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(marker);
        MarkerOptions markers = new MarkerOptions().position(new LatLng(26.857409, 75.824665)).title("Hello Maps ");
        markers.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(markers);
        MarkerOptions markera = new MarkerOptions().position(new LatLng(26.842606, 75.811139)).title("Hello Maps ");
        markera.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(markera);
        MarkerOptions markeras = new MarkerOptions().position(new LatLng(26.842606, 75.811139)).title("Hello Maps ");
        markeras.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(markeras);
        MarkerOptions mar = new MarkerOptions().position(new LatLng(26.912542, 75.787618)).title("Hello Maps ");
        mar.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(mar);
        MarkerOptions ma = new MarkerOptions().position(new LatLng(26.912063, 75.787704)).title("Hello Maps ");
        ma.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(ma);
        MarkerOptions maa = new MarkerOptions().position(new LatLng(26.911872, 75.786738)).title("Hello Maps ");
        maa.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(maa);
        MarkerOptions mas = new MarkerOptions().position(new LatLng(26.911355, 75.786481)).title("Hello Maps ");
        mas.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(mas);
        MarkerOptions maaa = new MarkerOptions().position(new LatLng(26.910973, 75.787017)).title("Hello Maps ");
        maaa.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(maaa);
        MarkerOptions masa = new MarkerOptions().position(new LatLng(26.910915, 75.787940)).title("Hello Maps ");
        masa.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(masa);

    }

    private void initww() {
        CameraPosition cameraPosition = new CameraPosition.Builder().target(
                new LatLng(26.912484, 75.797575)).zoom(14).build();

        mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
        //map.getUiSettings().setMyLocationButtonEnabled(true);
        //map.getUiSettings().setZoomControlsEnabled(false); // true to enable
        //map.setMyLocationEnabled(true); // false to disable
        // create marker
        MarkerOptions marker = new MarkerOptions().position(new LatLng(26.911394, 75.797617)).title("Hello Maps ");
        marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(marker);
        MarkerOptions markers = new MarkerOptions().position(new LatLng(26.912255, 75.796459)).title("Hello Maps ");
        markers.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(markers);

        MarkerOptions mas = new MarkerOptions().position(new LatLng(26.915393, 75.795279)).title("Hello Maps ");
        mas.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(mas);
        MarkerOptions maaa = new MarkerOptions().position(new LatLng(26.914130, 75.794463)).title("Hello Maps ");
        maaa.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(maaa);
        MarkerOptions masa = new MarkerOptions().position(new LatLng(26.913785, 75.797424)).title("Hello Maps ");
        masa.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(masa);

        MarkerOptions markeras = new MarkerOptions().position(new LatLng(26.912465, 75.797553)).title("Hello Maps ");
        markeras.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(markeras);
        MarkerOptions mar = new MarkerOptions().position(new LatLng(26.911145, 75.797660)).title("Hello Maps ");
        mar.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(mar);
        MarkerOptions ma = new MarkerOptions().position(new LatLng(26.910514, 75.796287)).title("Hello Maps ");
        ma.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(ma);
        MarkerOptions maa = new MarkerOptions().position(new LatLng(26.909614, 75.794077)).title("Hello Maps ");
        maa.icon(BitmapDescriptorFactory.fromResource(R.drawable.card));
        mMap.addMarker(maa);

    }


    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
                finishAffinity();
            }
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }

    @Override
    public void onMapReady(GoogleMap googleMap) {
        mMap = googleMap;
        mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);

        //Initialize Google Play Services
        if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            if (ContextCompat.checkSelfPermission(this,
                    Manifest.permission.ACCESS_FINE_LOCATION)
                    == PackageManager.PERMISSION_GRANTED) {
                buildGoogleApiClient();
                mMap.setMyLocationEnabled(true);
            }
        }
        else {
            buildGoogleApiClient();
            mMap.setMyLocationEnabled(true);
        }
    }

    protected synchronized void buildGoogleApiClient() {
        mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addConnectionCallbacks(this)
                .addOnConnectionFailedListener(this)
                .addApi(LocationServices.API)
                .build();
        mGoogleApiClient.connect();
    }

    @Override
    public void onConnected(Bundle bundle) {

        mLocationRequest = new LocationRequest();
        mLocationRequest.setInterval(1000);
        mLocationRequest.setFastestInterval(1000);
        mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
        if (ContextCompat.checkSelfPermission(this,
                Manifest.permission.ACCESS_FINE_LOCATION)
                == PackageManager.PERMISSION_GRANTED) {
            LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
        }

    }

    @Override
    public void onConnectionSuspended(int i) {

    }

    @Override
    public void onLocationChanged(Location location) {

        mLastLocation = location;
        if (mCurrLocationMarker != null) {
            mCurrLocationMarker.remove();
        }

        //Place current location marker
        LatLng latLng = new LatLng(26.850956, 75.822890);
        MarkerOptions markerOptions = new MarkerOptions();
        markerOptions.position(latLng);
        markerOptions.title("Current Position");
        markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_map_marker));
        mMap.addMarker(markerOptions);

        //move map camera
        mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
        mMap.animateCamera(CameraUpdateFactory.zoomTo(11));

        //stop location updates
        if (mGoogleApiClient != null) {
            LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this);
        }

    }

    @Override
    public void onConnectionFailed(ConnectionResult connectionResult) {

    }

    public static final int MY_PERMISSIONS_REQUEST_LOCATION = 99;
    public boolean checkLocationPermission(){
        if (ContextCompat.checkSelfPermission(this,
                Manifest.permission.ACCESS_FINE_LOCATION)!= PackageManager.PERMISSION_GRANTED) {
            if (ActivityCompat.shouldShowRequestPermissionRationale(this,Manifest.permission.ACCESS_FINE_LOCATION)) {
                ActivityCompat.requestPermissions(this,
                        new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
                        MY_PERMISSIONS_REQUEST_LOCATION);
            } else {
               ActivityCompat.requestPermissions(this,
                        new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
                        MY_PERMISSIONS_REQUEST_LOCATION);
            }
            return false;
        } else {
            return true;
        }
    }

    @Override
    public void onRequestPermissionsResult(int requestCode,
                                           String permissions[], int[] grantResults) {
        switch (requestCode) {
            case MY_PERMISSIONS_REQUEST_LOCATION: {
                if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                    if (ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION)== PackageManager.PERMISSION_GRANTED) {
                        if (mGoogleApiClient == null) {
                            buildGoogleApiClient();
                        }
                        mMap.setMyLocationEnabled(true);
                    }

                } else {

                    Toast.makeText(this, "permission denied", Toast.LENGTH_LONG).show();
                }
                return;
            }
        }
    }

    @Override
    public void onClick(View v) {
        if (v == _overflow) {
            popUpOnrecordingmoreoption();
        } else if (v == mini) {
            if (v == mini) {
                flag = 1;
                init();
                mini.setImageResource(R.drawable.miniy);
                minisedan.setImageResource(R.drawable.sedanw);
                miniprime.setImageResource(R.drawable.luxuryw);
            } else {
                flag = 0;
                init();
                mini.setImageResource(R.drawable.miniw);
                minisedan.setImageResource(R.drawable.sedany);
                miniprime.setImageResource(R.drawable.luxuryw);
            }
        } else if (v == miniprime) {
            if (v == miniprime) {
                flag = 1;
                initw();
                minisedan.setImageResource(R.drawable.sedanw);
                mini.setImageResource(R.drawable.miniw);
                miniprime.setImageResource(R.drawable.luxuryy);
            } else {
                flag = 0;
                init();
                minisedan.setImageResource(R.drawable.sedanw);
                mini.setImageResource(R.drawable.miniw);
                miniprime.setImageResource(R.drawable.luxuryw);
            }
        } else if (v == minisedan) {
            initww();
            minisedan.setImageResource(R.drawable.sedany);
            mini.setImageResource(R.drawable.miniw);
            miniprime.setImageResource(R.drawable.luxuryw);

        } else if (v == dil) {
            Intent dash_int = new Intent(getApplicationContext(), Favourites.class);
            startActivity(dash_int);
            overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);
        } else if (v == t2) {
            l1.setVisibility(View.VISIBLE);
            l2.setVisibility(View.VISIBLE);
            l3.setVisibility(View.GONE);
            l4.setVisibility(View.GONE);
        } else if (v == t3) {
            l1.setVisibility(View.GONE);
            l2.setVisibility(View.GONE);
            l3.setVisibility(View.VISIBLE);
            l4.setVisibility(View.VISIBLE);
        } else if (v == t4) {
            l1.setVisibility(View.GONE);
            l2.setVisibility(View.GONE);
            l3.setVisibility(View.VISIBLE);
            l4.setVisibility(View.VISIBLE);
        }
    }
}

3. OlaMoney

package com.tutorialsee.lovacab;

import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.view.ViewPager.LayoutParams;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;

public class OlaMoney extends Activity {
ImageView img_back;
PopupWindow mpopup;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.olamoney_activity);
img_back = (ImageView) findViewById(R.id.img_back);
img_back.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
popUpOnrecordingmoreoption();
}
});
}
protected void popUpOnrecordingmoreoption() {
View popUpView = OlaMoney.this.getLayoutInflater().inflate(
R.layout.optionlist_layout, null);
mpopup = new PopupWindow(popUpView, LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT, true);
mpopup.setAnimationStyle(android.R.style.Animation_Dialog);
mpopup.setBackgroundDrawable(new BitmapDrawable());
mpopup.showAsDropDown(img_back, -2, 0);

LinearLayout _order = (LinearLayout)popUpView.findViewById(R.id._order);
LinearLayout about = (LinearLayout)popUpView.findViewById(R.id.about);
LinearLayout reportissue = (LinearLayout)popUpView.findViewById(R.id.reportissue);
LinearLayout emergencycontact = (LinearLayout)popUpView.findViewById(R.id.emergencycontact);
LinearLayout _dash = (LinearLayout)popUpView.findViewById(R.id.userid);
LinearLayout _dashs = (LinearLayout)popUpView.findViewById(R.id.clearorder);
LinearLayout _dashss = (LinearLayout)popUpView.findViewById(R.id._myaccount);
LinearLayout _dashsss = (LinearLayout)popUpView.findViewById(R.id._neworder);
LinearLayout ratecard = (LinearLayout)popUpView.findViewById(R.id.ratecard);
TextView name = (TextView) popUpView.findViewById(R.id.name);
TextView mobile = (TextView) popUpView.findViewById(R.id.mobile);
name.setText("Ruchika Sharma");
mobile.setText(PrefernceSettings.getPassword());
mobile.setText("9829854789");


_order.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {


Intent dash_int = new Intent(getApplicationContext(),MapsActivity.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});
about.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
/*Intent callIntent = new Intent(Intent.ACTION_CALL);
             callIntent.setData(Uri.parse("tel:"+123456789)); 
             startActivity(callIntent); */
mpopup.dismiss();
}

});
reportissue.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
            shareIntent.setType("text/plain");
            shareIntent.putExtra(Intent.EXTRA_SUBJECT, "subject here");
            shareIntent.putExtra(Intent.EXTRA_TEXT, "body here");
            startActivity(Intent.createChooser(shareIntent, "Complete action using"));
            EndTextElementListener(Intent.createChooser(shareIntent, "fvdfdfdfdfdfd"));
}

private void EndTextElementListener(Intent createChooser) {
// TODO Auto-generated method stub

}

});
emergencycontact.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),EmergencyContact.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});
ratecard.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),RateCard.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});
_dashsss.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),MyRides.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});

_dashss.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),InviteFriend.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});

_dashs.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),OlaMoney.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});

_dash.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),Profile.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});

}
@Override
public void onBackPressed() {
super.onBackPressed();
overridePendingTransition(R.anim.left_slide_in, R.anim.right_slide_out);  
}
}

4. MyRides

package com.tutorialsee.lovacab;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.view.ViewPager.LayoutParams;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;

public class MyRides extends Activity {
ImageView img_back;
PopupWindow mpopup;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.my_rides_activity);
img_back = (ImageView) findViewById(R.id.img_back);
img_back.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
popUpOnrecordingmoreoption();
}
});
}
@SuppressLint("InflateParams")
protected void popUpOnrecordingmoreoption() {
View popUpView = MyRides.this.getLayoutInflater().inflate(
R.layout.optionlist_layout, null);
mpopup = new PopupWindow(popUpView, LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT, true);
mpopup.setAnimationStyle(android.R.style.Animation_Dialog);
mpopup.setBackgroundDrawable(new BitmapDrawable());
mpopup.showAsDropDown(img_back, -2, 0);

LinearLayout _order = (LinearLayout)popUpView.findViewById(R.id._order);
LinearLayout about = (LinearLayout)popUpView.findViewById(R.id.about);
LinearLayout reportissue = (LinearLayout)popUpView.findViewById(R.id.reportissue);
LinearLayout emergencycontact = (LinearLayout)popUpView.findViewById(R.id.emergencycontact);
LinearLayout _dash = (LinearLayout)popUpView.findViewById(R.id.userid);
LinearLayout _dashs = (LinearLayout)popUpView.findViewById(R.id.clearorder);
LinearLayout _dashss = (LinearLayout)popUpView.findViewById(R.id._myaccount);
LinearLayout _dashsss = (LinearLayout)popUpView.findViewById(R.id._neworder);
LinearLayout ratecard = (LinearLayout)popUpView.findViewById(R.id.ratecard);
TextView name = (TextView) popUpView.findViewById(R.id.name);
TextView mobile = (TextView) popUpView.findViewById(R.id.mobile);
name.setText("Ruchika Sharma");
mobile.setText(PrefernceSettings.getPassword());
mobile.setText("9829854789");


_order.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {


Intent dash_int = new Intent(getApplicationContext(),MapsActivity.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});
about.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
/* Intent callIntent = new Intent(Intent.ACTION_CALL);
             callIntent.setData(Uri.parse("tel:"+123456789)); 
             startActivity(callIntent); */
mpopup.dismiss();
}

});
reportissue.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
            shareIntent.setType("text/plain");
            shareIntent.putExtra(Intent.EXTRA_SUBJECT, "subject here");
            shareIntent.putExtra(Intent.EXTRA_TEXT, "body here");
            startActivity(Intent.createChooser(shareIntent, "Complete action using"));
            EndTextElementListener(Intent.createChooser(shareIntent, "fvdfdfdfdfdfd"));
}

private void EndTextElementListener(Intent createChooser) {
// TODO Auto-generated method stub

}

});
emergencycontact.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),EmergencyContact.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});
ratecard.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),RateCard.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});
_dashsss.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),MyRides.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});

_dashss.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),InviteFriend.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});

_dashs.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),OlaMoney.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});

_dash.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent dash_int = new Intent(getApplicationContext(),Profile.class);
startActivity(dash_int);
overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out);

mpopup.dismiss();
}

});

}
@Override
public void onBackPressed() {
super.onBackPressed();
overridePendingTransition(R.anim.left_slide_in, R.anim.right_slide_out);  
}
}

5. activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/splash_bg" >

    <android.support.v4.view.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="250dp"
        android:layout_height="400dp"
        android:layout_centerHorizontal="true" />

    <LinearLayout
        android:id="@+id/lin2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/llbtn"
        android:layout_marginBottom="5dp"
        android:gravity="center_horizontal"
        android:orientation="horizontal" >

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:clickable="true"
            android:contentDescription="@drawable/dot"
            android:padding="5.0dip"
            android:src="@drawable/dot" />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:clickable="true"
            android:contentDescription="@drawable/dot"
            android:padding="5.0dip"
            android:src="@drawable/dot" />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:clickable="true"
            android:contentDescription="@drawable/dot"
            android:padding="5.0dip"
            android:src="@drawable/dot" />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:clickable="true"
            android:contentDescription="@drawable/dot"
            android:padding="5.0dip"
            android:src="@drawable/dot" />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:clickable="true"
            android:contentDescription="@drawable/dot"
            android:padding="5.0dip"
            android:src="@drawable/dot" />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:clickable="true"
            android:contentDescription="@drawable/dot"
            android:padding="5.0dip"
            android:src="@drawable/dot" />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:clickable="true"
            android:contentDescription="@drawable/dot"
            android:padding="5.0dip"
            android:src="@drawable/dot" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/llbtn"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="15dp"
        android:gravity="center_horizontal"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/btn_login"
            android:layout_width="120dp"
            android:layout_height="40dp"
            android:layout_marginRight="10dp"
            android:background="@drawable/curved_button"
            android:gravity="center|center_vertical"
            android:text="Sign Up"
            android:textColor="@android:color/black"
            android:textSize="17sp" />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="15dp"
            android:background="@drawable/curved_button"
            android:gravity="center_horizontal"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/btn_signup"
                android:layout_width="120dp"
                android:layout_height="40dp"
                android:layout_marginBottom="0.5dp"
                android:layout_marginLeft="0.5dp"
                android:layout_marginRight="0.5dp"
                android:layout_marginTop="0.5dp"
                android:background="@drawable/curvedee"
                android:gravity="center|center_vertical"
                android:text="Login"
                android:textColor="#D3DA27"
                android:textSize="17sp" />
        </LinearLayout>
    </LinearLayout>

</RelativeLayout>