I have an existing project in Android Studio that I originally imported from Eclipse.
I haven't been using any specific build system to build my project other than the one provided by default with the Android Studio IDE (though the project was originally created with Eclipse.
I haven't been able to find a good tutorial of the steps. What's the recommended approach to add Gradle to this project?
Any help would be greatly appreciated.
Thanks!
I would recommend creating a new project in android studio as the folder structure used by gradle is different than the one used by eclipse. Then copy the files into their matching folder.
Here is a detailed description about the folder structure: https://developer.android.com/tools/projects/index.html
Related
I am having trouble with Android Studio. I forked the project here:
https://www.google.com/url?q=https://github.com/ubclaunchpad/Android-Calculator&sa=D&ust=1514703967854000&usg=AFQjCNHLwSAZ_JER6VlZ8LP6AtTzfUVBog
and cloned it in Android Studio, but it keeps telling me that I should Migrate to Gradle. However, if you look at the project files on github, there are a lot of gradle related files, so clearly the project does use gradle. How do I fix this? Is there a simple solution?
it works fine with me ensure that you open Calculator folder as a project, not Android-Calculator-master
check this photo
open calculator folder
I am trying to setup a project in Android Studio which includes several source files from an Eclipse project.
The Eclipse project has the following structure:
Library Project
It has a reference to several folders with java classes in them (included by link source)
Now I'd like to have these resources in my project/module in Android Studio too, but I can't find any possibility to achieve this other than copying them directly.
I'd like to avoid this because these files are part of a self written Java framework which is used in combination with GWT too. So copying these files instead of linking them means all changes have to be done twice.
Is it possible to include these sources similar to link source from Eclipse or is there another solution?
You could build your Eclipse project and reference it as a library in Android studio project. Then you would be able to access/use the required classes in the Android studio project.
I have an existing git repository of pure Java code that I would like to add to my Android project.
I don't want to change any of the existing files. I want to keep my existing package names to simplify the maintenance of my legacy code.
In Eclipse, you can simply add the root of the existing project to your Java Build Path.
How to do the same in Android Studio?
I'm not sure this will help or not. But you may check these.
https://developer.android.com/sdk/installing/migrate.html
Unable to import Eclipse project to Android Studio
How to import eclipse project from git to Android Studio?
My solution to this was to Export my Java project to a JAR.
And then, I added the JAR to the Android Studio project.
File > Project Structure leads to this window:
That way, I could use my files untouched as such.
I am not so happy with this solution because it breaks my revision control system.
Okay, so I'm having difficulties implementing this Change log library into my android app in eclipse: https://github.com/gabrielemariotti/changeloglib
I tried using the clone url and importing the library into eclipse and then going into the properties of my android project and adding it as a library but that didn't work. I do not have Maven installed nor do I know anything about it. Is there a way I can just get a jar of this library somewhere? Can someone please help me? Thank you!
Its most likely not setup as an Android Library project and that is why it can't be accessed that way.
You can create the jar yourself though by using: https://stackoverflow.com/a/11289115/1784299 eclipse itself or running the jar command in a terminal. (Eclipse might be a little more user friendly if you don't use the terminal.
I would however highly recommend learning how to incorporate Maven in your projects because it is a huge time saver. If you migrate to Android Studio then Maven will become your best friend.
I answer here to help other devs with the same issue.
The library is built with the Android Studio folder structure.
I highly recommend to use the gradle build system to work.
Hovewer, you can build it locally with Eclipse.
All required steps are described here:
https://github.com/gabrielemariotti/changeloglib/blob/master/doc/BUILD.md#reference-this-project-as-a-library-in-eclipse.
It can be valid for a lot of libraries.
Eclipse uses src and res as source folders. Android Studio instead uses src/main/java and src/main/res as source folders.
So you have to mark the java folder as source (right click on folder -> Build-Path -> use as source folder)
I'm just starting my long way to Android programming and building app where I would like to use this library https://github.com/cfgxy/DevsmartLib-Android/tree/
This is another Android project, how should I include this in my project using Eclipse?
The contents of that repo's devsmartlib/ directory appears to be an Android library project. You can use such projects from Eclipse or from the command line as you see fit.
Create a new Android project in Eclipse and select the contents of devsmartlib/ as the source folder.
You can then right click on your project, click Properties, Android and add the library project from there!