How to Get Current Date by Formatting

Hey,
Firstly, this code segment lets you the exact integer number of the current day. Therefore, you can get the switch-case check to do whatever you want on an exact day.

 Calendar calendar = Calendar.getInstance();
            int day = calendar.get(Calendar.DAY_OF_WEEK);

            switch (day){
                case Calendar.SUNDAY:
                    //Your code
                    break;
                case Calendar.MONDAY:
                    //Your code
                    break;
                ...
            }

Moreover, this code segment gives you the formatted current date. You can shape your format to change : “yyyy-MM-dd” part.
  SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
            String now = df.format(new Date());

How to extract filename from Uri?

Now, we can extract filename with and without extension :) You will convert your bitmap to uri and get the real path of your file. Now w...