When do you use map vs flatMap in RxJava?

When do you use map vs flatMap in RxJava? Say, for example, we want to map Files containing JSON into Strings that contain the JSON– Using map, we have to deal with the Exception somehow. But how?: Observable.from(jsonFile).map(new Func1<File, String>() { @Override public String call(File file) { try { return new Gson().toJson(new FileReader(file), Object.class); } … Read more