Mobile Application Development



Similar documents
Android Introduction. Hello Mihail L. Sichitiu 1

directory to "d:\myproject\android". Hereafter, I shall denote the android installed directory as

Android Tutorial. Larry Walters OOSE Fall 2011

Android For Java Developers. Marko Gargenta Marakana

Android Application Development: Hands- On. Dr. Jogesh K. Muppala

MMI 2: Mobile Human- Computer Interaction Android

Chapter 2 Getting Started

Developing Android Apps: Part 1

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Hello World. by Elliot Khazon

Tutorial #1. Android Application Development Advanced Hello World App

Now that we have the Android SDK, Eclipse and Phones all ready to go we can jump into actual Android development.

Android Environment SDK

Basics. Bruce Crawford Global Solutions Manager

Android 多 核 心 嵌 入 式 多 媒 體 系 統 設 計 與 實 作

How to Create an Android Application using Eclipse on Windows 7

Android Environment SDK

Android Development. Marc Mc Loughlin

How to build your first Android Application in Windows

App Development for Android. Prabhaker Matet

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

ANDROID APP DEVELOPMENT: AN INTRODUCTION CSCI /19/14 HANNAH MILLER

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Android Development. 吳 俊 興 國 立 高 雄 大 學 資 訊 工 程 學 系

Android Development Tutorial. Human-Computer Interaction II (COMP 4020) Winter 2013

Advantages. manage port forwarding, set breakpoints, and view thread and process information directly

Tutorial: Android Object API Application Development. SAP Mobile Platform 2.3

Jordan Jozwiak November 13, 2011

Tutorial: Android Object API Application Development. Sybase Unwired Platform 2.2 SP02

Android Programming Basics

Android Development Tutorial. Nikhil Yadav CSE40816/ Pervasive Health Fall 2011

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 2 Android Platform. Marco Picone

Arduino & Android. A How to on interfacing these two devices. Bryant Tram

OpenCV on Android Platforms

Getting Started With Android

How to develop your own app

Android App Development. Rameel Sethi

Developing an Android App. CSC207 Fall 2014

Android Programming. Høgskolen i Telemark Telemark University College. Cuong Nguyen,

Localization and Resources

IOIO for Android Beginners Guide Introduction

Building Your First App

SDK Quick Start Guide

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

Getting Started: Creating a Simple App

Mocean Android SDK Developer Guide

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Location-Based Services Design and Implementation Using Android Platforms

Fahim Uddin 1. Java SDK

Developing apps for Android OS: Develop an app for interfacing Arduino with Android OS for home automation

TUTORIALS AND QUIZ ANDROID APPLICATION SANDEEP REDDY PAKKER. B. Tech in Aurora's Engineering College, 2013 A REPORT

Frameworks & Android. Programmeertechnieken, Tim Cocx

App Development for Smart Devices. Lec #2: Android Tools, Building Applications, and Activities

Android Programming: Installation, Setup, and Getting Started

How To Develop An Android App On An Android Device

Building an Android client. Rohit Nayak Talentica Software

Android Concepts and Programming TUTORIAL 1

Introduction: The Xcode templates are not available in Cordova or above, so we'll use the previous version, for this recipe.

Installing the Android SDK

4. The Android System

Smartphone market share

Hacking your Droid ADITYA GUPTA

Getting Started with Android Development

INTRODUCTION TO ANDROID CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 11 02/15/2011

A software stack for mobile devices:

Android Setup Phase 2

Developing NFC Applications on the Android Platform. The Definitive Resource

Tutorial for developing the Snake Game in Android: What is Android?

Tutorial: Android Object API Application Development. SAP Mobile Platform 2.3 SP02

Based on Android 4.0. by Lars Vogel. Version 9.8. Copyright 2009, 2010, 2011, 2012 Lars Vogel Home Tutorials Trainings Books Social

Login with Amazon Getting Started Guide for Android. Version 2.0

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

Running a Program on an AVD

Setting Up Your Android Development Environment. For Mac OS X (10.6.8) v1.0. By GoNorthWest. 3 April 2012

Mobile App Design and Development

ADT Plugin for Eclipse

How To Run A Hello World On Android (Jdk) On A Microsoft Ds.Io (Windows) Or Android Or Android On A Pc Or Android 4 (

Advertiser Campaign SDK Your How-to Guide

Android Basics. Xin Yang

Introduction to Android SDK Jordi Linares

How to Set Up Your PC for Android Application Development

Developing In Eclipse, with ADT

Android Development Setup [Revision Date: 02/16/11]

Oracle FLEXCUBE Direct Banking Android Tab Client Installation Guide Release

Developing Android Applications: Case Study of Course Design

place/business fetch details, removefromfavorite () function, 189 search button handler bind, B BlackBerry build environment

Android Application Development. Yevheniy Dzezhyts

Transcription:

Mobile Application Development (Android & ios) Tutorial Emirates Skills 2015 3/26/2015 1 What is Android? An open source Linux-based operating system intended for mobile computing platforms Includes a Java API for developing applications Toots Needed Android-based Phone Eclipse ( http://www.eclipse.org/downloads/ ) Android Plugin (ADT: Android Development Tools) Android SDK ( http://developer.android.com/sdk/index.html ) Install everything except Additional SDK Platforms, unless you want to 2 1

Android SDK Once installed open the SDK Manager Install the desired packages Create an Android Virtual Device (AVD) 3 AVD 4 2

ADT Plugin (1) In Eclipse, go to Help -> Install New Software Click Add in top right Enter: Name: ADT Plugin Location: https://dl-ssl.google.com/android/eclipse/ Click OK, then select Developer Tools, click Next Click Next and then Finish Afterwards, restart Eclipse Specify SDK location (next 3 slides) Must do this every time start a new project in a new location (at least in Windows) 5 ADT Plugin (2) 6 3

ADT Plugin (3) 7 ADT Plugin (4) 8 4

Creating a Project (1) 9 Creating a Project (2) 10 5

Project Components src your source code gen auto-generated code (usually just R.java) Included libraries Resources Drawables (like.png images) Layouts Values (like strings) Manifest file 11 XML Used to define some of the resources Layouts (UI) Strings Manifest file Shouldn t usually have to edit it directly, Eclipse can do that for you Preferred way of creating UIs Separates the description of the layout from any actual code that controls it Can easily take a UI from one platform to another 12 6

R Class Auto-generated: you shouldn t edit it Contains IDs of the project resources Enforces good software engineering Use findviewbyid and Resources object to get access to the resources Ex. Button b = (Button)findViewById(R.id.button1) Ex. getresources().getstring(r.string.hello)); 13 Layouts (1) Eclipse has a great UI creator Generates the XML for you Composed of View objects Can be specified for portrait and landscape mode Use same file name, so can make completely different UIs for the orientations without modifying any code 14 7

Layouts (2) 15 Manifest File (1) Contains characteristics about your application When have more than one Activity in app, NEED to specify it in manifest file Go to graphical view of the manifest file Add an Activity in the bottom right Browse for the name of the activity Need to specify Services and other components too Also important to define permissions and external libraries, like Google Maps API 16 8

Manifest File (2) Adding an Activity 17 Running in Eclipse (1) Similar to launching a regular Java app, use the launch configurations Specify an Android Application and create a new one Specify activity to be run Can select a manual option, so each time program is run, you are asked whether you want to use the actual phone or the emulator Otherwise, it should be smart and use whichever one is available 18 9

Running in Eclipse (2) 19 Running in Eclipse (3) 20 10

Running in Eclipse (4) 21 USB Debugging Should be enabled on phone to use developer features In the main apps screen select Settings -> Applications -> Development -> USB debugging (it needs to be checked) 22 11

Steps to create your first Hello World Application 23 1. Set Up Your Android Environment http://developer.android.com/sdk Install Eclipse Install Android SDK (Android libraries) Install ADT plugin (Android development tools) Create AVD (Android virtual device) 24 12

2. Create an Android Project in Eclipse File New Project Select Android Project Fill in Project details... 25 Directory name Android version Name that appears on device Java package Class to automatically create 26 13

3. Run the Android Application Run Run (or click the Run button) Select Android Application The emulator may take a few minutes to start, so be patient! You don't need to restart the emulator when you have a new version of your application 27 28 14

Source code Auto-generated code String constants UI layout Configuration 29 HelloAndroid.java 1 public class HelloAndroid extends Activity { 2 /** Called when the activity is first created. */ 3 @Override 4 public void oncreate(bundle savedinstancestate) 5 { 6 super.oncreate(savedinstancestate); 7 setcontentview(r.layout.main); 8 } 9 } 30 15

main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout 3 xmlns:android="http://schemas.android.com/apk/res/android" 4 android:orientation="vertical" 5 android:layout_width="fill_parent" 6 android:layout_height="fill_parent" 7 > 8 <TextView 9 android:layout_width="fill_parent" 10 android:layout_height="wrap_content" 11 android:text="@string/hello " 12 /> 13 </LinearLayout> 31 strings.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <resources> 3 <string name="hello">hello World, HelloAndroid! 4 </string> 5 <string name="app_name">hello, Android</string> 6 </resources> 32 16

AndroidManifest.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <manifest 3 xmlns:android="http://schemas.android.com/apk/res/android" 4 package="edu.upenn.cis542" 5 android:versioncode="1" 6 android:versionname="1.0"> 7 <application android:icon="@drawable/icon" 8 android:label="@string/app_name"> 9 <activity android:name=".helloandroid" 10 android:label="@string/app_name"> 11 <intent-filter> 12 <action 13 android:name="android.intent.action.main" /> 14 <category 15 android:name="android.intent.category.launcher"/> 16 </intent-filter> 17 </activity> 18 </application> 19 </manifest> 33 Tools Xcode (on OS X) iphone device (optional) 17

3/26/2015 35 3/26/2015 36 18

3/26/2015 37 19

3/26/2015 39 3/26/2015 40 20

3/26/2015 41 3/26/2015 42 21

3/26/2015 43 3/26/2015 44 22

3/26/2015 45 3/26/2015 46 23

3/26/2015 47 3/26/2015 48 24

3/26/2015 49 3/26/2015 50 25

3/26/2015 51 3/26/2015 52 26

3/26/2015 53 3/26/2015 54 27

3/26/2015 55 3/26/2015 56 28

3/26/2015 57 3/26/2015 58 29

3/26/2015 59 3/26/2015 60 30

3/26/2015 61 3/26/2015 62 31

Online Resources http://www.raywenderlich.com/ (itunes) Developing ios 7 Apps for iphone and ipad https://www.codeschool.com Native applications developed using web technologies (HTML, CSS, JavaScript) 3/26/2015 64 32

Tools Needed ios or Android Phone Node.js (https://nodejs.org/) Text (Web) Editor(e.g. Sublime: http://www.sublimetext.com/2) Android SDK tools (http://developer.android.com/sdk/index.html) Requires jdk (http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads- 1880260.html) 3/26/2015 65 Frameworks Ionic framework It uses HTML, CSS and AngularJS (an MVC framework for the web) Bootstrap framework It uses HTML, CSS and jquery (JavaScript framework) Polymer Only HTML and CSS 3/26/2015 66 33

Ionic Framework Why ionic? Uses AngularJS (MVC for the web). Easy to install cordova in an ionic app. Gives the look of a native mobile application. 3/26/2015 67 To install cordova 3/26/2015 68 34

Starting a project Ionic start <Name> <type> It is always better not to start a project or an app from nothing. From: http://ionicframework.com/getting-started/# use sublime text or any other editing program to edit the page: Views vs pages 3/26/2015 69 Follow the next instructions: After creating the page from the command window: Ex. ionic start <name> blank. cd <name>. ionic platform add android. Also add ios, wp8, blackberry10, firefox, etc. Edit the HTML page cordova build Or cordova build <platformname> for a specific platform to be built, like ios, android, etc. Go to the folder <name> and search for final mobile application project For Android, search for apk file, which is the android application of the web app. Complete tutorial at: https://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.ht ml 3/26/2015 70 35