Migrating Eclipse Based Projects to Android Studio
In December 2014, Google launched Android Studio, Google’s official Integrated Development Environment (IDE) based on IntelliJ and it discontinued the Android Developer Tools (ADT) plugin for Eclipse, which means it’s time to leave eclipse behind. Yes, yes, I know. Let me explain: All the projects I have published are eclipse based because Android Studio was in beta at the time I created the material.
Fortunately, there’s no need to worry, Android Studio offers a better experience for Android developers and its migration functionality does most of the work for you. Let’s assume you have:
- Downloaded the OfflineErrorHandling project that is available in https://github.com/SAP/sap_mobile_native_android
- Followed the instructions of this guide How to… Handle Synchronization Errors (Android)
- Ran the android application successfully
- Downloaded Android Studio http://developer.android.com/sdk/index.html
1. Open Android Studio and click on the option: Import project (Eclipse ADT, Gradle, etc)
2. Navigate to your eclipse workspace and select the eclipse based project and click OK
3. Select your Android Studio workspace and click Next. If the directory does not exist, another pop up window will be displayed to confirm the creation of the new folder.
4. Select all the options and let Android Studio do its work
5. When it finishes, an import-summary.txt file will open in the Android studio editor with the results of the migration.
- The MAF resources will be imported as modules.
- The armeabi files are now located under jniLibs folder in the android studio project
- A message will be displayed at the left bottom corner indicating whether the build was successfully or not
If you see errors in the bottom section, you can click on the suggested fixes to eliminate the errors.
You can run your application by clicking on the run or debug icon located in the top menu
Visit this guide How To… Setup MAF resources in Android Studio for more details about
– How to import the MAF resources from scratch
– Set up your android emulator (Appendix C)
Let’s leave eclipse behind!
Claudia
We are glad that you created this. Else I was about to open a discussion on this topic.
Thanks 🙂
Batish
Hi Batish,
Thanks for your comment,
At this point, the MAF resources delivered in the SMP 3.0 SDK are eclipse based projects. Development is working on it to offer a better integration in the future, but in the meantime developers can follow this guide How To... Setup MAF resources in Android Studio to import MAF resources into Android Studio projects.
Hope this helps the community,
Best regards,
Claudia
is there any guidelines for importing a Kapsel based apps? I was trying but faced with some errors.
Regards
Batish
Hi Batish,
I'm not aware of any guide for migrating Kapsel based apps to Android Studio. Please open a discussion about it, share the plugins you have added in your hybrid app and the error (with some screenshots) you are getting. If other colleagues in the community have tried it, they will share their experience. I haven't tried it yet, but I'll reserve some time this week to try it and will let you know my findings.
Best regards
Claudia