Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’. > java.util.concurrent.ExecutionException: method ID not in [0, 0xffff]: 65536

Sometimes application may be big in execution or heavy that time multidex should be enabled .

Here is the full process to enable multidex in android


Enable Multidesk

Android create border radius for Button , Views , EditText and others

Step – 1: Create xml layout in drawable folder

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="" >
 <item android:state_pressed="true" >
     <shape android:shape="rectangle"  >
         <corners android:radius="3dip" />
         <stroke android:width="1dip" android:color="#5e7974" />
         <gradient android:angle="-90" android:startColor="#345953" android:endColor="#689a92"  />            
<item android:state_focused="true">
     <shape android:shape="rectangle"  >
         <corners android:radius="3dip" />
         <stroke android:width="1dip" android:color="#5e7974" />
         <solid android:color="#58857e"/>       
<item >
    <shape android:shape="rectangle"  >
         <corners android:radius="3dip" />
         <stroke android:width="1dip" android:color="#5e7974" />
         <gradient android:angle="-90" android:startColor="#8dbab3" android:endColor="#58857e" />            

Step 2 : Implement on anywhere like button and view .

    android:text="Buttons" />

Android Fragment basic code structure

public class BasicFragment extends Fragment {

    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.basic_fragment_layout, container, false);
        return view;

IOS best network image download library – SDWebImage , Swift 3/4

Sometimes network image doest not download and for that app may crash . To avoid this you can use SDWebImage library as like Picasso android library which will show a default placeholder image until file downloaded .

To implement SDWebImage –

Step 1 :

paste the pod file in podfile of your project (If you don’t create pod file . create it with ‘pod init’ command in your project directory)

 pod 'SDWebImage', '~> 4.0'

Run command

  pod install

Step 2 :

Attach your image view

let image_url = "your_image_url"

   image_view.sd_setImage(with: URL(string: image_url ), placeholderImage: UIImage(named: "AppIcon"))

Here ,

image_view is your ImageView reference . AppIcon is default placeholder .


Run your . Done .




Android back pressed to exit the app dialog and exit app

public void onBackPressed() {

    AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
    alertDialogBuilder.setMessage("Are you sure you want to exit the app?");
            new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface arg0, int arg1) {
                    Intent intent = new Intent(Intent.ACTION_MAIN);
                    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NO_HISTORY);

    alertDialogBuilder.setNegativeButton("No", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {

    AlertDialog alertDialog = alertDialogBuilder.create();;


Android custom date picker

Step -1 :

Create a custom fragment

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.DatePicker;
import android.widget.EditText;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {

    public static final String DATE_FORMAT = "dd-MM-yyyy";
    EditText mView;

    private DatePickerDialog datepic;

    public DatePickerFragment(View v) {
        mView = (EditText) v;

    Calendar c;

    public DatePickerFragment() {

    public Dialog onCreateDialog(Bundle savedInstanceState) {
        // Use the current date as the default date in the picker
        c = Calendar.getInstance();
        int year = c.get(Calendar.YEAR);
        int month = c.get(Calendar.MONTH);
        int day = c.get(Calendar.DAY_OF_MONTH);

        datepic = new DatePickerDialog(getActivity(), this, year, month, day);
        DatePicker dp = datepic.getDatePicker();
        dp.setMinDate(c.getTimeInMillis() + 60 * 60 * 24 * 1000);
        dp.setMaxDate(c.getTimeInMillis() + 60 * 60 * 24 * 1000 * 16);
        return datepic;

    public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {

        c.set(Calendar.YEAR, year);
        c.set(Calendar.MONTH, monthOfYear);
        c.set(Calendar.DAY_OF_MONTH, dayOfMonth);

        // String years=Integer.toString(dayOfMonth);

        updateDateButtonText((EditText) mView);


    private void updateDateButtonText(EditText mView) {

        SimpleDateFormat timeFormat = new SimpleDateFormat(DATE_FORMAT);
        String timeForButton = timeFormat.format(c.getTime());


Step 2 : Create an EditText and call it in activity .Like this

private EditText dob;
dob = findViewById(;

Step 3 :
Create a click listener of dob

dob.setOnClickListener(new View.OnClickListener() {
    public void onClick(View view) {
        FragmentManager fragmentManager = getSupportFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        DialogFragment fragment = new DatePickerFragment(dob);
        fragmentTransaction.addToBackStack(null);, "Set Date");

Step 4 : set dob text to dob edittext


IOS Swift 3/4 show alert for specific time duration

   let alert = UIAlertController(title: "", message: "alert disappears after 30 seconds", preferredStyle: .alert)

            self.present(alert, animated: true, completion: nil)

            // change to desired number of seconds (in this case3 0 seconds)

            let when = + 30

            DispatchQueue.main.asyncAfter(deadline: when){

                // your code with delay

                alert.dismiss(animated: true, completion: nil)