Android developers spent much time on finding their views in the XML layout. Unlike Xcode, Android Studio doesn't provide a drag and drop layout to code referencing mechanism. However, I made a simple python script to automate this thing. All you need is python installed. Linux and Mac OS X provides python out of the box. You just give the path to your Activity implementation, the script will find the layout and automatically adds references for you. And additionally, you have to provide the path of resources directory, so the script will find the path of layout XML correctly.
How to get the script?
Get the script from GitHub
git clone https://github.com/anandbose/fvbi
Set permission to run the script
chmod +x ./fvbi/fvbi.py
./fvbi/fvbi.py ./path/to/activity/YourActivity.java ./path/to/res/
Or you can work the script on multiple files in a directory
./fvbi/fvbi.py ./path/to/activity-dir/ ./path/to/res