Can IntelliJ use an Android SDK sample project as a base when creating a new project? So far, I haven't been able to import source codes from the default directory (/samples/android-<level>/project_name) and I had to copy the source files manually into a newly-created project.
Any faster way?
You can choose to create project from existing sources. Here is official documentation. If I understand correctly what do you mean. However if you want to use some project as a template then this will not suit you.
Related
I developed an Android app with Android Studio and I want now to create a SDK to enable other developer to use the technology I created. This SDK should use an activity and a couple of background service.
I've looked around on internet and on SO, but I did not manage to find the basic information I need :
How to set Android Studio to build a SDK , not an APK;
Is there any security to implement so that my code is not readable by others?
I created an app but I have no basic knowledge on building SDK, so any information or link where I can learn would be appreciated.
According to me what you require is a .aar file. Just like you give out Java sdk's as a jar, you can package your Android code as a .aar file. This can be imported in any other Android project and your exposed API's / screens can be used directly.
To create an aar select your module in Android studio project structure- then on the right pane select gradle and then select generate .aar file. This will be generated in your build/outputs folder.
Now this can be added in any project and compiled by putting a dependency in the gradle. You can Google "creating an aar" for more information.
I was only able to find guides on how to import an Eclipse project into Android Studio. But I am not using Eclipse, I am using IntelliJ IDEA.
How do I generate the new Gradle build files for my project?
EDIT:
To clarify. I know how to setup Gradle manually. But that's not what I am asking for. The question is: Am I able to let the Android SDK generate the Gradle files for me? Like the ADT does... But since I'm not using Eclipse, I don't have access to the export feature of ADT!
Have you started Android Studio yet? Because importing IDEA Projects is one of the possible selections you can choose in the beginning.
If you passed that initial state already, just go to File -> Import Project and select the folder of your project that you want to import. The rest is straight forward and pretty bullet proof as both are basically IDEA :D
Okay for everyone who needs to do this:
It's not possible.
But if you want to create the neccessary Gradle build file manually. Here it is: https://gist.github.com/Goddchen/5600345
You need to "Import Project (Maven, Gradle, ...)" and then select not the folder, but 'settings.gradle' instead. Then Android Studio will do everything by itself.
So, this is not like other problems. I have basically one question
Android project build system uses the Android.mk files.
Is there any eclipse plugin out there that parses through the mk files and allows me to load those projects into eclipse ? essentially import Android.mk file project...
You can import the whole Android sources into eclipse. The instructions are here. Then you should make some modifications (for instance, include android-common_intermediates/javalib.jar instead of google-common_intermediates/javalib.jar) and you will have possibility to develop in eclipse.
Eclipse separates Android sources to several projects by itself(I think according to classpath entries). If you want to change this behavior you should look in this direction.
If you have tried eclipse instructions at Android source site, you probably would know by now that it leaves lot of details to imagination.
One thing you need to keep in mind is that AOSP build doesn't work with eclipse. As long as you build your code from terminal and use eclipse to edit/browse/debug purposes, you will have more productive sessions.
The article at Using Eclipse to browse/edit Android platform code explains this in step by step.
I'm having a hell of a time importing OpenCV into my Android project. I've already tried this tutorial:
http://opencv.itseez.com/doc/tutorials/introduction/android_binary_package/android_binary_package.html
and it did not work because Eclipse would not recognize the existing projects in the directory. So after much searching I came across this trunk:
https://code.ros.org/svn/opencv/trunk/opencv/
and was able to import it into my workspace in Eclipse. Eclipse now recognizes the sample projects, but now the problem is that there are no OpenCV library files. So all the calls to import different classes result in errors. Shouldn't there be a opencv.jar somewhere? I've seen various posts that mention having to build the library but unfortunately I don't have the slightest clue how to do that. I need something with step by step instructions. I'm running Windows 7 64-bit.
Thanks!
You should download the latest OpenCV 4 Android here:
http://opencv.org/downloads.html
And read these tutorials to get you started (in this order roughly):
Introduction into Android Development
OpenCV4Android SDK
Android Development with OpenCV
OpenCV4Android Reference
If you want to use OPEN CV in your android apps, for example if you need to read some strings from an image in your android and you are new in using OPEN CV. Then download the pre-built OpenCV library for Android from here:
http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.3/
After downloading, import OpenCV-2.3.1 into Eclipse using File-->Import...-->General-->Existing Project Into Workspace.
In your project's properties, Under Android, add the OpenCV2.3.1 library (press Add.. on the right and select OpenCV2.3.1).
Good luck!
You might want to take a look at this project: https://github.com/billmccord/OpenCV-Android
I was able to run opencv applications on my android phone with the help of this port.
installed the Win-superpack?
I recommend getting the latest .tar, extract and use it. Worked for me.
I posted about this on a duplicate question. Make sure you have the android NDK installed! Or, consider using JavaCV instead. It is much easier to install.
I've been looking at the Android + App Engine source code from a Google IO session (Android meet App Engine). They generate three projects, an Android project, a GWT interface, and an App Engine server project. All of these projects have a common source folder called shared where they can put their synchronized data classes that all parts of the app need to know about.
I'm wondering how to create that shared source folder in a general Eclipse project. How can I create a source folder in one project that's also available to and synced with other projects in Eclipse?
Edit
I'm not looking for how to do an Android Library project (I already use several of those for my apps). Android Libraries don't work for a general eclipse project, say an App Engine server side project.
I am using Helios eclipse.
To create Source Folder
Navigate to your project in the package Explorer, right-click and select New, select Source Folder. Enter the folder name and click Finish.
If you want to use the source folder in any of your projects, then go to your project properties, click Java Build Path, go to Source tab, you can link the folder.
The way to do this within Android is through use of a library project. Create one project as an Android library (properties->android->Is Library gets checked), and the others must have their property page updated to make use of the library.
Libraries have their code and resources pulled into projects that use the library. The library's manifest is ignored.