Im building a function which gets a country name and returns its country code (iso/telephone prefix). I added to my project (to the root of the app) a text file which holds key-value pairs of countries and their country code in the following format:

```
"Abkhazia":7840,
"Abkhazia":7940,
"Afghanistan":93,
"Albania":355,
"Algeria":213,

```

The user enters a country name in an `EditText` box and the function should return the code.

```
editTextCountryInput = (EditText) findViewById(R.id.editTextCountryInput);
getCountryCode(editTextCountryInput.getText().toString());

```

The function:

```
private int getCountryCode(String countryName){
    try{
        BufferedReader reader = new BufferedReader(new FileReader(new File("countries.txt")));
        String inputLine = null;
        LinkedHashMap<String,String> dictionary = new LinkedHashMap<String,String>();
        try{
            while((inputLine = reader.readLine()) !=null){
                String[] words = inputLine.split(":"); //split each line by : delimiter

                for(String word: words){
                    Log.i("splitting ", " line");
                    dictionary.put(word,?); //what should be the second arg?
                }
            }
        }catch (IOException e){
            e.printStackTrace();
        }

    }catch (FileNotFoundException e){
        e.printStackTrace();
    }
    int countryCode =(int) dictionary.get(countryName);
    return countryCode;
}

```

I want to read each line of the text file, split each line where the delimiter is (":") and place each split key-value pair in the `LinkedHashMap`. 2 problems:  

1. I get an error `java.io.FileNotFoundException: countries.txt: open failed: ENOENT (No such file or directory)`. When i tested the file for `absolute path` i got "/countries.txt" - but it still fails for that error.  

2. After I split the read line using the `String.split(":")` method, I dont know how to store the two part inside the hashMap in a key-value manner.  

This is the code i use to determine the absolute path:

```
File f = new File("countries2.txt");
        Log.i("abs path: ", f.getAbsolutePath());

```

EDIT:  

I created a new `assets` folder in Android Studio (right click on the app -> new Assets folder -> finish) and placed my `countries.txt` file, but I'm still getting the FileNotFound exception.