Skip to Content
Android Developer Tools深入精要
book

Android Developer Tools深入精要

by Mike Wolfson
July 2014
Intermediate to advanced
248 pages
5h 19m
Chinese
GoTop Information, Inc.
Content preview from Android Developer Tools深入精要
編譯你的程式碼
|
125
第九章:建置工具
第九章
建置工具
[Page-129]
當打造
app
時,某些時機必然會去編譯程式碼,並將其打包成可部署的程式;這一章
將介紹這過程中會用到的工具。
這自動化的建置工具也可以用來打包
Android
應用程式,它支援多種工具,包括
Ant
Maven
以及新進的
Gradle
http://www.gradle.org
);關於這些工具的更多細節已超出
本書的範圍,我們將會討論一些基本的概念讓你有個開端。
編譯你的程式碼
當在開發電腦程式時,需要將我們正在使用的電腦語言(以我們的例子是
Java
)轉譯
到一個不同的電腦語言而讓電腦能理解(在這例子是
Dalvik
相容可執行檔,或
DEX
檔案)。這個過程稱為編譯(
compiling
)。為了驗證你的程式碼以及當你打包程式要
發行時,你會需要執行編譯。
若你正在執行的
Java
是最新的版本(或是比
1.6
更新),為了能正確地建置,則必須
要設定你專案的「遵從級別(
compliance level
)」。操作步驟為:
1.
在你的
Android
專案上點右鍵。
2.
選擇
Properties
Java Compiler
3.
點選「
Enable project specific settings
(開啟專案特定的設定)」。
4.
在「
Compiler compliance settings
(編譯器遵從級別設定)」裡選擇
1.5
1.6
如果你是使用
Eclipse
且有勾選「
Build Automatically
(自動建置)」的話,則程式碼 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Android 高效能多執行緒

Android 高效能多執行緒

Anders Goransson
深入淺出 jQuery

深入淺出 jQuery

Ryan Benedetti, Ronan Cranley
HTML5 錦囊妙計

HTML5 錦囊妙計

Christopher Schmitt, Kyle Simpson

Publisher Resources

ISBN: 9789863470861