Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming Mobile Applications with Android 22-26 September, Albacete, Spain Jesus Martínez-Gómez.

Similar presentations


Presentation on theme: "Programming Mobile Applications with Android 22-26 September, Albacete, Spain Jesus Martínez-Gómez."— Presentation transcript:

1 Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez

2 OSSCOM Programming Mobile Applications with Android 2 Programming Mobile Applications with Android ● Lesson 1.- Introduction to Android – Introduction – Android development requirements.- What do we need to develop Android applications – Setup of Android SDK – Introduction to the emulator.- Advantages and disadvantages – First View to an android application – Android Manifest File.- Permissions management – Android Lab I.- Hello World

3 OSSCOM Programming Mobile Applications with Android 3 Programming Mobile Applications with Android ● Lesson 1.- Introduction to Android – In this lesson we will learn ● Why to develop in Android ? ● What do we need to develop Android applications? ● How to setup the environment for development ? ● When and how to use the emulator? ● What is the manifest file and what are the main permissions?

4 OSSCOM Programming Mobile Applications with Android 4 Programming Mobile Applications with Android ● What is Android? – Software Platform and a Operative System for mobile devices – Based in the Linux kernel – Allows to code in Java, but also in other languages thanks to the use of native ARM code – Lot of libraries, development tools and documentation

5 OSSCOM Programming Mobile Applications with Android 5 Programming Mobile Applications with Android ● Why Android? – Approximately … 90% of smartphones are based on the use of Android – Open Source → Huge number of developers – Open Handset Alliance ● Google, Asus, Garmin, Toshiba, ebay, nvidia, huawei, sony, samsung, intel … – Easy to use

6 OSSCOM Programming Mobile Applications with Android 6

7 7 Programming Mobile Applications with Android ● Main Android Alternatives? – iphone Operative System iOS – Blackberry – Windows Phone ● Other alternatives ? – Firefox OS – Symbian – Phone Gap

8 OSSCOM Programming Mobile Applications with Android 8 Programming Mobile Applications with Android ● Phone Gap (http://phonegap.com/)http://phonegap.com/ – Source code: HTML, CSS and JavaScript – Cross-platform ● The same application can be released for – Android – Windows Phone – iPhone – Blackberry

9 OSSCOM Programming Mobile Applications with Android 9 Programming Mobile Applications with Android ● What is included in Android? – Application Framework – Libraries – Android Runtime – HAL – Applications – Kernel

10 OSSCOM Programming Mobile Applications with Android 10

11 OSSCOM Programming Mobile Applications with Android 11 Programming Mobile Applications with Android ● Android … some history – Founded in 2003 ● Andy Rubin, Rich Miner, Nick Sears and Chris White – Acquired by Google in the Summer of 2005 – Open Handset Alliance is established in 2007 – Android 1.0 was released on September 23, 2008 – Since 2010, Nexus series of devices – Lot of versions and updates

12 OSSCOM Programming Mobile Applications with Android 12 Programming Mobile Applications with Android ● Android versions – Each new version of android uses the name of some well-known sweets – Main differences between versions ● API level ● Widgets and libraries ● Video and audio support ● Keyboard ● Communication

13 OSSCOM Programming Mobile Applications with Android 13 Programming Mobile Applications with Android

14 OSSCOM Programming Mobile Applications with Android 14 Programming Mobile Applications with Android ● Android versions (main releases) – Android 1.5 Cupcake ● Video record and display – Android 1.6 (Donut) ● VPN support and different display resolutions – Android 2.2 (Froyo) ● Flash and external storage – Android 3.0 (Honeycomb) ● Specific for tablet devices – Android 4.0 (Ice Cream Sandwich)

15 OSSCOM Programming Mobile Applications with Android 15 Programming Mobile Applications with Android

16 OSSCOM Programming Mobile Applications with Android 16 Programming Mobile Applications with Android ● Environment setup – Eclipse – Android Development Toolkit Plugin – Android Virtual Device Manager (Emulator) – Smartphone ● For real tests

17 OSSCOM Programming Mobile Applications with Android 17 Programming Mobile Applications with Android ● Environment setup – Installation Prerequisites ● Java Development Kit JDK6 ● Development environment for building applications, applets, and components using the Java programming language. ● dex.html dex.html

18 OSSCOM Programming Mobile Applications with Android 18 Programming Mobile Applications with Android ● Environment setup – Download the Android Developer Tools that includes: ● Eclipse + ADT Plugin ● Android SDK tools ● Android Platform tools ● A version of the Android Platform ● A version of the Android system image for the emulator ● https://developer.android.com/sdk/index.html https://developer.android.com/sdk/index.html

19 OSSCOM Programming Mobile Applications with Android 19 Programming Mobile Applications with Android ● Unzip the downloaded file into your file system – Eclipse folder – SDK folder ● Open the eclipse folder and execute eclipse – We must obtain...

20 OSSCOM Programming Mobile Applications with Android 20 Android SDK Manager AVD Manager (emulator) Programming Mobile Applications with Android

21 OSSCOM Programming Mobile Applications with Android 21 Programming Mobile Applications with Android ● SDK Manager

22 OSSCOM Programming Mobile Applications with Android 22 Programming Mobile Applications with Android ● AVD Manager

23 OSSCOM Programming Mobile Applications with Android 23 Programming Mobile Applications with Android ● AVD Manager – Only those options – previously – installed Problem !!

24 OSSCOM Programming Mobile Applications with Android 24 Programming Mobile Applications with Android ● SDK Manager – We will open it again to install the proposed required packages, and new ones including...

25 OSSCOM Programming Mobile Applications with Android 25 Programming Mobile Applications with Android ● AVD Manager – We can now create – a new device

26 OSSCOM Programming Mobile Applications with Android 26 Programming Mobile Applications with Android ● Debugger is another interesting tool for Android development – We can access in real-time to the real value of the application internal parameters – Very useful to find the origin of application errors – We can both debug applications running on the emulator or the physical smartphone ● Follow the instruction to install the drivers and set your device for evaluation ●

27 OSSCOM Programming Mobile Applications with Android 27 Programming Mobile Applications with Android ● Thanks to the emulator, we can – Evaluate our applications using different platforms – Test non-stable applications – Emulate locations, battery levels, SMS or calls ● … but on the contrary – Development is very slow – Some characteristics cannot be emulated

28 OSSCOM Programming Mobile Applications with Android 28 Programming Mobile Applications with Android ● Any android project consist of – Sources folder → src ● Source code for our programming files ● Java classes – Generated files → gen ● Files are generated automatically – Resources folder → res ● Layouts, images, sounds, text strings, etc – Android Manifest file ● Configuration and requirements of the application

29 OSSCOM Programming Mobile Applications with Android 29 Programming Mobile Applications with Android ● Let's all create our first Android application – New → Android Application Project ● We will establish the options for Android 4.2

30 OSSCOM Programming Mobile Applications with Android 30 Programming Mobile Applications with Android ● Let's all create our first Android application – We can see on the left all – the files that have been created – automatically – Please open the manifest

31 OSSCOM Programming Mobile Applications with Android 31 Programming Mobile Applications with Android ● AndroidManifest.xml – 2 different views: source code and options (permissions, application, instrumentation)

32 OSSCOM Programming Mobile Applications with Android 32 Programming Mobile Applications with Android ● First Android application – Source code and visual interfaces are separated ● Source Code:.java files located in /src ● Visual Interfaces: layout files located in /res/layout – Out first application will consist of a single screen with our name → No modification in the behavior – Please open the layout file (activity_main.xml)

33 OSSCOM Programming Mobile Applications with Android 33 Programming Mobile Applications with Android ● First Android application – Source code and visual interfaces are separated ● Source Code:.java files located in /src ● Visual Interfaces: layout files located in /res/layout – Out first application will consist of a single screen with our name → No modification in the behavior – Please open the layout file (activity_main.xml) ● We have two views: graphical layout and xml source

34 OSSCOM Programming Mobile Applications with Android 34 Programming Mobile Applications with Android ● First Android application – In the layout file, please select the area with the label hello world – … – and change the text with your desired phrase

35 OSSCOM Programming Mobile Applications with Android 35 Programming Mobile Applications with Android ● First Android application – Now we will prepare a emulator for its execution – From the Android SDK Manager, please install the options from the 4.1 (Api 16) – Once all the packages have been installed (several steps can be required), restart Eclipse – Open the Android Virtual Device Manager, create a new one with the following configuration ● Name: Nexus7Api16, Device: Nexus 7 ● Target: Android 4.1.2

36 OSSCOM Programming Mobile Applications with Android 36 Programming Mobile Applications with Android ● First Android application: execution – Now, we will run our application ● Right button over the project → Run As → Android Application – We now find a window to select where to execute the application ● Smartphone → if plugged and configured properly ● Emulator → we need to load

37 OSSCOM Programming Mobile Applications with Android 37 Programming Mobile Applications with Android ● First Android application: execution

38 OSSCOM Programming Mobile Applications with Android 38 Programming Mobile Applications with Android ● First Android application – Execution

39 OSSCOM Programming Mobile Applications with Android 39 Programming Mobile Applications with Android ● Android Manifest File – Configuration file that describes the application ● Permissions that are requested – Access to the Internet, Camera, external storage ● Minimum version of SDK for execution ● Name and logo of the application ● Activities (Windows) including the main one ● Libraries and features used ● Other

40 OSSCOM Programming Mobile Applications with Android 40 Programming Mobile Applications with Android ● Android Manifest File – Main changes that should be applied: permissions ● Can be added using the GUI or directly my modifying the code ● Basic permissions – android.permission.WRITE_EXTERNAL_STORAGE – android.permission.INTERNET – android.permission.CAMERA – android.permission.SEND_SMS – android.permission.ACCESS_COARSE_LOCATION –...

41 OSSCOM Programming Mobile Applications with Android 41 Programming Mobile Applications with Android ● Android Manifest File – The list of required permission will be listed when the application is being installed ● Include just the permissions that are needed

42 OSSCOM Programming Mobile Applications with Android 42 Programming Mobile Applications with Android ● Lesson 1.- Introduction to Android – Android Lab I.- Create, compile and execute a hello world application ● Follow the instructions to prepare your computer for development ● Create a new application and discover all the options that are available ● Execute the application both in the emulator and your mobile phone

43 OSSCOM Programming Mobile Applications with Android 43 Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez


Download ppt "Programming Mobile Applications with Android 22-26 September, Albacete, Spain Jesus Martínez-Gómez."

Similar presentations


Ads by Google