Android launcher3 development environment, androidlauncher3

Source: Internet
Author: User

Android launcher3 development environment, androidlauncher3
Version: 1.0 Date: 2014.8.26 2014.8.27 2014.11.10 copyright:©2014 kince reprinted and noted that the source has not been a blog for a long time, but it is also because of busy work. Of course this is not a reason, mainly because many bugs need to be changed, and their efficiency is not very high, so a lot of time is wasted on fixing bugs. If you don't talk much about it, let's get into the question. Launcher3 is the latest official google Launcher. Compared with Launcher2, Launcher3 is more compact, smooth, and fresh. Therefore, Launcher3 is selected as the research object. The first step is to download the source code. The git website is https://android.googlesource.com/platform/packages/#/launcher3 /. If you do not have the git tool, click master.
The Launcher source code of lollipop is also updated recently. There are some differences with the previous Launcher3, but it is not big. The import process is similar.
Git download:
Download the compressed package:
Decompress the package. The directory is as follows:

Next, import eclipse. Because of some new features of Launcher3, you need to set build target to API level 19 (not required. For the sake of convenience, the source code of Launcher3 can be compatible with large API16 at least ). Then, import the class library that the project depends on. There are three situations: first, import the v4 package, manually add a libs directory, and add the v4 package; second, you need protocol buffers. Third, add the class BackupProtos. java. You can obtain it from the previous step. For more information, see 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 will actually need to build the protoc binary as well. you need to know how to use 'make' have gcc available for the protoc binary, and Maven for the JAR: https://android.googlesource.com/pla... L/protobuf. git
  6. Use protoc binary built from step abve to generate the BackupProtos. java file:

    Protoc-javanano_out = src/-I 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 17 without too tables complaints in Lint, obviously stick to 19 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

The directory structure after the import is as follows: if you want to create your own Launcher, you need to change the package name. If you want to study it, it is unnecessary. Run the command as follows:

The most complex thing about Launcher is not how to display functions such as applications, widgets, and folders, but how to customize the View. Basically, the View of Launcher is customized, and the code is a lot, it is not that easy to understand. Therefore, if you have mastered the custom View in the Launcher, you will have a basic understanding of the Launcher. Therefore, the learning focus should be on the custom View. In the future, we will continue to update articles on Launcher3 development. If you are working on Launcher development, you can join us.

Related Article

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.