Recently interested in mobile development, decided to use spare time to develop some apps or games over the next few years, given the high cost of iOS development and its familiarity with Java, it chose to learn Android. All say the Android market is not very good, the yield is more difficult, but still feel as long as the Kung fu deep, product good, there will always be someone to use.
No, I went to search the Internet. Most of the Android development is based on Windows+eclipse, but their work this time is the use of Linux+idea, and with special comfort, so decided to still use Ubuntu+idea, do not say nonsense, The configuration process is as follows:
1. Your job is to do Java Web development, so the Java environment is there, and Ubuntu and idea native bring no additional installation. Over hereInstall the Android SDK directly:
Online and books are said to go to the Android official website to download, but the official website has been wall (recently many sites have been wall, Google also not go, free of the wall software said server pressure is too big to provide free use, I zgzf ah ... ), so go online search directly, finally found, address: http://www.cr173.com/soft/78226.html
Downloaded several times to start using the chrome comes with the download tool, unexpectedly can not continue to resume (disappointment ... ), and then try to use the Ubuntu comes with Firefox, even continue to preach (well, seldom used before, underestimated).
This package includes the Android SDK and Eclipse (I say how big), decisively give up eclipse (after three years of eclipse after I spent a week of idea was decisive to give up, idea is the Java development artifact).
Enter the Android SDK directory with the following content:
I do not explain the specific, I read it, I do not quite understand (new).
2. Go to the Tools folder, execute the./android command, and come out with an SDK Manager window, as follows:
I chose 4.4.2 version (casually, and now do not know the differences between the different versions, as well as the support of the hardware configuration, there is a pit after slowly fill it, stones), I chose 4.4.2 version of all the content (from the programmer's experience, want to become a field of Daniel, what Doc,source ah have to see) and download (i Last night in the company released to a faster, home almost two o'clock to start with the environment, download the SDK and download version package, especially slow, wipe, fast four o'clock by his own, this morning eight o'clock to participate in the company activities, the afternoon back to find almost the next good).
3. Open idea (I use the 13.1.3, OK, I use the cracked version, mistakenly sprayed, I also hate piracy, with the community version of the large half a year, the Community edition function less too much, then no way to find colleagues to generate a key, on the same), create a new empty project, Once built, create a new Android module that can be provided by the idea by default (try to run first).
After the module is built, it is obvious that it failed because the Android AVD does not yet match.
4. Configure Android AVD
Input command: Android AVD, pop-up window as follows:
Click New and the popup window is as follows:
Fill in the items can be filled, found that the target is not filled, not to submit, crazy ...
Search on the Internet a lot of content, failed, try to configure in idea.
Under the module under construction, select Run-edit configurations ..., the window is as follows:
Note the emulator option on the bottom right, Prefer Android Virtual device option, should be empty (because the article is I have configured, I hope everyone fully play their own imagination, when that is empty), select button ..., pop up the same diagram as above, Found at this time the target choice can choose, decisive choice one. Fill in the blanks with the contents as follows:
Click OK, so the AVD is ready to be built.
5. Running the project
First run Android project (a little excitement, the first time Hello word comes out when the feeling, programmers know), found that the failure, the reason is unknown, again crazy.
Continue to try to solve the problem, or go to edit configurations ... Page, click ... button to come out of this window:
Select the emulator line, and then select the Start button on the right, and find that the startup failed with the following error:
"Failed to start emulator: Cannot run program "/home/q/adt-bundle-linux-x86-20131030/sdk/tools/emulator": java.io.IOException: error=2, No such file or directory".
googlestable一搜(公司大神推荐的google的代替品,貌似没有被墙),stackoverflow有相同的问题(一阵窃喜,stackoverflow,大爱啊),第一个回答就解决了问题:If you‘re running a 64-bit system, you need to install ia32-libs:sudo apt-get install ia32-libs安装花了一会时间,再次点击运行按钮,结果如下:
The result is finally out (booting is slow, is it a computer problem?) Resolved later).
At this point, the Android environment configuration is complete, this is only the beginning of the long road of Android Development, will encounter a variety of difficulties in the future, I hope that they can know hard to climb the Android peak.
Finally spit out a groove on the tools of Ubuntu (used for a year), really difficult to use, unexpectedly can not automatically match the window size, than QQ is far from the difference