Escolar Documentos
Profissional Documentos
Cultura Documentos
Gostei (12)
(0)
Est quase a fazer um ano que a Google lanou o Android Studio um IDE de
programao para a plataforma Android. Este IDE semelhante ao popular
Eclipse, com ADT Plugin, oferecendo as melhores ferramentas e
funcionalidades aos programadores. Segundo a prpria Google, com o
Android Studio a programao para Android mais simples e rpida.
Hoje vamos mostrar como podem comear a usar o Android Studio.
JAVA_HOME
C:\Program Files\Java\jdk1.7.0_21.
Agora basta esperar uns segundos ate que seja criada a estrutura da nossa
aplicao.
E est feito.
Comparativamente ao eclipse, o Android Studio tem uma interface mais
intuitiva e melhor organizada. Ao nvel da performance, os dois IDE so
bastante semelhantespois no estivssemos ns a falar em java.
Experimentem e diga-mos os que acharam.
Downloading/Installing Eclipse
1.
To use Eclipse you must have an installed version of the Java Runtime Environment (JRE).
The latest version is available from java.com/en/download/manual.jsp. If after downloading
Eclipse if it does not execute you will need to download and install the JRE, (or follow the
instructions in step 2 to download and install the JDK which contains the JRE).
2.
Since Eclipse includes its own Java compiler, it is not strictly necessary to have a version of
the Java Development Kit (JDK) installed on your computer. You may wish to install the JDK
anyway. The latest version is available
from: www.oracle.com/technetwork/java/javase/downloads/ If you install the JDK, it is
recommended that you locate it in a root-level directory; C:\jdk1.7.0_71. It is recommended that
you use the x64 bit version if you have a 64 bit OS.
3.
4.
5.
6.
After the download has completed, decompress the Eclipse distribution folder into a folder. If
you have previously installed another version, say Eclipse for C/C++, it is recommended that you
place this version in a different directory tree, e.g., F:\eclipse. Note: the contents of the zip
archive are already packed in a directory named eclipse, so simply specify that the extraction
should be to F:\. Avoid spaces in the path to Eclipse. You may wish to put a shortcut on your
desktop or launch menu; find eclipse.exe in the root directory of the installation and create a
shortcut to it.
7.
Start Eclipse.
The first time you start Eclipse, you'll be asked to specify a location for the Eclipse Workspace;
this is where Eclipse will, by default, keep your programming projects: This can be any folder you
wish.
8.
9.
Feel free to explore the options and then proceed to the Workbench.
10.
11.
Eventually you may want to use most of this, but you should consider cleaning it up to start.
12.
It is suggested you minimize the Task List and Outline Views on the right side of the Eclipse
workbench:
2.
3.
In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following
URL for theLocation: https://dl-ssl.google.com/android/eclipse/
Note: The Android Developer Tools update site requires a secure connection. Make sure the
update site URL you enter starts with HTTPS.
4.
Click OK.
5.
In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
6.
In the next window, you'll see a list of the tools to be downloaded. Click Next.
7.
If you get a security warning saying that the authenticity or validity of the software can't be
established, clickOK.
8.
9.
Once Eclipse restarts, you may need to specify the location of your Android SDK directory.
1.
1.
2.
Open the SDK manager, (from within Eclipse: Window/Android SDK manager). After the
SDK manager loads you will be presented with a packages listing.
The image above shows the recommended tools and APIs to download, (except for the Glass
Development Kit Preview which was accidentally selected). If you discover later you need other
APIs the process to download them is the same. You do NOT need Android 5.0 API for this
course unless you plan on using an Android device running 5.0 for testing your apps.
3.
After clicking the"Install <x> packages..." you will receive a confirmation window.
Click the "Install" button and wait for the packages to download.
4.
After the package download completes, you will be prompted to close the SDK Manager and
re-open to check for further updates.
If you do so, (it should be unnecessary), be aware that it may indicate that you need other
packages. Thiose package will most likely be for the Android technologies, (Google glass,
Wearables, etc.), that we are not using.
5.
At the end of the SDK download/install you will be prompted to exit Eclipse and restart.
If you do NOT encounter any install problems proceed through chapter one to configure
Eclipse for the course.
Troubleshooting
If you encounter install problems, to quote Douglas Adams "DON'T PANIC!".
1.
2.
The following error dialog was encountered when downloading the ADT.
A quick google found hints for the solution at stackoverflow.com. Three solutions for this problem
was found.
1.
2.
3.
In the Eclipse root install directory, delete the artifacts.xml file, restart Eclipse and
proceed.
b. Solution a. was used and allowed the download to proceed. Unfortunately that resulted in a new
problem.
c. Opening the SDK Manager and browsing to find the SDK Location indicated that no SDK
directory had been created by the ADT download. Any attempt to start the SDK Manager from
within Eclipse, (Window/Android SDK Manager) to download the APIs resulted in Eclipse
opening the Preferences to select the SDK directory. This catch 22 loop was solved by using
Windows Explorer to open the Eclipse root install directory and manually creating an
AndroidSDK directory and then within it creating a tools subdirectory. Selecting the tools
subdirectory from within the Eclipse Preferences/Adroid as the SDK Location allowed the SDK
Manager to be used to dowload the APIs.
d.
The ADT Installing the Eclipse Plugin web page at developer.android.com contains a
troubleshooting section near the end.
e. If you encounter problems not discussed here use google to try and find a fix, (the help at
stackoverflow.com is quite good). You can also post an explanation of your problem on the
course forums.