6: Getting Started with Android. Android Android Inc. was initially started in 2003 It was acquired by Google in 2005 The hardware side of Android is.

Slides:



Advertisements
Similar presentations
Google Android Introduction to Mobile Computing. Android is part of the build a better phone process Open Handset Alliance produces Android Comprises.
Advertisements

Android Application Development Tutorial. Topics Lecture 4 Overview Overview of Sensors Programming Tutorial 1: Tracking location with GPS and Google.
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Scienze dellInformazione Università di Bologna.
Ando-it-yourself droid Praveen Kumar Pendyala. Outline Brief intro to the Droid developement Setting up the Life saviors - Development tools Hello Droid.
ANDROID DEVELOPMENT KELLY MCBEAN. DEVELOPMENT ENVIRONMENT OVERVIEW Eclipse Standard IDE for Developing Android Applications Install: 1.Java (JDK) – Since.
Chapter 1: Voilà! Meet the Android
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna.
All About Android Introduction to Android 1. Creating a New App “These aren’t the droids we’re looking for.” Obi-wan Kenobi 1. Bring up Eclipse. 2. Click.
Get android development environment running. Install – Get and install JDK 5 or 6 (see link in the.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
1 Mobile Computing Mobile First (formerly Worklight) Copyright 2015 by Janson Industries.
Android: Hello World Frank Xu Gannon University. Steps Configuration ▫Android SDK ▫Android Development Tools (ADT)  Eclipse plug-in ▫Android SDK and.
Android and Project Structure. Android Android OS – Built on Linux Kernel – Phones – Netbooks – Readers – Other???
Google Android as a mobile development platform T Internet Technologies for Mobile Computing Olli Mäkinen.
2. Setting Up Your Android Development Environment.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
UFCFX5-15-3Mobile Device Development Android Development Environments and Windows.
Setting up the Development Environment Copyright © SUPINFO. All rights reserved Preparation.
How to make it work? Doncho Minkov Telerik Academy academy.telerik.com Technical Trainer
SET UP COMPUTER ** PLEASE BE AWARE SCREENSHOTS MAY NOT MATCH **
Getting Started with Android Programming Note: if you have already installed android development tools, please check that you have the same version as.
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Android Application Development CSE 5520/4520 Wireless Networks.
SEEM4570: XAMPP, Eclipse, Summary of Html Kangfei Zhao Room 711,ERB
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Android Programming Day best Android Apps Lzo&feature=fvwrel.
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
Android Application Development 2013 PClassic Chris Murphy 1.
Chapter 1: Voilà! Meet the Android. Smartphones –Can browse the Web –Allow you to play games –Use business applications –Check –Play music –Record.
Android Introduction Platform Overview.
Better reference the original webpage :
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 9: Customize! Navigating with a Master/Detail.
Google Maps Android API v2 吳俊興 國立高雄大學 資訊工程學系 CSF645 – Mobile Computing 行動計算
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
Chapter 1: Voilà! Meet the Android
1 Mobile Computing Set Up Copyright 2015 by Janson Industries.
Android. The Eclipse IDE Installation Requirements: Eclipse Java Windows All must match (32-bit OR 64-bit) If you have a 64-bit OS & 32-bit browser,
Introduction to Android. Android as a system, is a java based operating system that runs on the Linux kernel. The system is very lightweight and full.
Presentation Seminar on “IMAGE SLIDER –AN ANDROID APPLICATION”
DUE Hello World on the Android Platform.
#gsa2012 Android Basics By: Amr Mohsen
Android for Java Developers Denver Java Users Group Jan 11, Mike
Eclipse Tutorial Barrett Summer Scholars 2011 Sustainable Engineering: Learning to Engineer Truly Green Products.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Presented By: Muhammad Tariq Software Engineer Android Training course.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
Android Development Environment Environment/tools Windows Eclipse IDE for Java Developers (v3.5 Galileo) Java Platform (JDK 6 Update 18) Android.
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
Liferay Installation Prepared by: Do Xuan Hai 8 August 2011.
ANDROID BY:-AANCHAL MEHTA MNW-880-2K11. Introduction to Android Open software platform for mobile development A complete stack – OS, Middleware, Applications.
First Venture into the Android World Chapter 1 Part 2.
 Installation of Android Development Environment  Creating the App with OpenGL ES API  Running the App on Emulator Android App Development.
ANDROID APPLICATION DEVELOPMENT. ANDROID DEVELOPMENT DEVELOPER.ANDROID.COM/INDEX.HTML THE OFFICIAL SITE FOR ANDROID DEVELOPERS. PROVIDES THE ANDROID SDK.
Intoduction to Andriod studio Environment With a hello world program.
Master Software Solutions Pvt.Ltd.. These days the demand of smart phone is being increased and we have different types of client e.g. Touch Phone, tables,
IBM Worklight environment setup 1. Eclipse IDE Multi-purpose integrated development environment (IDE) Open source Supported for Windows, Mac OS X, Linux.
Introduction to Android Programming
The Basics of Android App Development Sankarshan Mridha Satadal Sengupta.
Android Programming.
Android 01: Fundamentals
Android Application Development 1 6 May 2018
Obtaining the Required Tools
Android Studio, Android System Basics and Git
Android.
Android 基礎.
Sensors, maps and fragments:
Korea Software HRD Center
Mobile Programming Dr. Mohsin Ali Memon.
Android Development Introduction to Android Development 2011/01/16
Presentation transcript:

6: Getting Started with Android

Android Android Inc. was initially started in 2003 It was acquired by Google in 2005 The hardware side of Android is supported by the Open Handset Alliance (OHA). Android had its fi rst major release in late The Android OS was built on a modified Linux kernel and applications are written in Java.

WHO SUPPORTS ANDROID? HTC, LG, Motorola, and Samsung are the major players in the Android smartphone market. Archos, Dell, Samsung, and Toshiba hold the largest pieces of the Android tablet market. You should note that Amazon’s Kindle Fire and Nook Color are up-and-comers and use a customized version of the Android tablet (Version 3) OS on their devices

ANDROID AS COMPETITION TO ITSELF Because Android was designed to be run on many different types of devices. Because of the open nature of the Android OS, it is commonplace for manufacturers to create vendor- specific builds of Android, and when this happens you are beholden to them for OS updates. Additionally in these custom builds, vendor-specific limitations have arisen such as the vendor-specific market. Another issue that has cropped up is the lack of over- the-air (OTA) distribution of OS updates by cellular carriers.

Multiple Markets and Market Locks Depending on your version of Android, and depending on the manufacturer of a given device. You often find on cheap and imported Android devices a version of Google Play that is maintained by the manufacturer. They pick and choose what applications are available from the whole set in the marketplace. The version of the Android SDK that you need to support depends on what devices you want to support. If you want to target most phones available right now, you should support Android 2.2 or 2.3. “Gingerbread” (2.3) is the last widely available version for those devices. Once you have decided on a version to deploy your application against, you need to set up your development environment.

GETTING THE TOOLS YOU NEED Downloading and Installing JDK Downloading and Installing Eclipse Downloading and Installing the Android SDK Downloading and Configuring the Eclipse ADT Plug-in Installing Additional SDK Components Development BUILDING THE DERBY APP IN ANDROID

Downloading and Installing JDK

Downloading and Installing Eclipse

Downloading and Installing the Android SDK

Downloading and Configuring the Eclipse ADT Plug-in

Use the Update Manager feature of your Eclipse installation to install the latest revision of ADT on your development computer. Follow these steps: 1. Start Eclipse and select Help ➪ Install New Software. 2. Click Add in the top-right corner. 3. In the Add Repository dialog box that appears, enter ADT plug-in for the name and the following URL for the location: ssl.google.com/android/eclipse/. ssl.google.com/android/eclipse/ 4. Click OK. If you have trouble acquiring the plug-in, try using “http” in the Location URL instead of “https” (“https” is preferred for security reasons). 5. In the Available Software dialog box, select the checkbox next to Developer Tools and click Next. 6. The next window shows a list of the tools to be downloaded. Click Next. 7. Read and accept the license agreements and then click Finish. If you get a security warning saying that the authenticity or validity of the software can’t be established, click OK. 8. When the installation completes, restart Eclipse.

Downloading and Configuring the Eclipse ADT Plug-in After you’ve successfully downloaded the ADT, the next step is to modify your ADT preferences in Eclipse to point to the Android SDK directory (see Figure 6-5): 1. Select Window ➪ Preferences to open the Preferences panel. In Mac OS X, click Eclipse ➪ Preferences. 2. Select Android from the left panel. 3. You may see a dialog box asking whether you want to send usage statistics to Google. If so, make your choice and click Proceed. You cannot continue with this procedure until you click Proceed. 4. For the SDK Location in the main panel, click Browse and locate your downloaded SDK directory. 5. Click Apply and then click OK.

Downloading and Configuring the Eclipse ADT Plug-in

Installing Additional SDK Components

Loading the Android SDK Manager in Eclipse takes only a few steps: 1. Open Eclipse. 2. Select Window ➪ Android SDK and AVD Manager. 3. Select Available Packages in the left panel. This reveals all of the components that are currently available for download from the SDK repository. 4. Select the component(s) you’d like to install and click Install Selected. 5. Verify and accept the components you want (ensure each one is selected with a green checkmark) and click Install. The components will now be installed into your existing Android SDK directories.

Development - Creating a New Project

Development – Naming your project

Development – configuring application information

Development – choosing sdk version for your app

Project Structure All of your code lives within your src folder. The res folder holds layouts and resources for different hardware specs. The layout subfolder holds all of your XML layouts. All of your XML layouts are stored in the layout subfolder of res, and your code will be linked under the namespace in your src folder of the project view.

Project Structure All of your code lives within your src folder. The res folder holds layouts and resources for different hardware specs. The layout subfolder holds all of your XML layouts. All of your XML layouts are stored in the layout subfolder of res, and your code will be linked under the namespace in your src folder of the project view.

Project Structure – Manifest File

Project Structure – Manifest File – Application Editor

Project Structure – Manifest File – Permissions Editor

Project Structure – Manifest File xml

Android Basics - Creating User Interfaces - Basic Android UI Elements

Android Basics - Creating User Interfaces - Basic Android Layouts and Views ➤ FrameLayout: This is very simplistic and can really contain only a single UI element. You can, in fact, have multiple elements but they overlap each other by default. The example code shown here is rendered in Figure 6-17:

Android Basics - Creating User Interfaces - Basic Android Layouts and Views

Creating an Android Virtual Device You need to create an Android Virtual Device (AVD) in order to debug your application in the emulator, because this “device” is what the emulator runs. Creating an AVD is quite easy. Eclipse includes a tool called AVD Manager (click Window Manager ➪ AVD Manager). You need to name your AVD instance, choose its OS version (Target), pick a skin (with which you can customize the look and feel of the emulator) and resolution, and specify the hardware details for the device (amount of RAM, size of SD card, and sensors like Accelerometer and GPS). Once you have configured it to your specifications, click Create AVD and you are all set.

Debugging

CONNECTING TO THE GOOGLE PLAY Getting Signing Your Application Signing your application with Eclipse is a relatively simple process: 1. Right-click your project in the Package Explorer and select File ➪ Export. 2. Select Export Android Application. 3. Complete the steps of the wizard and you will have a keystore, and a signed release build of your app ready for the market.ng an Android Developer Account

CONNECTING TO THE GOOGLE PLAY ANDROID DEVELOPMENT PRACTICES Android Fundamentals – Activities Activities are the individual screens in your application. – Services Services are components that run in a background thread. – Content Providers Content providers are interfaces to the offl ine storage that you have within your app. – Broadcast Receivers Broadcast receivers are components that respond to system messages.

CONNECTING TO THE GOOGLE PLAY Fragments as UI Elements – Starting in Android 3.x, there has been a shift in design elements to account for the significant differences between the screen sizes of tablets versus handsets.Whereas normally UI design for mobile devices is very rigid, Fragments add a level of fl exibility. Fragments themselves live as a subactivity that you can reference in multiple places in your application. Fragments live within the scope of their parent activity, but can be used in multiple activities. Ask for Permission – The users of your application must approve of what functionality you want to leverage on their device. To prompt the user for what you need, and so that your device will behave as designed, you need to add permission requests in your application’s manifest. Visit for a list the various permissions you can request when developing. – Depending on what version of the OS you are targeting you are afforded additional permissions. – One of the newest permissions available is READ_SOCIAL_STREAM, which enables you to access the user’s social stream. One of the oldest permissions is your ability to set the given time zone, using, you guessed, it SET_TIME_ZONE. Mind the Back Stack – Unlike iOS-based devices, all Android devices have a hardware back button.

BUILDING THE DERBY APP IN ANDROID - Common Interactions UI Navigation and Using Back Stack – Use the GetExtra command to retrieve simple and complex objects from one activity to another using an Intent. You can select the extras you want to refer to individually from the Intent. For example: String id = getIntent().getStringExtra(“id”); String name = getIntent().getStringExtra(“name”) Or you can get all of the objects you passed along as a Bundle: Bundle extras = getIntent().getExtras(); String userName; String id; if (extras != null) { userName = extras.getString(“name”); id = extras.getString(“id”); }

BUILDING THE DERBY APP IN ANDROID - Common Interactions Use the PutExtra command to put the object you want to pass between activities. You can pass simple or complex objects. You need to use Extras only when you want to pass data between activities. It is not necessary to set a complex state transfer process if you don’t need that data.

BUILDING THE DERBY APP IN ANDROID - Notifications Toast Alerts

BUILDING THE DERBY APP IN ANDROID - Notifications Alerts

BUILDING THE DERBY APP IN ANDROID - Ofline Storage SQLite

BUILDING THE DERBY APP IN ANDROID - Offline Storage SQLite

BUILDING THE DERBY APP IN ANDROID - Offline Storage SQLite

BUILDING THE DERBY APP IN ANDROID - SharedPreferences SharedPreferences is a set of key-value pairs saved on your device that is helpful for storing instance-specific data as it pertains to the app. The main concern is the level of privacy that you impose upon it. If you make it world-readable its value can be accessed by any application should another application query against your key.

BUILDING THE DERBY APP IN ANDROID - Web Service

Long Running Task on Web

BUILDING THE DERBY APP IN ANDROID - GPS public class SensorsGPS extends Activity { /** Called when the activity is first created. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); LocationManager locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); LocationListener locListener = new MyLocationListener(); locManager.requestLocationUpdates(LocationManager. GPS_PROVIDER, 0, 0, locListener); }

BUILDING THE DERBY APP IN ANDROID - Accelerometer public class SensorsAccel extends Activity { /** Called when the activity is first created. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /* do this in onCreate */ mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE mSensorManager.registerListener(mSensorListener, mSensorManager. getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL); mAccel = 0.00f; mAccelCurrent = SensorManager.GRAVITY_EARTH; mAccelLast = SensorManager.GRAVITY_EARTH; }

BUILDING THE DERBY APP IN ANDROID - Accelerometer

Thank You