Android Launcher3 Development Initial Chapter

Source: Internet
Author: User

Version Number: 1.0Date: 2014.8.26 2014.8.272014.11.10Copyright: © kince reprinted the source for a long time did not blog, but also due to work more busy 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 has more compact, smooth, fresh and so on. So choose it as the object of the study. The first step, of course, is to download its source code. The git URL is: https://android.googlesource.com/platform/packages/apps/Launcher3/.

Suppose there are no git tools. Be able to click Master.
Just recently Lollipop's launcher source code has also been updated. And the previous Launcher3 will have some differences, just not big, pour the process is similar.

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvd2fuz2ppbnl1ntax/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center "/>
git download:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvd2fuz2ppbnl1ntax/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center "/>
Compress package Download:
After download, unzip, folder such as the following:

Then import Eclipse. Due to some new features of Launcher3. The build target needs to be set to API level 19 (not required, for convenience of research purposes.) 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 folder, add the V4 package in. Second, need protocol buffers. To Https://android.googlesource.com/platform/external/protobuf.git download, it is best to hit the jar package. Then put it under the Libs folder.

Third, join the Backupprotos.java class.

Can be obtained from the previous step. Good friends in English can take a look at the following steps: Do it Yourself

  1. use Git to pull down the latest Launcher 3 Source:

    git Clone https://android.googlesource.com/platform/packages/apps/launcher3

  2. Import existing code into Eclipse (Android Project from existing code)
  3. Change the project build target to API level 19
  4. ADD Android Support Libraries
  5. 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
  6. use Protoc binary built from step above to generate the Backupprotos.java file:

    protoc–javanano_out=src/-I protos protos/backup.proto

  7. Rename the Android Package (Android Tools->rename application package) to one of your choice
  8. 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).
  9. Clean and run. BIND APP WIDGETS error can be ignored

Fabio Lo Brutto:
Https://plus.google.com/+FabioLoBrutto/posts/KJeyKMBHVT7

After the guided folder structure such as the following:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvd2fuz2ppbnl1ntax/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center "/> If you want to be a launcher, you need to change the name of the package. It is not necessary to study.

Finally executed, for example the following:

The most complicated thing about launcher is not how to display applications, widgets, folders, and so on. But the definition of view, because basically launcher view is defined by itself. And the code is very numerous. It's not that easy to understand.

So, assuming that the launcher inside of their own definition of the view master, then the launcher also basic master.

Therefore, the focus of learning should be on your own definition 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 Initial Chapter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.