Is it possible to install (multiple) instances of the same app in an isolated environment, whereby it can't detect other apps, or read/write files anywhere else?
Yes just as the other answers have suggested. AFAICT, this mechanism is now being implemented in newer ROM versions by some manufacturers, and even some independent developers.
For example, Lenovo has incorporated a similar isolation mechanism in order to allow installation of multiple instances of applications or at least dual installation.
This feature is called Dual Apps in some Lenovo devices:
The brief description states:
Dual Apps will let you run two separate instances of the same app. Both instances will run independently of each other and will not share any kind of data with each other, except for contacts provided you have allowed that.
I believe this idea has been inspired with the recent surge of dual sim-powered smartphones and growing popularity of social networking applications such as WhatsApp, Facebook etc.
For this reason Huawei's EMUI 5.0 has implemented the same feature called App Twin
Essentially for now it supports WhatsApp and Facebook but more applications can be added as suggested on this XDA thread.
However it seems its not as fine-tuned as the former as it has some limitations :
You cannot backup or clear App Twin account data separately. When you enable an app in App Twin and perform a backup, both the main account and twin account are backed up. When you clear app data, both accounts will be deleted.
Probably the most interesting project on this topic now is Island
The developer (Oasis Feng) is working on a beta version of this project, and is described
Island is a sandbox environment to clone selected apps and isolate them from accessing your personal data outside the sandbox (including call logs, contacts, photos and etc) even if related permissions are granted. Device-bound data is still accessible (SMS, IMEI and etc). Isolated app can be frozen on demand, with launcher icon vanish and its background behaviors completely blocked.
The features are summarised as follows:
- app freezing,
- privacy protection,
- parallel accounts
As mentioned above its still in beta, and installation is via Opt-in the open beta test on Google Play
You can try restricting what the app can see with XPrivacy if your Android version is supported (4.0.3 - 6.0.1).
You can actually, there are a multitude of different virtualization apps that have been recently developed. I'm not sure specifically what you require, but you can try out Parallel Space, Go Multiple, Multiple Accounts, or many others just like it available in the Play Store.
If you download any one of the launcher apps (such as Nova Launcher or Google Now Launcher) then after installing one of the parallel apps simply import the launcher app into the parallel app (it's the first thing you're asked to do upon opening any of the parallel apps) and you have a secondary "virtualized" environment to install most any app you'd like without it doing any damage to your phone or other apps/accounts/etc.