Compile Email application from AOSP - android

I would like to add some features to the AOSP Email application which is not supported anymore. So I cloned the repository here (which is a Eclipse project) and migrated it to a Gradle project in Android Studio. But after that it comes to thousend Java errors, missing resources and so on...
So has Google really a not working repo there? Do I maybe need some other repos from AOSP? As it is for now I can't work with it anymore...

So I cloned the repository here (which is a Eclipse project) and migrated it to a Gradle project in Android Studio.
None of the AOSP projects are designed to be used this way. They are designed to be built as part of a firmware build.
If your objective is to contribute changes back to the AOSP, you will need to follow their instructions for using their source code.
If your objective was to create your own email app, you may be better served starting with some base that is buildable as a regular Android app (e.g., K-9 Mail). Otherwise, you are going to need to fix all of those problems, as they reference things that are not going to be available to your app project via the Android SDK.

Related

Problem with Integration of an Existing Android Library When Building an Android Library

I need to build an Android library for use inside a Unity project. There's nothing different about the build process itself and I managed to build a simple plugin library I can use and I can see commands going in and information coming out.
But now I need to include an external library. I know the library works because I have a demo project, an app, that runs on the required device and does what it's supposed to do. But the instructions to integrate it into a project assume that it is an app and so, do not make much sense in my case.
I have scrolled through a dozen manuals about integrating android libraries but none of them seem to work. I would appreciate a set of instructions about how to integrate an external library in an android project, considering the project is, itself, a library, with respect to the latest Android Studio and build tools.

Why don't we have a single file to open an Android Studio Project?

Why don't we have a file similar to the .xcodeproj (for XCode applications) or an .xds (for Sencha Architect Projects) for our Android Studio Project?
I'm pretty sure a good number of you here have experienced the frustration of trying to import a project you see online in order to piece it apart better and learn how it works. I get that we are supposed to Import Android Projects built using Eclipse and Open Android Projects built using Android Studio.
However, why is it that we have to go through File -> Open -> then pick out the directory of the Android Studio app that we want to open? And the thing is, Android Studio doesn't seem to know it's an Android Studio project until it tries to open and build it. In the screenshot I have below, I have the sample Android Studio projects of ARToolKit, but I've only imported two of them.
As you can see, only those I've imported "can be seen as an Android Studio Project" as indicated that they have the Android Studio logo instead of a Folder.
This can be an issue for those just starting to develop in Android Studio on their own and they try and use existing projects (build from Eclipse or Android Studio) and they hit a snag with just trying to import the projects for reference. They might not know that they should import the folder and not the projectname/src subfolder. It adds to the "steep learning curve" that Android Development has if opening/importing projects aren't streamlined to a degree.
To sum up, my question is:
Why don't we have a single file that we can open that would in turn open Android Studio and import and build the project if it isn't built yet?
Android is not iOS. iOS development is only possible in xcode, hence it makes sense they added a shortcut to open it in xcode directly with a .xcodeproj file. Make life easier for iOS developers.
Android development however can be done outside of android studio as well. Eclipse is just one example, there may be other IDE's that support this. This is possible because android has standalone SDKs and tools that third party applications can use. iOS does not.
Imagine you are working on an android project in android studio. Then your boss tells you someone from 3000km away is going to help you. This guy may be using android studio, but maybe he isn't. When there are multiple options that developers can choose from individually, you do not want to pollute version control with files that you are using, but others may not care about. Each their environment.
This is merely a logical conclusion that you can come to by comparing. The "real" reason why this was done can only be answered by the people that created (adapted intellij) android studio.
This has been very frustrating to me too.
I try to give you a "beta" answer, waiting somebody to confirm it to me.
An Android project is just the composition of many parts that in some cases are concurrent to create the apk file.
It's just like what happens for the whole java projects: you have the main/src/java, the main/src/test, the maver or gradle files, the gradle or maven wrapper, the manifest, the configuration etc.
So you won't have a single project, but a series of folders that can contain many "flavours" or "versions" of the product itself.
The only help it is given to us is the Android studio icon that appears if a folder contains an android project in its subfolders.
I don't know if I have really answered to you, I just have given you my impressions and my thought.

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.

Making changes to a built-in Android apps

I've pulled and compiled the latest Android tree. Now I want to make changes to the Android's Browser application.
The environment in Eclipse is already set up. I tried creating the project by selecting "Build project from existing source", but it fails to build because it uses libraries not in the SDK.
Does anyone know how to import the missing source in order to build the Browser app, or even better, how to just copy the source into a separate project and use it like I was developing a regular application?
Does anyone know how to import the missing source in order to build the Browser app
That is not possible. The "missing source" is the operating system.
how to just copy the source into a separate project and use it like I was developing a regular application?
That too is not possible.
You cannot just grab an app out of the Android open source project and build it via the SDK. Some of the apps were first written before the SDK existed. Other apps rely upon APIs that, for various reasons, have not yet been exposed in the SDK.
You are welcome to make modifications to the Browser app. However, to build them, you need to use the build process for the firmware, not treat it as a regular SDK-based project.

Categories

Resources