Google Android Studio from my point of view is the most suitable IDE for native Android programming. It is simply works out of the box. However, during working with this IDE, I have faced the shortage of documentation. Unfortunately, majorities of tutorials have been written for Eclipse IDE and since Android Studio in comparison is considered as new, the lack of documentation is quite obvious especially for beginners like me. For instance, I was seeking on the net about adding Gson (or any other) library to Android Studio and didn’t find a suitable document for that. Finally, I have randomly found it by chance.
Adding libraries in Android Studio is fairly easy in overall. In this example, I explain about importing Gson lib to Android project. In order to add library click on File menu from Android Studio and select Project Structure like the following picture,
Then from the pop up menu select Dependencies tab like this
And then click on “+” and choose you Gson library like below,
After that click on OK and close the tab. Now you can start using Gson library in your project.
Hey Kasra,
I have been trying to do the same but not able to use Gson in my project. It does not even import gson into my project.
Min SDK version in my project is 15 and target SDK = 23
Depends on the version sometimes it won’t work or throws some error after adding. Try to add Gson lib manually to your project to see it works or not. You can follow this link,
http://stackoverflow.com/questions/16608135/android-studio-add-jar-as-library