14. Android SDK - How to make it work?


Published on

Cross-Platform Mobile Development @ Telerik Academy
Telerik Software Academy: http://mobiledevcourse.telerik.com
The website and all video materials are in Bulgarian
The Android SDK
Installation of Android SDK
Android SDK
Android ADT
Installation of PhoneGap
"Hello PhoneGap" project

Published in: Education, Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

14. Android SDK - How to make it work?

  1. 1. Android SDK How to make it work?Doncho MinkovTechnical Trainerhttp://minkov.it/Telerik Software Academyhttp://academy.telerik.com
  2. 2. Table of Contents The Android SDK Installation of Android SDK  Eclipse  Android SDK  Android ADT Installation of PhoneGap "Hello PhoneGap" project
  3. 3. The Android SDK
  4. 4. The Android SDK Android isa 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
  5. 5. Installation of Android SDK How to start Android development?
  6. 6. Steps for Installing Android SDK1. Installing Eclipse IDE2. Install Android SDK3. Install the ADT plugin for eclipse4. Add components needed for development
  7. 7. 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
  8. 8. 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
  9. 9. 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
  10. 10. 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
  11. 11. 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/
  12. 12. Installation of ADT Plugin In the Available Software dialog  Select the checkbox next to Developer Tools and click Next  In the next window, youll see a list of the tools to be downloaded  Click Next  Read and accept the license agreements  Then click Finish Restart Eclipse
  13. 13. Installation of Android SDK Live Demo
  14. 14. Android Virtual Device How to Create a AVD?
  15. 15. 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
  16. 16. AVD Manager - Example Create new AVD
  17. 17. AVD Manager - Example Give it some name  Better add the OS version Add SD card sieze Select OS version You are done!
  18. 18. New PhoneGap Project Two ways of creating
  19. 19. 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
  20. 20. 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
  21. 21. New PhoneGap Project (2) Make a few adjustments to the projects main Java file  Change the classs 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
  22. 22. 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
  23. 23. 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
  24. 24. 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
  25. 25. New PhoneGap Project Live Demo
  26. 26. Hello World PhoneGap
  27. 27. 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
  28. 28. 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!
  29. 29. Hello World PhoneGap Live Demo
  30. 30. Android SDK курсове и уроци по програмиране, уеб дизайн – безплатно BG Coder - онлайн състезателна система - online judge курсове и уроци по програмиране – Телерик академия форум програмиране, форум уеб дизайн уроци по програмиране и уеб дизайн за ученици ASP.NET курс - уеб програмиране, бази данни, C#, .NET, ASP.NET http://mobiledevcourse.telerik.com програмиране за деца – безплатни курсове и уроци ASP.NET MVC курс – HTML, SQL, C#, .NET, ASP.NET MVC безплатен SEO курс - оптимизация за търсачки алго академия – състезателно програмиране, състезаниякурсове и уроци по програмиране, книги – безплатно от Наков курс мобилни приложения с iPhone, Android, WP7, PhoneGap уроци по уеб дизайн, HTML, CSS, JavaScript, Photoshop Дончо Минков - сайт за програмиране free C# book, безплатна книга C#, книга Java, книга C# Николай Костов - блог за програмиране безплатен курс "Качествен програмен код" безплатен курс "Разработка на софтуер в cloud среда" C# курс, програмиране, безплатно
  31. 31. Free Trainings @ Telerik Academy Cross-Platform Mobile Development http://mobiledevcourse.telerik.com Telerik Software Academy  academy.telerik.com Telerik Academy @ Facebook  facebook.com/TelerikAcademy Telerik Software Academy Forums  forums.academy.telerik.com