Why wouldn't Android applications compile from source? - android

I am trying to compile the default projects that come with Android; however, it doesn't seem to be working at all. Most of the classes and libs seem to be missing.

Did you move your SDK after creating the project? If you did, this breaks the build scripts.
On a secondary note- Google recommends using Eclipse IDE (
http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/heliossr1
) for Android Development. Textmate is great, but Eclipse will make your life a lot easier for Android development.

I know this is an old question, but I'm curious. Did you ever try running
android update project --path .
in the project's directory? I have needed to use that command in the past.

Related

Is it possible to run the same source code in eclipse and android studio?

I am new to android development, So I am not sure if this question is very silly
I was wondering if the same source code can run in both eclipse and android studio
If this is possible how to do it, and what points should be considered?
If not what are the road blocks to accomplish this.
Simple answer: Yes, you can "write" (not run) in both IDE's.
Aside: You really don't even need an IDE. If using Gradle, you can write code using any text-editor, then compile, build, test, and install all using Gradle.
If this is possible how to do it?
Well, Android Studio can import Eclipse projects. That is pretty well documented.
Eclipse (unofficially) has an Andmore project and also supports Gradle projects.
what are the road blocks to accomplish this
If using Eclipse, it's not supported by the Android team anymore, and you'll likely be missing out on features that are actively added to Android Studio.

Google launcher building

I tried to build this project using JetBrains IntelliJ IDEA but it was unsuccessful (there were a lot of errors). The project has an Android.mk file, but I didn't see the C++ code.... How can I build this project? I've tried to use another IDE, then I tried building from the console but it was not useful. Perhaps, does Launcher3 need NDK to build it?
You'll need to isolate the launcher's code and then identify all of it's dependencies. If the code has any C++ code then it definitely requires the NDK and currently IntelliJ/Android Studio does not have any stable support for NDK based app development (though it is a work in progress) else if it is pure Java (most probably) then you'll have to manually add the classes and build the app from Android Studio! Either way you will have to dig deeper into the source and know for yourself. Unfortunately there seems to be no easier option, for now. I wouldn't mind being proved wrong for the matter.
EDIT :
I glanced through the code and I noticed there are no C++ source files or library (*.so) files. This isn't a gradle project and hence cannot be built as one. You'll need to setup a gradle based Android project and then begin adding the sources (src, tests etc.) and their dependencies (res etc.). You can start of here : Getting Started with Android development if you're new, else you can move to this : Gradle and Android

Can I use Android Studio when teammates uses Eclipse ADT?

Just a quick question I did not find a good answer on. We are currently working on an APP created with Eclipse ADT Bundle. I recently started exploring Android Studio, and like it. Is it possible to still collaborate with my mates using Eclipse with a shared GitHub repo?
I noticed Android Studio converts the project to its own file structure, so I guess this does not go well with Eclipse, and the repo.
Is there any solutions for this? So I can keep developing in Android Studio, push to GitHub, while the rest of the team use Eclipse?
I think you can do it, you'll just have to explicitly define a sourceSet that matches the Eclipse structure. If you use any other build variants, they can't have any sourceSets because you wouldn't be able to check those files in to source control. However, there are several useful things you can do with build variants just with the build file. I think you can check in the build.gradle and other gradle stuff and it won't mess up your coworkers.

Android - Build application without eclipse

I have one main application and an Android library project that it
uses
I can compile and run the application fine in eclipse
when I try to build the same app using ant I am facing issues
I am not able to get the same result with aapt that eclipse does(in
the background)
eclipse plugin seem to merge the resources together (layouts, icons,
strings, etc) for both the main app and the library project.
Anyone knows how to do this in command line in aapt
Thanks
Check the documentation: http://developer.android.com/tools/building/building-cmdline.html
It has everything about building without Eclipse.
You can compile your applicaiton without eclipse using this way. Its a perfect idea. Also refer this blog.

Testing my android library without compile

I would like to test my library in an android application, but I would like to avoid compiling and moving around .jar files.
In Xcode for iOs development, it's possible to add your library project in your workspace inside your other project (a test app) and when you run your test app, it builds the library and links everything up correctly.
Can I do this for Android development in Eclipse? How can I do this?
I tried to add a library but it seemed very manual which isn't ideal on time.
The important thing here is that I do have Android references and dependancies, so i can't just unit test the library by itself. I am also creating an SQLite database which I would like to inspect during development.
I guess you are asking about Android Library projects, otherwise you can just test your library using JUnit.
In such case, the post android: testing library projects gives you a step by step guide on how to proceed to test the Android Library project in a stand-alone fashion. Think it can also be tested through the tests belonging to the Android project that uses the library.
You can test your library code using RoboElectric that allows you to test without the need of deploying an android emulator.
Or you can set your library project as an Android library project and put the test in the first project. link
In latest android SDK tools you do not need to add jar in build path, they will be added automatically.
you can put you jar file in libs folder of your project, But it will defiantly be compile before running.

Categories

Resources