Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import the AOSP apps (launcher, contacts,...) into Android-Studio?

Background

Google has a website for all of the AOSP apps here, which includes its launcher, contacts etc...

The problem

I'd like to know how to import those apps. More specifically, the launcher and the contacts apps (though I'd also like to know about others too).

Thing is, it's not that simple. You can't just import the cloned project and that's it. Even if you use Eclipse (which seems like the official tool used on those repositories, according to the folders hirerchy ) it doesn't work as easily.

What I've found

I've found an old post regarding how to import the launcher (version 4.4.x) , but it's using Eclipse and I think require Linux to build some files.

I've tried to import using Eclipse, but for some reason I couldn't get to use a working "protobuf" library. I've tried to use a jar from here, but it didn't succeed importing it.

There is also a nice third party library that has an imported version of the launcher app, but currently it's a bit behind as it's based on Kitkat (4.4) and not Lollipop (5.0) .

The question

How do you import those projects? Is there an easy way? Would it work even on Windows OS and Android Studio ?

like image 747
android developer Avatar asked Mar 23 '15 21:03

android developer


1 Answers

How do you import those projects?

You just clone their git repositories. However the only way to compile them will be together will all the AOSP project.

Trying to compile the app without it is impossible because of an ugly mix of:

1.Dependencies with other projects of AOSP

2.Using hidden API's which are not available to a regular app(these apps were designed to be system apps which have additional API's). These APIS don't even exist in the SDK.

3.Using Android.mk system with hacks that can't be used with Gradle or even the eclipse plugin.

Is there an easy way?

No. For the Launcher its few days of work, for the Contacts its easier to start from scratch.

Would it work even on Windows OS and Android Studio ?

Not without a lot of effort.

There is one more thing, the applications you see in Nexus devices are not a result of compiling the code you download from Google's website. Their apps go through many patch cycles and QA while what you will compile result in a very buggy product which will need heavy maintenance.

My suggestion is to look for truly open source applications, and not count on Google's good will.

like image 115
skoperst Avatar answered Sep 19 '22 23:09

skoperst