Getting Started with Android

Similar documents
2. Click the download button for your operating system (Windows, Mac, or Linux).

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

Getting Started: Creating a Simple App

Android Environment SDK

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

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

Android Environment SDK

IOIO for Android Beginners Guide Introduction

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

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

How to develop your own app

Getting Started with Android Development

How to build your first Android Application in Windows

Android Basics. Xin Yang

Introduction to Android Development

Hello World. by Elliot Khazon

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

Mobile Application Development

Advertiser Campaign SDK Your How-to Guide

23442 ECE Introduction to Android Mobile Programming ECE Special Topics: Android Mobile Programming

Android Setup Phase 2

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

CSA Software Listing Table of Contents. Both Windows and Mac platforms are supported.

How to Install Applications (APK Files) on Your Android Phone

How to install and use the File Sharing Outlook Plugin

Tutorial on Basic Android Setup

Tutorial #1. Android Application Development Advanced Hello World App

ID TECH UniMag Android SDK User Manual

Developing In Eclipse, with ADT

Chapter 2 Getting Started

Using Microsoft Visual Studio API Reference

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

Building Your First App

Installing the Android SDK

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

OpenCV on Android Platforms

netduino Getting Started

Setting up Sudoku example on Android Studio

BioWin Network Installation

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 (

Developing Android Applications Introduction to Software Engineering Fall Updated 7 October 2015

Android Development. Marc Mc Loughlin

Android Security Lab WS 2014/15 Lab 1: Android Application Programming

Presenting Android Development in the CS Curriculum

Android Studio Application Development

Note that you need to install the driver once on each laptop or desktop PC you use with the LP130.

MMI 2: Mobile Human- Computer Interaction Android

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

Lecture 1 Introduction to Android

Android: Setup Hello, World: Android Edition. due by noon ET on Wed 2/22. Ingredients.

Introduction to Gear VR Development in Unity APPENDIX A: SETUP (WINDOWS 7/8)

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

Downloading Electro Scan Smartphone App From Google Play* * Previously known as The Android Market

Pendragon Forms Industrial

Business mail 1 MS OUTLOOK CONFIGURATION... 2

With a single download, the ADT Bundle includes everything you need to begin developing apps:

DEPLOYING A VISUAL BASIC.NET APPLICATION

About this Release. Introduction. Prerequisites. Installation. Using the Web SDK Packager

Installing S500 Power Monitor Software and LabVIEW Run-time Engine

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

Initial Setup of Microsoft Outlook 2011 with IMAP for OS X Lion

Introduction to Android Programming (CS5248 Fall 2015)

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

Introduction to Gear VR Development in Unity APPENDIX A: SETUP (MAC OS X)

Android Programming: Installation, Setup, and Getting Started

Yocto Project Eclipse plug-in and Developer Tools Hands-on Lab

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Home Course Catalog Schedule Pricing & Savings Training Options Resources About Us

USB Driver Installation for Windows XP

and installation Enable Choose Enable, that s OK. Port Port for Mobile monitor, default at 34599,if you want to remote view the DVR by

Phaser 3635MFP Software Upgrade Process

Configuring Active Directory with AD FS and SAML for Brainloop Secure Dataroom Setup Guide

Android Java Live and In Action

OPS Data Quick Start Guide

Login with Amazon Getting Started Guide for Android. Version 2.0

Generate Android App

1. Open Thunderbird. If the Import Wizard window opens, select Don t import anything and click Next and go to step 3.

Set up Outlook for your new student e mail with IMAP/POP3 settings

Using the VEX Cortex with ROBOTC

Operating Manual for the Player

Download and Installation Instructions. Android SDK and Android Development Tools (ADT) Microsoft Windows

Installing the OKI MCx61MFP USB Attached, in Windows 8

Arduino Lesson 1. Blink

FileMover 1.2. Copyright Notice. Trademarks. Patents

Overview. About Interstitial Ads: About Banner Ads: About Offer-Wall Ads: ADAttract Account & ID

How To Develop An Android App On An Android Device

Installer Assistance Windows XP

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

setup information for most domains hosted with InfoRailway.

enter the administrator user name and password for that domain.

VPN SOFTWARE - WINDOWS XP & WINDOWS 64-BIT INSTALLATION AND CONFIGURATION INSTRUCTIONS

Java. How to install the Java Runtime Environment (JRE)

Transcription:

Mobile Application Development Lecture 02 Imran Ihsan Getting Started with Android Before we can run a simple Hello World App we need to install the programming environment. We will run Hello World on the Android Emulator (which runs very slowly) and on the phone (which is super fast). The best resource for developing Android apps is Android Developers. We will use developers as a source for material for parts of this course. Get the Android Studio Android Studio is the official Integrated Development Environment (IDE) for Android development. It includes everything you need to begin developing Android apps. After installing Android Studio, you have: IntelliJ IDE + Android Studio plugin Android SDK Tools Android Platform tools A version of the Android platform A version of the Android system image for the emulator Click on Download Android Studio and SDK Tools to get started. It will automatically detects your operating system and gives the correct Android Studio download link. Install Android Studio Download and Run Android Studio to complete installation. First, it asks you to import your settings from a previous version of Android Studio. If you have a previous version, specify config folder or installation home of the previous version of Android Studio. After you click "OK", it shows a welcome message. After you click "Next", select "Standard" as the type of setup you want for Android Studio. Next, Android Studio will automatically install the Android SDK. Accept all licenses to continue. After installing the Android SDK, you are ready to build and run the Hello World app. What is in the Android SDK? There are several packages associated with the Android SDK. If you look in the directory ~/Library/Android/sdk you will see a number of sub directories associated with these packages. For more information of what's in these directories checkout exploring the SDK

Creating a New Android Project To start a new Android app project for HelloWorld follow the wizard input; that is: 1. Click "Start a new Android Studio project" as shown below. 2. Fill in the application name, package name, and project location as as shown below. The package name is the reverse of the company domain. If you want to customize the package name, click edit on the right of Package name. The project location is where your project files reside.you can choose any location you want. Click next when you are done. 3. For Minimum Required SDK, just accept the default and click next

4. Create activity. Here you select an activity template for your app. Select BlankActivity and click Next. 5. New blank activity. Again, just click through accepting the default settings then click finish Once you have clicked finished you are presented with the project and all its files as shown below. MainActivity.java Open the app/java folder and look at the MainActivity.java code. package edu.dartmouth.cs.helloworld.helloworld; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.view.menu; import android.view.menuitem; public class MainActivity extends ActionBarActivity { @Override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main);

} @Override public boolean oncreateoptionsmenu(menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getmenuinflater().inflate(r.menu.menu_main, menu); return true; } @Override public boolean onoptionsitemselected(menuitem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getitemid(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } } } return super.onoptionsitemselected(item); Running HelloWorld App How you run your app depends on two things: whether you have a real Android powered device and whether you're using Android emulator. This lesson shows you how to install and run your app on a real device and on the Android emulator. Running HelloWorld on your phone Let's run our program directly on the phone. The big advantage of using the phone to develop is that it is fast to load and run programs. In contrast the emulator discussed next runs slowly in comparison and is irritating to use for a course but it is a good back up. Before we get started plug your phone into your laptop using the USB port, as shown below. Android Studio installs the Hello World app on your connected phone and starts it. Next, go to settings on your phone and select Developer option and then select USB debugging this will allow Android Studio to communicate with the phone to program it.

If you do not see developer option (circled on the image above) watch this video [http://www.androidcentral.com/howenable developer settings android 42] and mystery will be revealed. Basically the vendors and providers don't want that option accessible without enabling it for good reason. So as the video shows if you cannot see the developer options button, you should tap on the About phone button (under settings) and the click the Build number' button 7~8 times and voila now you see developer option. Now go in to developer option and select USB debugging. Click on Run button circled in the toolbar below.

Select Android Application and click OK. The app is downloaded, installed and run on the phone you'll see the following Hello World on your phone.

If you app did not run If for some reason you do not see the app running on the phone check that you see USB enabled in the status bar as indicated below If it is not go make sure you clicked and enabled the USB debugging option, as discussed above. If it did not work, unplug the USB cable and then plug it in again. See if a dialog shows up on your phone. If it does, check "Always allow from this computer" and click OK, as shown below.

Now after re launch the app, you should see you HelloWorld on the phone. Running HelloWorld on the Android Emulator Now let's run the program on the emulator that's right it emulates the functionality of the phone as best it can. And for developers without a phone it allows them to run code, test and debug code. Code that runs on the emulator runs unchanged on the real device. To run the app, disconnect your phone first, then click the run button in Android Studio. In Choose Device dialog, check Launch emulator and click OK as shown below. A device window will pop up. Android Studio will installs the app (the HelloWorld.apk) on your AVD and starts it. this could take sometime, so go for a coffee ; )

It can take sometime to run the emulator. There are faster emulators out there but overall the one that comes with the ADT is just to slow to be useful. Overall it took 5 minutes to start the emulator and run the app.