Download IS389JavaEclipseAndroidIntro

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
INTRODUCTION TO
JAVA AND ANDROID
Our Ecosystem
Android SDK
Eclipse
Java
What is Java?





Created in 1991 for interactive television
Sun released the first real version in 1995
 Write once run anywhere
 Runs on most systems thru the
Java Virtual Machine (JVM)
The language is a de facto standard
In 2006, most of the code was
released as free and open source
Now Oracle is the steward of Java
technology
What is Java?




Like VB and C#, it’s an object-oriented
programming language
The language syntax resembles C or C#
Like C#, Java is strongly typed
Note that Java is not JavaScript
What is Java?
Java Benefits

Syntax is easier than C++


No real pointers and pointer arithmetic



Similar to .NET in this regard
Java takes care of memory management
It's not possible to overwrite memory


The language syntax is similar to C++ though
Note Java takes the sandbox approach to security
The libraries are quite small and there are libraries
to do just about anything

Source code is freely available
Java Versions

J2SE (Standard Edition)

We will use this for most class work

J2EE (Enterprise Edition)
J2ME (Micro Edition for PDAs)

Note that all of these are FREE

The Java Model
Java Development

There are various IDEs

Sun 1 Studio



There are free and for purchase versions
NetBeans 4.0
Eclipse, which we will use in this class because it
works with Android
What is Eclipse ?

Eclipse is an open source IDE maintained by
various software leaders including IBM and
SAP


It was initially developed by IBM
We will be using version 5 (MARS) in this
course

The old Luna version will work though
Eclipse Concepts (1)

All of the code you create lives in a
workspace


It’s just a folder where programs are stored
You can create many workspaces
Eclipse Concepts (2)

A workspace contains packages (programs)


A program can have one or many folders
The editing environment has perspectives


The Java perspective is used to edit Java and
Android code
The Debug perspective is used to debug Java
code
Eclipse Views (Java)






Eclipse calls windows Views
Package Explorer shows the packages in the
current workspace (similar to the .NET
Solution Explorer)
Editor View is used to edit Java and XML code
Problems view shows syntax errors
Console View displays program output and
other messages
LogCat displays messages too
Eclipse Views (Debug)



Breakpoint’s View shows program breakpoints
Variables View shows currently active
variables
Debug View shows the call stack
What is Android (1)?



An operating system designed from the
ground up to operate with mobile devices
It’s based on the Linux kernel
Developers can tap into the phone, and all
other hardware components



Make calls
Send texts
And everything else
What is Android (2)?


It was developed by the Open Handset
Alliance (bought by Google)
Applications are developed in Java using



Eclipse
The new Google Android Studio
We will use Eclipse here because Android
Studio does not work well in a lab (multiuser)
environment
Android Architecture (1)




Like most frameworks, it’s a stack based
architecture
The Linux kernel at the bottom
A robust set of libraries in the middle
An application framework at the top
Android Architecture (2)
Android General Concepts (1)

Programming is based on Java



Application components are based on inherited
classes
Functions are executed via callbacks
There are two development environments


Use Eclipse with the necessary Android SDKs
(installed in the labs)
Use Android Studio (You will be on your own if
you do this)
Eclipse Concepts


It’s not all that much different than .NET
Demo