Version: 1.0Date: 2014.8.26 2014.8.272014.11.10Copyright: © kince reprinted the source for a long time did not write blog, but also because of the busy work of the relationship. Of course, this is not a reason, mainly a lot of bugs to change, and their efficiency is not very high, so spend a lot of time on fixing bugs. Gossip doesn't say much, cut to the chase.Launcher3 is the latest official Google launcher, compared to Launcher2, it is more compact, smooth, fresh and so on, so choose it as the object of research. The first step of course is to download its source code, git URL is: https://android.googlesource.com/platform/packages/apps/Launcher3/. If you don't have a git tool, you can click Master.
Just recently Lollipop's launcher source code has also been updated. And the previous Launcher3 will have some differences, but not big, pour the process is similar.
git download:
Compress package Download:
After downloading, unzip the directory as follows:
Then import eclipse, because some of the new features of Launcher3, you need to set the build target to API level 19 (not necessary, for the sake of research, Launcher3 source code can be compatible with large API16). Then import the project depends on the class library, this place is divided into three cases, one is to import the V4 package, manually add a libs directory, the V4 package added, the second is to protocol buffers, to https://android.googlesource.com/ Platform/external/protobuf.git download, preferably into a jar package, and then placed in the Libs directory. The third is to add Backupprotos.java to this class. Can be obtained from the previous step. Good friends in English can take a look at the following steps: Do it Yourself
- use Git to pull down the latest Launcher 3 Source:
git Clone https://android.googlesource.com/platform/packages/apps/launcher3
- Import existing code into Eclipse (Android Project from existing code)
- Change the project build target to API level 19
- ADD Android Support Libraries
- build protocol buffers JAR from AOSP source. You'll actually need to build the Protoc binary as well. You need to know what to use ' make ' has gcc available for the Protoc binary, and Maven for the JAR: HTTPS://ANDROID.G Ooglesource.com/pla...l/protobuf.git
- use Protoc binary built from step above to generate the Backupprotos.java file:
protoc–javanano_out=src/-I protos protos/backup.proto
- Rename the Android Package (Android Tools->rename application package) to one of your choice
- Add min SDK in a new ' uses-sdk ' element in Androidmanifest.xml (works down to API level, without too many complaints in Lint, obviously stick to play it safe).
- Clean and run. BIND APP WIDGETS error can be ignored
Fabio Lo Brutto:
Https://plus.google.com/+FabioLoBrutto/posts/KJeyKMBHVT7
After the completion of the directory structure as follows: If you want to make a launcher, then you need to change the name of the package, the study of the words will not be necessary. Last run, as follows:
The most complicated thing about launcher is not how to show applications, widgets, folders, and so on, but customize the view, because basically launcher view is custom, and the code is a lot, it's not that simple to understand. So, if the launcher inside of the custom view master, then the launcher also basic master. Therefore, the focus of the study should be on the custom view. In the future will continue to update on the Launcher3 development of articles, in doing launcher development friends can communicate together.
Android LAUNCHER3 Development Environment Building