14. android sdk - how to make it work?
DESCRIPTION
Cross-Platform Mobile Development @ Telerik AcademyTelerik Software Academy: http://mobiledevcourse.telerik.comThe website and all video materials are in Bulgarian Content:The Android SDKInstallation of Android SDKEclipseAndroid SDKAndroid ADTInstallation of PhoneGap"Hello PhoneGap" projectTRANSCRIPT
![Page 1: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/1.jpg)
Android SDKHow to make it work?
Doncho Minkov
Telerik Software Academyhttp://academy.telerik.com
Technical Trainerhttp://minkov.it/
http://mobiledevcourse.telerik.com
![Page 2: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/2.jpg)
Table of Contents The Android SDK Installation of Android SDK
Eclipse
Android SDK
Android ADT
Installation of PhoneGap "Hello PhoneGap" project
![Page 3: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/3.jpg)
The Android SDK
![Page 4: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/4.jpg)
The Android SDK Android is a software stack for mobile devices that includes
An operating system
Middleware
Key applications
The Android SDK provides necessary tools and APIs to develop applications Using Java programming language
![Page 5: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/5.jpg)
Installation of Android SDK
How to start Android development?
![Page 6: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/6.jpg)
Steps for Installing Android SDK
1. Installing Eclipse IDE
2. Install Android SDK
3. Install the ADT plugin for eclipse
4. Add components needed for development
![Page 7: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/7.jpg)
Eclipse What is Eclipse?
A multi-language software development environment comprising
An integrated development environment (IDE)
Mostly written in Java
Eclipse is used to develop applications In Java, C, C++, Perl, PHP, Python,
R, etc.
For Android (using Java)
Download at http://bit.ly/EclipseClassic
![Page 8: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/8.jpg)
Android SDK
For the Android SDK to be installed The machine should have at least
jdk 1.6 Version 1.7 is also ok
Then download the installer file from http://
developer.android.com/sdk/index.html
![Page 9: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/9.jpg)
Android SDK (2)
* There is a known bug during installation of the SDK The installer cannot locate the jdk
Just click the "Back" button and then "Next"
It should work
![Page 10: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/10.jpg)
The Android SDK Manager
After the installation of Android SDK Some components should be
installed Packages for Android versions: 2.1,
2.2, 3.2, etc.
Some other tools like a couple of Google APIs
Start the Android SDK Manager and wait for fetching of packages This may take a while Took me two / thirds of a day for all
packages
![Page 11: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/11.jpg)
Installation of ADT Plugin
Use the Update Manager feature of Eclipse To install the latest revision of ADT
on your development computer
How to download it? Start Eclipse, then select Help >
Install New Software -> Add, in the top-right corner
In the Add Repository Enter "ADT Plugin" for the Name
Copy for location https://dl-ssl.google.com/android/eclipse/
![Page 12: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/12.jpg)
Installation of ADT Plugin
In the Available Software dialog Select the checkbox next to
Developer Tools and click Next
In the next window, you'll see a list of the tools to be downloaded Click Next
Read and accept the license agreements
Then click Finish
Restart Eclipse
![Page 13: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/13.jpg)
Installation of Android SDK
Live Demo
![Page 14: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/14.jpg)
Android Virtual Device
How to Create a AVD?
![Page 15: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/15.jpg)
Android Virtual Device To create virtual device
Open Eclipse -> Window -> ADV Manager Open the Android Virtual Device
manager
Add new device With the Android OS version needed
Why need AVD? To test your app before deployment
to a phone
To test on different versions of Android OS
To find and correct simple mistakes
![Page 16: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/16.jpg)
AVD Manager - Example
Create new AVD
![Page 17: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/17.jpg)
AVD Manager - Example
Give it some name Better add the OS
version
Add SD card sieze Select OS version You are done!
![Page 18: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/18.jpg)
New PhoneGap Project
Two ways of creating
![Page 19: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/19.jpg)
PhoneGap Project How to create a PhoneGap Project?
Create an android project File -> New -> Android Project
In the root directory of the project, create two new directories
/libs and /assets/www Copy phonegap.js from your
PhoneGap download earlier to /assets/www
Create an index.html file in /assets/www
Copy phonegap.jar from your PhoneGap download earlier to /libs
![Page 20: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/20.jpg)
New PhoneGap Project Copy xml folder from your PhoneGap download to /res
Set the build path of the phonegap.jar Right click on the /libs folder Go to Build Paths/ -> Configure
Build Paths. In the Libraries tab, add phonegap-
1.0.0.jar to the Project
![Page 21: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/21.jpg)
New PhoneGap Project (2)
Make a few adjustments to the project's main Java file Change the class's extend from
Activity to DroidGap
Replace the setContentView() line with super.loadUrl("file:///android_asset/www/index.html");
Add import com.phonegap.* Remove import android.app.Activity
![Page 22: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/22.jpg)
New PhoneGap Project (3)
Right click on AndroidManifest.xml and select Open With > Text Editor You should edit the xml
By adding new elements
By editing existing elements
You can see how the final AndroidManifest.xml file should look like http://
phonegap.com/assets/guide/manifest.jpg
![Page 23: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/23.jpg)
New PhoneGap Project -
Alternative Way This is not so pleasing, right? Hopefully there is an easier way
Using MDS AppLaud PhoneGap Eclipse Plugin
How to install it? Open Eclipse
Go to Help -> Install New Software -> Click Add Like with the ADT plugin
For location type: https://svn.codespot.com/a/eclipselabs.org/mobile-web-development-with-phonegap/tags/r1.2/download
![Page 24: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/24.jpg)
New PhoneGap Project –
Alternative Way (2) After the plugin is installed and ready to go A PhoneGap icon should be
displayed in the toolbar
After than the creation of new project is straight-forward
With AppLaud plugin you can select to include jQuery or Sencha
![Page 25: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/25.jpg)
New PhoneGap ProjectLive Demo
![Page 26: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/26.jpg)
Hello World PhoneGap
![Page 27: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/27.jpg)
Hello World PhoneGap Lets make our "Hello World, PhoneGap!" application Till now we have an empty
PhoneGap project
All we need to do is to edit the index.html file Created by us
Located in /assets/www
This is the Entry point of our Application
![Page 28: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/28.jpg)
Hello World PhoneGap – Example
Hello World, PhoneGap! Open the index.html and copy the
following<!Doctype html><html><head> <title> First PhoneGap Application </title><head><body> <h1>Hello PhoneGap</h1></body></html>
Go to Build -> Run as Android Application The emulator should start
And the app run!
![Page 29: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/29.jpg)
Hello World PhoneGap
Live Demo
![Page 30: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/30.jpg)
форум програмиране, форум уеб дизайнкурсове и уроци по програмиране, уеб дизайн – безплатно
програмиране за деца – безплатни курсове и уроцибезплатен SEO курс - оптимизация за търсачки
уроци по уеб дизайн, HTML, CSS, JavaScript, Photoshop
уроци по програмиране и уеб дизайн за ученициASP.NET MVC курс – HTML, SQL, C#, .NET, ASP.NET MVC
безплатен курс "Разработка на софтуер в cloud среда"
BG Coder - онлайн състезателна система - online judge
курсове и уроци по програмиране, книги – безплатно от Наков
безплатен курс "Качествен програмен код"
алго академия – състезателно програмиране, състезания
ASP.NET курс - уеб програмиране, бази данни, C#, .NET, ASP.NETкурсове и уроци по програмиране – Телерик академия
курс мобилни приложения с iPhone, Android, WP7, PhoneGap
free C# book, безплатна книга C#, книга Java, книга C#Дончо Минков - сайт за програмиранеНиколай Костов - блог за програмиранеC# курс, програмиране, безплатно
?
? ? ??
?? ?
?
?
?
??
?
?
? ?
Questions?
?
Android SDK
http://mobiledevcourse.telerik.com
![Page 31: 14. Android SDK - How to make it work?](https://reader033.vdocuments.mx/reader033/viewer/2022052522/554f5182b4c905b9508b4de7/html5/thumbnails/31.jpg)
Free Trainings @ Telerik Academy
Cross-Platform Mobile Developmenthttp://mobiledevcourse.telerik.com
Telerik Software Academy academy.telerik.com
Telerik Academy @ Facebook facebook.com/TelerikAcademy
Telerik Software Academy Forums forums.academy.telerik.com