Download Android Mobile Programming - Andrew Khosugih – 1501156143

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
[M0214-06PLM-P1]-1501156143
Android Mobile
Programming
1501156143 – 06 PLM – Andrew Khosugih
3/31/2014
ABSTRACT
Android is the world's most popular operating system for mobile devices and tablets. It is an
open source operating system, created by Google, and available to all kinds of developers with
various expertise levels, ranging from rookie to professional. Actually, android is an OS that
based on linux kernel, also running on Linux kernel, in the version 2.6. kernel. In developing
Android, developers must using the JAVA programming language. Developers can develop an
apps for Android in every JAVA programming platform, but as long as they have the SDK
Tools, especially the Android SDK Manager (android.sdk),the AVD Manager (android.avd), and
the emulator (emulator) installed along with the JDK and the JAVA developing tools, but not all
JAVA developing tools, but the JAVA developing tool with IDE. The platform used is all JAVA
programming platform that already supporting the Android application development, like SDK
Tools or any else. .So, in this paper, I like to provide information all about Android Mobile
Programming.
Keywords : Android Mobile Programming, JAVA Platform for Android, Developing Android
Applications
1|Page
Table of Contents
ABSTRACT...................................................................................................................................................... 1
Chapter 1 Introduction ................................................................................................................................. 4
Background ............................................................................................................................................... 4
Scope ......................................................................................................................................................... 5
Objectives and Benefit .............................................................................................................................. 5
Methodology............................................................................................................................................. 6
Chapter 2 Literature Review ......................................................................................................................... 7
Introduction to Android ............................................................................................................................ 7
Introduction to Java .................................................................................................................................. 8
Object-Oriented Programming ................................................................................................................. 9
Software Development Kit ........................................................................................................................ 9
IDE ............................................................................................................................................................. 9
GUI .......................................................................................................................................................... 10
Chapter 3 Discussion ................................................................................................................................... 11
Setting Up Android Development Environment ..................................................................................... 11
System Requirements ......................................................................................................................... 11
Installing the JDK and JRE.................................................................................................................... 12
Installing the ADT Bundle .................................................................................................................... 13
Add ADT Plugin to Existing Eclipse Integration ................................................................................... 14
Modeling, Coding, and Compiling ........................................................................................................... 15
Publishing The Application...................................................................................................................... 18
Android Community ................................................................................................................................ 19
Chapter 4 Conclusion .................................................................................................................................. 20
Conclusion ............................................................................................................................................... 20
2|Page
3|Page
Chapter 1
Introduction
Background
In these days, a non smartphone, a.k.a. normal mobile phone, is slowly abandoned by
society, since the invention of smartphone.
Nowadays, there’re too many smartphones with many different brands, like Apple with
their iPhone, Samsung with the Galaxy series, Blackberry, and many more. But, only some of
them is the famous brand as an outstanding competitor. And one of them is Samsung, the
company is really successful selling their smartphone product in the market. Their product, the
smartphone Galaxy series, is really outstanding. In creating their smartphone, Android is used as
the OS of all the Samsung Smartphones.
In this topic, we won’t talk about Samsung or any other smartphones. We will discuss
about the Android, to be specific, the method in developing Android applications.
4|Page
As you can see the picture at page 3, the Android user is in a big percentage, which
means the opportunity in developing applications for Android is still big. Also, in developing
applications is quite easy. Because of the requirement is only having JAVA IDE as the
programming platform, but included the SDK Tools for android. So, when the project finished,
the application can directly implemented into Android OS without converting the application to a
runnable application in Android.
Android is still the outstanding operating system that used on many smartphones, because
it’s an open source program. So, once again I state that developing applications in Android
market still have a big opportunity to gain profit.
Scope
In this paper, there are some points that I’d like to discuss, which is :

Introduction to Android

Developing applications on Android

Creating applications on Android

Requirements to start developing applications on Android

Platforms used in developing applications on Android
Objectives and Benefit
There’re some objectives for me in writing this paper, first is to fulfill the requirement to
pass one of my subjects, Topik-Topik Lanjutan, and next is to provide information for reader
about how to develop an Android application.
5|Page
The advantages that would come after reading this writing that will provide:

I can fulfill the requirement to pass Topik-Topik Lanjutan subject.

The reader would have to know more about android.

The reader would have more knowledge about developing Android applications.

I can learn more about writing a proper paper.
Methodology
I only use one method in writing this paper, which is the literature review. This kind of
method is making the writer learn from all the trusted media as sources. The trusted media are
such as books, journals, or e-books. We only choose three of them from all available media,
because some of the media are containing personal opinion not an actual fact.
6|Page
Chapter 2
Literature Review
Introduction to Android
Android, as a system, is a Java-based operating system that runs on the Linux 2.6 kernel.
The system is very lightweight and full featured. (DiMarzio, 2008)
Actually android is founded by 3 people, Andy Rubin, Rich Miner, Nick Sears, and Chris
White, they founded the company Android.Inc. They develop android based on their ideas which
they want to create a mobile device that can aware user’s location and and preferences.
In August 7th, 2005, Google acquired the Android Inc., including their owners Mike,
Miner and White stayed in the company. Google bought the Android Inc. because they want to
enter the mobile phone market. So, until now we know that android is developed by Google.
The product (android) itself is an open source program, so other mobile phone company
who want to develop a new phone can buy android lisence and use it as the OS of their product
since Google not into the hardware of mobile phones but the software technology of mobile
devices.
People can develop android applications by using Java and can be ported easily to the
new platform. Why Java? Because Java is an OOP (Object Oriented Programming) Language
which the programming language that used by developer nowadays.
7|Page
Introduction to Java
Java is a programming language created by James Gosling from Sun Microsystems (Sun)
in 1991. The first publicly available version of Java (Java 1.0) was released in 1995. (Vogel,
2012)
Sun Microsystems was acquired by the Oracle Corporation in 2010. Oracle has now the
steermanship for Java.
Over time new enhanced versions of Java have been released. The current version of Java is Java
1.7 which is also known as Java 7.
From the Java programming language the Java platform evolved. The Java platform
allows software developers to write program code in other languages than the Java programming
language and still runs on the Java virtual machine. The Java platform is usually associated with
the Java virtual machine and the Java core libraries.
Java is an object-oriented programming language, which is the language that almost all
programmers used nowadays. Besides it’s used by people in a large scale, Java language is one
of the easiest programming language to understand, even for the newbies.
Actually, the Java programming tool that will be used is the Java GUI/IDE not like
Textpad or Eclipse (not Eclipse IDE) which only supported by the JDK (Java Development Kit)
only. In this writing, I’d like to recommend you to use Eclipse IDE for some reasons. But IDE
isn’t enough to developing an android application, we need android SDK for making the Java
IDE can make android project.
8|Page
Object-Oriented Programming
Object-oriented programming is a programming paradigm that represents concepts as
"objects" that have data fields (attributes that describe the object) and associated procedures
known as methods. Objects, which are usually instances of classes, are used to interact with one
another to design applications and computer programs. C++, Objective-C, Smalltalk, Java, C#,
Perl, Python, Ruby ,Pascal, (Delphi or Lazarus), and PHP are examples of object-oriented
programming languages. (Kindler, 2011)
Software Development Kit
A software development kit is typically a set of software development tools that allows
for the creation of applications for a certain software package, software framework, hardware
platform, computer system, video game console, operating system, or similar development
platform. (Eckel, 1998)
IDE
IDE or integrated development environment or interactive development environment is
a software
application that
provides
comprehensive
facilities
to
computer
programmers for software development. An IDE normally consists of a source code editor, build
automation tools and a debugger. Most modern IDEs offer Intelligent code completion features.
(Vogel, 2012)
9|Page
GUI
Graphical user interface or GUI is a type of user interface that allows users to interact with
electronic devices through graphical icons and visual indicators such as secondary notation, as
opposed to text-based interfaces, typed command labels or text navigation. GUIs were
introduced
in
reaction
to
the
perceived
steep learning
curve of command-line
interfaces (CLI), which require commands to be typed on the keyboard. (Martinez, 2011)
10 | P a g e
Chapter 3
Discussion
Setting Up Android Development Environment
Before any work can begin on the development of an Android application, the first step is
to configure a computer system to act as the development platform. This involves a number of
steps consisting of installing the Java Development Kit (JDK), the Eclipse Integrated
Development Environment (IDE) and the appropriate Android Software Development Kit
(SDK). In addition to these steps, it will also be necessary to install the Eclipse Android
Development Tool (ADT) Plug-in.
System Requirements
To setup Android environment in Eclipse IDE, there are some system
requirements:

Windows XP (32-bit)

Windows Vista (32-bit or 64-bit)

Windows 7 (32-bit or 64-bit)

Windows 8

Mac OS X 10.5.8 or later (Intel based systems only)

Linux systems with version 2.7 or later of GNU C Library (glibc)
11 | P a g e
Installing the JDK and JRE
Both the Eclipse IDE and Android SDK were developed using the Java
programming language. Similarly, Android applications are also developed using Java.
As a result, the Java Development Kit (JDK) is the first component that must be installed.
Android development requires the installation of the Standard Edition of the Java
Platform Development Kit version 6 or newer. Java is provided in both development
(JDK) and runtime (JRE) packages. For the purposes of Android development, the JDK
must be installed.
Installing JDK or JRE
12 | P a g e
Installing the ADT Bundle
ADT (Android Development Tools) is a plugin of eclipse IDE that would help
developer for modeling the GUI and code the android application in eclipse. So,
developer mustn’t convert their final project (application) into the android-readable
application. Also, before download, please make sure the downloaded ADT is suiteable
with the computer system (32 or 64 bit).
Installing the ADT Bundle
After installing ADT, the following upgrades notification will pop up and run the
update process until the ADT is updated.
13 | P a g e
Add ADT Plugin to Existing Eclipse Integration
If you really follow the steps above, I assume that the eclipse IDE isn’t installed
yet, so the rule is install all the normal requirement to install a java platform (JDK and
JRE) and after that install the android plugin (ADT). Then install the eclipse IDE and last
use the plugin menu inside eclipse IDE for installing the ADT plugin.
Installing ADT plugin
So, in short the beginning the development of Android based applications, the
first step is to set up a suitable development environment. This consists of the Java
Development Kit (JDK), Android SDKs, Eclipse IDE and the Android ADT Plugin for
Eclipse. (Pemrograman Android untuk Pemula, 2013)
14 | P a g e
Modeling, Coding, and Compiling
To create an android application using Eclipse IDE, you must fulfill the setting
requirement above. After setting the environment is done, open the eclipse program
(eclipse.exe).
After that choose menu File>New>Project. Then the wizard will show up, choose
android application on the list. In this example I’d like to give a “Hello World” application using
eclipse IDE.
New Android App Wizard
Next is follow the instructions at the wizard until the finalize button shows up. Once
finalized, the application is created.
15 | P a g e
The same as we code using eclipse, just search the src (which usual place where the code
in eclipse is). But there is a difference, we shouldn’t create any the java text document (the .java
file) manually, it’s already auto generated inside the src folder as MainActivity.java.
The MainActivity.java File
As usual, there will be any generated text code inside the MainActivity.java file like this
16 | P a g e
Then, import textview for viewing the text that we want to state, also to enable us for
calling the function textview inside the method. And stated the “hello world” string (text).
The android version of “hello world” code
And last, run it as android application, because we are making the “hello world” will be
running on android devices.
The android version of “hello world” program
17 | P a g e
The look of the debugged code is different from the usual eclipse debug, because we
debug the code on the Android Virtual Device, which is auto generated when we install the ADT
plugin. The AVD (Android Virtual Device) is used for test if our code can run on the android
device or not.
Publishing The Application
To publish the created application, there are two ways,

First, is publishing via Google Play Store

And publishing the application via personal media (blog, website, etc)
The one that I’d like to tell is how to publish the application through Google Play. The
steps are :
1. Open Google Play website (https://play.google.com/apps/publish/.)
2. Register as publisher account
3. Enter the personal identity, just like registering at any site
4. If you want to sell the application, you must pay $25 USD for using Google
Wallet, and if not have the Google Wallet ID, you must create the account. If you
want to publish the application for free, you can skip this step.
5. Finalize registration process, and verification code will send to your email.
18 | P a g e
And to register the Google Wallet, you must follow these steps:
1. Sign in at Google Play website
2. Open financial reports (
) menu
3. Click Setup a Merchant Account Now
Android Community
Google
Android
Developer
forum
:
https://groups.google.com/forum/#!forum/Android-
developers
Android Nusantara : http://www.androidnusantara.com/
Kaskus Android Community
Android Indonesia Community : http://www.android-indonesia.com/
19 | P a g e
Chapter 4
Conclusion
Conclusion
Android is one of the outstanding OS for any mobile devices in the market. Nowadays,
every medium-small stage of smartphones brand are using Android as their OS. It is happening
because Android is an open-source program, so the buyer only need to pay the license for using
the Android OS.
In developing Android application, developer can use Java language for the code. Since
Java is an OOP (Object-Oriented Programming) language, which is everyone is using right now,
it’s quite easy to find the platform for develop the application. This time, the eclipse taken as
example.
Before the developing process starts, the programming environment must be set up first.
Not only for the java platform (JDK and JRE), the Android platform is must be setting up too. To
set up the Android environment, we must install the Android SDK Tools, the ADT (Android
Development Tools) plugin.
And for publishing the application, developers can publish their program via Google Play
Store or the publish it themselves.
20 | P a g e
Suggestions
Because of the limitation of time, in the future I’d like to add some things more like:

More interesting code, not a very easy code like “hello world”

Comparison between Android OS with others
Also in the future I’d hope there’re more people who want to develop applications in android,
beside it will improve their skills as developer, also it will keep the market on so there’s still a
place to gain some profit individually in IT industry.
21 | P a g e
Bibliography
DiMarzio, J. (2008). Android - A Programmers Guide. Mc Graw Hill.
Eckel, B. (1998). Thinking in Java.
Enterprise, J. (2013). Pemrograman Android untuk Pemula. Elex Media Komputindo.
Kindler, K. (2011). Object-Oriented Simulated Systems with Sophicasted Control.
Martinez, W. (2011). Graphicak User Interfaces WIREs Compstat.
Vogel, L. (2012). Introduction to Java Programming.
22 | P a g e