Can we use Android studio for AOSP development? - java

Can we use Android studio for AOSP(Android Open Source Project) development, is there a way to do it. I didnt find one. anybody got any idea on this please ?

You can use Android Studio as a IDE for AOSP, since it's just a modified version of InteliJ's IDE.
from AOSP root:
make idegen && development/tools/idegen/idegen.sh
Then just "Open Project" in Android Studio and select the android.ipr it generated.

To import AOSP source in Android Studio or Eclipse, follow the full instructions here :
https://android.googlesource.com/platform/development/+/master/tools/idegen/README

What Pedlar suggested above is one way of doing it. I ran into lot of Jar dependency issues when I tried it with IDEA community edition (Android Studio is a fork of IDEA IDE). The IDE keeps prompting you about duplicate jars etc. The generated project includes framework Java sources as well as App sources. I tried to build an App project which resulted in broken AOSP build. IMHO, IDEA is a great IDE for Java development. But didn't work well with AOSP.
What worked for me is using eclipse to browse/edit/debug framework sources, but build the code from a terminal window. To avoid AOSP build breaks, please create a shadow dir of AOSP (i.e. lndir of AOSP) and use shadow dir for eclipse project.
This is explained at Using eclipse to browse/edit AOSP link in step by step.
If you are working on AOSP, you might want to check Debugging Android framework services.

Related

Using Eclipse instead of Android Studio [duplicate]

I prefer eclipse over android studio, my question is if I can still use it to build projects for future development - for example the recycleview library. It is supported in eclipse too, but will future google libraries continue to support it?
My second question is, if I'm using eclipse to make an app, will it be run on new devices too, as the project structure is different in eclipse and android studio.
My final question is how can I use libraries from android arsenal if I don't use android studio (all the libraries there are for maven and gradle)?
I prefer eclipse over android studio, my question is if I can still use it to build projects for future development - for example the recycleview library. It is supported in eclipse too, but will future google libraries continue to support it?
In the end, it is all just Java, XML, and other such resources. The RecyclerView library is no exception- it is just a library that can be used in any IDE.
The IDE you use for development is just a tool to view and edit these project files. Separately, you use a build system to build the application. Your IDE, the build system, and the project files are completely separate and one doesn't depend on the other to create a functioning application. In fact, you can build an Android application without an IDE at all.
The biggest issue you might run into here is the format of libraries such as RecyclerView. In the Eclipse days (note that Eclipse Android projects typically use Ant for building), most libraries came as either JAR files or Android libraries (of source code). With the release of Android Studio and the Android Gradle plugin, everything is shifting towards Gradle dependencies.
Also be aware that Google is not going to continue supporting Eclipse development. The tools for building Android application in Eclipse will not continue to receive updates, so bugs may pop up in the future that prevent you from continuing to use it effectively.
My second question is, if I'm using eclipse to make an app, will it be run on new devices too, as the project structure is different in eclipse and android studio.
The output of building an Android application is the same regardless of how or where you build it - you get an APK with the same file structure. The structure of the built APK is independent of the structure of the source code.
My final question is how can I use libraries from android arsenal if I don't use android studio (all the libraries there are for maven and gradle)?
Eclipse can use both Gradle and Maven for building. If you want to use libraries as Gradle or Maven dependencies, you will need to set up your project to use either Maven or Gradle to build instead of Ant. Otherwise you can still find JARs for most projects that don't rely on the Android framework, or you will need to get the source code for the library and set it up as a project dependency yourself.

How can I convert an android project originally coded in IDEA or Eclipse to Android Studio and add Gradle?

I want to take on a sound recorder project from github: https://github.com/avipars/Android-SoundRecorder
But, it came from IDEA or Eclipse. I tried importing it through github, which didn't work. Then, I downloaded the ZIP and put it in android studio without much luck.
Android Studio won't recognize the file system and I want to get gradle working too.
So, how can I get it in Android Studio with Gradle working?
To clarify, I can get the project in Android Studio. It just won't compile.
Download the project in .zip form, then extract to your preferred workspace.
It looks like the project relies on two external libraries:
android.library.reference.1=../../android-libs/ListViewAnimations/library
android.library.reference.2=../../android-libs/UndoBar/library
Obviously, Android Studio won't know about these libraries while importing this project alone. Remove the above lines from project.properties and add them later into your Android Studio project as dependencies or modules (if you can find them). Otherwise, you can work out the dependencies in the code after importing.
Once you have removed those lines, from Android Studio, you can select "Import project"
Follow the import wizard and you should be brought into Android Studio with a summary of the import result. From there you can muck with .git stuff and add back in any third party libraries that this source code may rely on.
Hope that helps!

I can not create an apk on my eclipse

So I am trying to create an apk via eclipse for a small app I created (one of my first) but after going through several tutorials I can't find the android option which is suppose to present in Export. My Eclipse version is Mars.2 Release (4.5.2). I am using Eclipse IDE for Java Developers.
You have to install the sdk first. It's not included in eclipse.
How to setup eclipse for android app development
A personal recommendation:
Use Android Studio, you will have to get used to it but after 3 months I prefer it over eclipse. Also you should consider it since google stopped supporting Eclipse. android studio is the official android IDE

Android Studio and Eclipse

All the people that I work with use Eclipse for creating android apps. However, I recently found out that Android is no longer supporting Eclipse and they are moving to Android Studio. All that apps that I am working on have been complied and created with Eclipse.
I'm thinking if the code and the programming language is the same, then the compiler or the IDE shouldn't matter. Would we be able to still work together and share code if I switched to Android Studio and they stayed in Eclipse? What are some of the potential problems?
No, the two IDEs use different project structures, but Android Studio has a very nice wizard that allows you to move your Eclipse project to AS. I really recommend you and your team to move to AS.
As already stated, everybody would have to make the switch to Android Studio at the same time, and you would need to make some changes to the build system.
Until everyone makes the switch, you should just use the Eclipse/ADT bundle.
You can technically keep the same old folder structure for source files when porting a project to Android Studio (we tried it, it works), but the different build system is the main change that throws a wrench into the works.
Eclipse uses the ANT build system for Android projects.
Android Studio uses the Gradle build system.
We are in the process of planning a switch at my work, and everybody will need to switch at the same time, and the build system will have to be ported from ANT over to Gradle.
See more about Gradle: http://tools.android.com/tech-docs/new-build-system/user-guide
Migrating old projects to Android Studio: http://developer.android.com/sdk/installing/migrate.html
*edited for clarity regarding folder structure

Android Project with ActionBarSherlock doesn't get built

I implemented the current version of ActionBarSherlock to my Android Project.
Everything works fine and I don't get any errors.
But when I try to debug or export my project I don't get an .apk-file out of my project. Just a .jar-file with the name of my project.
I've read about some problems the SDK had with building projects that contain external libraries but this was at SDK version 14 and so I hope, this bug is fixed...
So there might be another cause for this problem.
Does anybody know a possible solution?
You cannot get *.jar file as the result of building Android project. This seems very strange to me. There must be something wrong with your project settings (if you changed them), or the project you build is of the wrong type (i.e. it is Java Application instead of Android Application).
You didn't mention which IDE do you use, but I assume you use Eclipse.
Make sure you have installed Android SDK and Eclipse ADT correctly (just in case).
Next thing to try is to create a new Android Application project from existing sources (there should be such option during the process of creation).

Categories

Resources