Android basics. About Android Linux based operating system Open source Designed for handheld devices Developed by Android Inc. Google (2005) Open Handset.

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

Google Android Introduction to Mobile Computing. Android is part of the build a better phone process Open Handset Alliance produces Android Comprises.
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.
Android OS : Core Concepts Dr. Jeyakesavan Veerasamy Sr. Lecturer University of Texas at Dallas
CE881: Mobile and Social Application Programming Simon M. Lucas Quiz, Walkthrough, Exercise, Lifecycles, Intents.
Introduction.  Professor  Adam Porter 
Android architecture overview
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna.
Android Aims to bring Internet-style innovation and openness to mobile phones.
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.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
Mobile Application Development
Google Android as a mobile development platform T Internet Technologies for Mobile Computing Olli Mäkinen.
Android Programming Beomjoo Seo Sep., 12 CS5248 Fall 2012.
2. Setting Up Your Android Development Environment.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
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 Application Development 2013 PClassic Chris Murphy 1.
Android Introduction Platform Overview.
Better reference the original webpage :
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured.
Mobile Application Development with ANDROID Tejas Lagvankar UMBC 29 April 2009.
About me Yichuan Wang Android Basics Credit goes to Google and UMBC.
CS5103 Software Engineering Lecture 08 Android Development II.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
Android Programming By Mohsen Biglari Android Programming, Part1: Introduction 1 Part1: Introduction By Mohsen Biglari.
Programming Concepts. Derive a new class from Activity of the framework Prepare the data beforehand, e.g., vertices, colours, normal vectors, texture.
Introduction to Android Programming (CS5248 Fall 2015) Aditya Kulkarni August 26, 2015 *Based on slides from Paresh Mayami.
Operating system for mobile devices with a Java programming interface. Provides tools, e.g. a compiler, debugger, device emulator, and its own Java Virtual.
Android Info mostly based on Pro Android 3.  User Applications  Java Libraries – most of Java standard edition ◦ Activities/Services ◦ UI/Graphics/View.
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
Ali Shahrokni Application Components Activities Services Content providers Broadcast receivers.
Presentation Seminar on “IMAGE SLIDER –AN ANDROID APPLICATION”
ANDROID Presented By Mastan Vali.SK. © artesis 2008 | 2 1. Introduction 2. Platform 3. Software development 4. Advantages Main topics.
#gsa2012 Android Basics By: Amr Mohsen
Android for Java Developers Denver Java Users Group Jan 11, Mike
Presented By: Muhammad Tariq Software Engineer Android Training course.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
Overview of Android Application Development
Mobile Device Programming
Android architecture & setting up. Android operating system comprises of different software components arranges in stack. Different components of android.
First Venture into the Android World Chapter 1 Part 2.
Announcements Homework #2 will be posted after class due Thursday Feb 7, 1:30pm you may work with one other person No office hours tonight (sorry!) I will.
 Installation of Android Development Environment  Creating the App with OpenGL ES API  Running the App on Emulator Android App Development.
Android operating system N. Sravani M. Tech(CSE) (09251D5804)
Android apps development - Eclipse, Android SDK, and ADT plugin Introduction of.
Introduction to Android Programming
The Basics of Android App Development Sankarshan Mridha Satadal Sengupta.
Introduction to android
Android Application -Architecture.
Android 01: Fundamentals
Android Application Development 1 6 May 2018
Android Runtime – Dalvik VM
Android.
Development-Introduction
CMPE419 Mobile Application Development
תכנות ב android אליהו חלסצ'י.
Programming 3D Graphics
Application Development A Tutorial Driven Course
Korea Software HRD Center
Emerging Platform#3 Android & Programming an App
Android Development Introduction to Android Development 2011/01/16
CMPE419 Mobile Application Development
Presentation transcript:

Android basics

About Android Linux based operating system Open source Designed for handheld devices Developed by Android Inc. Google (2005) Open Handset Alliance (2007) Very successful system (75% sales in 2012)

Top mobile operating systems

Android basics Can run Java code on Dalvik VM Multi-user system (each application is a different user) Unique user ID Has its own virtual machine Has its own Linux process Principle of least privilege Applications can share data

Application components Building blocks of an application 4 types Activity Single screen with UI Service Backgroud process without UI Content provider Manages a shared set of application data Broadcast receiver Responds to system-wide broadcast announcements

Applications All components of an application runs in the same process The system tries to keep a process as long as possible Applications are stored in a stack The systems duty to destroy the applications The system uses importance hierarchy Foreground processes Visible process Service process Background process Empty process

Activity lifecycle

Android development Andriod SDK ( Java API libraries for different platforms SDK manager AVD Manager (emulator) Developer IDE Eclipse with ADT (Juno has it by default) Netbeans with NBAndroid plugin Android device USB Driver Enable USB debugging Useful link:

IDE basics NetBeans Eclipse For ADT bundle everything is set up For Juno install is not required, for other existing Eclipse installs: packages.html Add platforms and packages packages.html

Set up virtual devices

Presets

API levels

New Project (NetBeans)

New Project

AndroidManifest.xml <manifest xmlns:android=" package="gamedev.android.UEngine.PlatformGame" android:versionCode="1" android:versionName="1.0"> <activity android:name="MainActivity" Our application version Activity to start Icon label of our Activity We can change this to e.g.: “MyPlatformGame”

Start a virtual device

MainActivity.java: setContentView(R.layout.main); Main.xml <LinearLayout xmlns:android=" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Hello World, MainActivity" /> Build and run the project

OpenGL ES – MainActivity.java import android.app.Activity; import android.opengl.GLSurfaceView; import android.os.Bundle; public class MainActivity extends Activity { private GLSurfaceView public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mGLView = new MainSurfaceView(this); setContentView(mGLView); }

OpenGL ES – MainSurfaceView.java package gamedev.android.UEngine.PlatformGame; import android.content.Context; import android.opengl.GLSurfaceView; public class MainSurfaceView extends GLSurfaceView { private MainRenderer mRenderer; public MainSurfaceView(Context context) { super(context); this.mRenderer = new MainRenderer(getContext()); setRenderer(this.mRenderer); }

OpenGL ES – MainRenderer.java package gamedev.android.UEngine.PlatformGame; import android.content.Context; import android.opengl.GLSurfaceView; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; public class MainRenderer implements GLSurfaceView.Renderer{ private Context context; public MainRenderer(Context context) { this.context = context; } public void onSurfaceCreated(GL10 gl, EGLConfig config) { gl.glClearColor(0.5F, 0.5F, 1.0F, 1.0F); } public void onDrawFrame(GL10 gl) { gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT ); } public void onSurfaceChanged(GL10 gl, int width, int height) { gl.glViewport(0, 0, width, height); }

Build and run

Draw something - MainRenderer New imports import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; New data member protected FloatBuffer VB = null; public float rotAngle = 0;

Draw something - MainRenderer public void onSurfaceCreated(GL10 gl, EGLConfig config) { gl.glClearColor(0.5F, 0.5F, 1.0F, 1.0F); float[] VCoords = { -1.0F, -1.0F, 0.0F, 1.0F, -1.0F, 0.0F, 1.0F, 1.0F, 0.0F, -1.0F, -1.0F, 0.0F, 1.0F, 1.0F, 0.0F, -1.0F, 1.0F, 0.0F }; ByteBuffer vbb = ByteBuffer.allocateDirect(VCoords.length * 4); vbb.order(ByteOrder.nativeOrder()); this.VB = vbb.asFloatBuffer(); this.VB.put(VCoords); this.VB.position(0); }

Draw something - MainRenderer public void onDrawFrame(GL10 gl) { gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT ); gl.glMatrixMode(gl.GL_MODELVIEW); gl.glLoadIdentity(); gl.glTranslatef(0,0,-6); gl.glColor4f(1, 0, 0, 1); gl.glRotatef(rotAngle, 0, 1, 0); gl.glEnableClientState(gl.GL_VERTEX_ARRAY); gl.glVertexPointer(3, gl.GL_FLOAT, 0, this.VB); gl.glDrawArrays(gl.GL_TRIANGLES, 0, 6); gl.glDisableClientState(gl.GL_VERTEX_ARRAY); rotAngle += 2.5f; }

Draw something - MainRenderer public void onSurfaceChanged(GL10 gl, int width, int height) { gl.glViewport(0, 0, width, height); float ratio = (float) width / height; gl.glMatrixMode(gl.GL_PROJECTION); gl.glLoadIdentity(); gl.glFrustumf(-ratio, ratio, -1, 1, 1.0f, 10); }

Build and run

Input handling - MainSurfaceView protected float lastX = -1; public boolean onTouchEvent(MotionEvent e) { float x = e.getX(); switch (e.getAction()) { case MotionEvent.ACTION_MOVE: float dx = lastX == -1 ? 0 : x - lastX; mRenderer.rotAngle += dx * 1.0f; break; } lastX = x; return true; } Also remove rotAngle += 2.5f; from MainRenderer.onDrawFrame

Build and run Quad can be rotated with the mouse in emulator

Orientation – Full screen Fix orientation to landscape (typical in games) Activity::onCreate(): setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); Set to full screen (typical in games) Activity::onCreate(): requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); Rotate emulator to landscape mode: Ctrl+F12

Compile and run