Everyone has tried compiling android launcher 2.
However, it may fail for various reasons.
Today, I told him how to compile android launcher 2 on eclipse.
If you have compiled launcher 2 before android2.3.
Therefore, compiling android 4.0 4.1 may be much faster.
Import the Launcher2 project to eclipse.
At this time, the Launcher2 project has been imported into eclipse, but there will be more than 100 errors.
In the Android source code, many methods, members, classes, and packages are tagged with @ hide, which are not disclosed in the SDK, android is the most common class used to compile the Launcher source code. view. view member mScrollX cannot be accessed. Therefore, you must first download the Android code and compile it properly, because you need to use some compiled class. jar files.
Maybe you do not have jar, do not want to compile android source code. Then please download my entire package: http://download.csdn.net/detail/icemanyandy/4905045
It is better to use the jar package to be consistent with the target board. For example, if you want to run it on android 4.0, you must use the android4.0 jar package.
Later I will talk about how to port it to android4.1.
The name is slightly 1000 characters...
Import the download function from the above link, and add the package I provided.
At this time, it can be compiled and run on the android 4.0 real machine. The x86 simulator can theoretically run.
Port to 4.1:
Switch to the android 4.1 sdk environment first.
At this time, I found many errors, but they were fewer than before. Don't worry about them,
Some functions are not found on android 4.1. At this time, the functions to replace android4.1 are similar. function names are similar;
It is best to use the get sdk int version method, and use else if to determine the function that calls that sdk. java is not as useful as c macros you understand.
The newTagApi is used for compiling, so that no error is prompted for functions that cannot be found.
The name is slightly 1000 characters.
It can be run on Android 4.1. The downloaded package is running.
If you cannot find a function, find a way to replace it. For example, you can't find the variable mScrollX in it. Actually, it has the getScrollX method. You know. Because launcher is fast, it repeatedly calls getScrollX.
It will be slower, and it will be used directly. most of the errors are caused by this. We recommend that you download the package. contact me to provide technical support. All of these items have been modified and passed the test.
We often panic when compiling launcher2 in eclipse or other open-source projects in android.
What should I do if I encounter a problem ????
Possible problem: remotely calling the project in c ++/c android source code is the favorite option (in the input method PinyinIME ).
Possible problem: the function cannot be found. The problem may be greater. The variable cannot be found, and the hide function is also found.
I cannot give an example now. Anyone who has compiled launcher knows this.
Three packages are to be added. These three packages are obtained from android source code compilation. You can see the c ++/c header files. They cannot be treated as static lib.
Because you take the 4.0 package and run it on 4.1. If you cannot find the function definition, the system prompts method not found if you fail to find the function definition.
Therefore, I usually take the 4.1 jb package to 4.0 and run it. That's okay. Because the 4.1 launcher function is not as strange as the 4.0 launcher call:
4.0 launcher setFastAlpha (float) is actually seAlpha (float) in the android sdk. In fact, setFastAlpha is only a process of immediate refresh less than seAlpha. This is just like Fast.
Most problems about Fast are "possible problems.
Another type of problem is the variable. Now you can see mlayout, so you want to use it immediately.
This. The replacement of getLayout () is.
What do you think of when you see mScollX? Of course, if you add a package, you can compile it. You don't have to change it.
In short, erect strong confidence to solve them.
However, I have solved these Launcher issues in the mainstream. Download the link directly.
CyanogenMod android platform android 4.0 launcher 2 source code eclipse can be compiled android4.0 4.1 can run translated.
Android 4.0 launcher 2 source code eclipse can compile android4.0 4.1 can run
Http://download.csdn.net/detail/icemanyandy/5077791
Android
4.1 launcher2 source code can be compiled by eclipse
Http://download.csdn.net/detail/icemanyandy/4798628
QQ: 773179801
Www. softboy. cc. cm