In Android project include another project - java

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!

Related

How to add Gradle to an existing project in Android Studio?

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

How to add exisiting java source project to Android Studio

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.

How to reference a java project in my android project?

I am making an android app. I have created a java project also that uses BufferedImage to manipulate images. I want to use this project in my android project. How can I do that?
I'm using eclipse. When I right click my android project > properties > android > [add]
my java project isn't in the available options. I think I need to somehow mark it as library.
Does anyone know how I can do this?
Thanks
Add your Java project to your build path:
Right click on your Android project, click on Properties. In the dialog, select Java Build Path, and then click on the Projects tab. There, add your Java project to the build path.
make JAR of your BufferedImage project and then copy it inside your new project, then right click on the JAR in Eclipse and Choose Build Path -> Add to classpath or something like that

Missing file R.java when creating ZXing library for my app

I'm trying to add the QR scan to my android app. I already know that it's advised to use the Intent method, but the app it's a university project and, therefore, we need to integrate it.
So, I downloaded the pre builded core.jar and the Zxing sources (version 3.0.1), then I created a new Android project with the files in zxing-zxing-3.0.1/android, and then added the core.java in the libs folder and in the build path.
Basically I'm at step 5 of this guide.
The problem is this: my errors do not disappears because the file R.java do not shows up.
I'm using the Android Developing Tools with Eclipse.
R.java is generated by the Android SDK build tools. You didn't build the project yet.
Try these:
look for errors in your layout XML-files
clean your project

Eclipse ADT appcompat... what is it?

I've spent all afternoon getting absolutely nowhere with this.
I've downloaded Eclipse, downloaded the SDK, installed the updates, but every new Android project I create something's wrong.
Firstly, it would not generate the R.java file, at all, now it does but there's a separate project it's created automatically called appcompat_v7. I don't know what this is, but it's causing problems with any other new project.
This is the error a normal project produces:
The container 'Android Dependencies' references non existing library '/home/omar/workspace/appcompat_v7/bin/appcompat_v7.jar'
I have absolutely no idea how to fix this. What is causing this?
EDIT
It appear this is only with KitKat, every other API platform doesn't produce ANY source files at all.... any idea how to combat this?
It's a support library which presumably your project refers to. You will need to build it as a library project in your workspace. This process is described here Support Library Setup under Adding libraries with resources.
You will find the project you need to copy in your SDK in the folder:
\yourSDKlocation\tools\android-sdk-windows4.4\extras\android\support\v7\appcompat
(It's no use just copying a jar, you must build it as a library project.)
I had this problem when I moved a project to a different laptop. I solved it like this:
If appcompat_v7 is not available in Eclipse:
From the File menu, choose New then Project.
Next, choose Android and Android Project from existing Code, then click next
Browse to find your appcompat_v7 project folder
Make sure there’s a check mark next it in the ‘Projects to Import’ list
If the appcompat_v7 project folder is not currently in your workspace, select ‘Copy projects into workspace’, then click Finish
Now that the library project is available in your workspace, it can be added to a project:
Choose your project from the Project Explorer and open the project properties (on a mac it’s in the Project menu)
Click on Android in the left list
Next to the Library list, click the Add button
Choose appcompat_v7 from the list
You should be good to go now.

Categories