How to Get All Country Names

Hey,


This code segment will get you all country names.
//Initializing Country List
    final List<Country> countryList=new ArrayList<>();

    public void fillCountryList(){
        String[] countries = Locale.getISOCountries();

        int j = 0;
        // Loop each country
        for(int i = 0; i < countries.length; i++) {

            String country = countries[i];
            Locale locale = new Locale("en", country);

            // Get the country name by calling getDisplayCountry()
            String countryName = locale.getDisplayCountry();

            // Printing the country name on the console
            countryList.add(new Country(countryName));
            j++;
        }
        Log.d("MyApp", "Total Country # : " + j);
    }

You can use this code segment even in your Android application without any problem.
If you cannot understand how it is working, feel free to ask me :)

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...