Widespread Augmented Reality

Widespread Augmented Reality
Click on the image to get the Android Augmented Reality Heads up Display

Tuesday, October 13, 2015

Migrating from Eclipse to Android Studio

I have created new projects in Android Studio, but have yet to migrate an Eclipse app project to Android Studio. This documents what I did to get a clean build after importing the project from Eclipse following these instructions.
  • First I made sure that my Eclipse project ran and debugged successfully to my Galaxy Tab 2.
  • Then I moved the project to a separate Workspace folder
  • Firing up Android Studio, I imported the Eclipse project from the duplicate folder
  • Of course there were tons of errors
  • Mostly due to invalid imports and their methods in the source code.
  • For example: import org.apache.http.client.*
  • My eclipse project used imported external Jars
  • So I went outside Android Studio into Windows file manager or explorer and created a "libs" folder inside the "app" directory.
  • I copied my external Jars to the "libs" folder and then edited the build.gradle file like so:
  • dependencies {
    compile files ('libs/acra-4.2.3.jar')
    compile files ('libs/httpmime-4.1.1.jar')
    }
  • Other errors involved encoding
  • So I also added the following to the build.gradle file
  • compileOptions {
    encoding "UTF-8"
    sourceComaptibility JavaVersion.VERSION_1_7
    targetComaptibility JavaVersion.VERSION_1_7
    }
  • Now the errors disappeared.
  • However, I also did a bunch of other fiddling around, so I don't know what actually fixed the errors.
  • Just so you know.
  • Now the fun begins with a Run Debug to the actual Galaxy Tablet, so stay tuned.

    By the way, the Eclipse project was no slouch. This is the production app on Google Play: WAR.

    No comments:

    Post a Comment