0% found this document useful (0 votes)
15 views

Android Class Course Intro

Beberapa hal yang terjadi jika mengoperasikan tipe data yang berbeda dalam operasi aritmatika di Java: 1. Java akan melakukan konversi otomatis (implicit casting) tipe data ke tipe data yang lebih besar. Misalnya menjumlahkan int dengan long akan mengkonversi int ke long. 2. Tidak bisa menjumlahkan tipe data non-numerik seperti boolean dan string. Akan menimbulkan error. 3. Jika mengoperasikan tipe data yang lebih kecil dengan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Android Class Course Intro

Beberapa hal yang terjadi jika mengoperasikan tipe data yang berbeda dalam operasi aritmatika di Java: 1. Java akan melakukan konversi otomatis (implicit casting) tipe data ke tipe data yang lebih besar. Misalnya menjumlahkan int dengan long akan mengkonversi int ke long. 2. Tidak bisa menjumlahkan tipe data non-numerik seperti boolean dan string. Akan menimbulkan error. 3. Jika mengoperasikan tipe data yang lebih kecil dengan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 55

HALTEGH

IT LEARNING CENTER

Java & Android Course


Introduction
Overview
HALTEGH
IT LEARNING CENTER

Selamat datang di Android Class Guys, Let’s


enjoy learning together : )
HALTEGH
IT LEARNING CENTER

About the course


● Content
● Administration
● Assignment & Exam(mid & final)
● Goals
HALTEGH
IT LEARNING CENTER

Kenapa harus belajar Java ?


Overview
HALTEGH
IT LEARNING CENTER
Java Content
• Primitive data types (Byte, Short, Int, Long, Float,
Double, Char, Boolean)
• Operators in Java
• Expressions, Statements, Code blocks, Methods,
Code organizations, Overloading
• Flow statements (switch, for, while, do while)
• Classes, Constructor, Inheritance
• Composition Encapsulation and Polymorphism
• Arrays, Java inbuilt Lists, Autoboxing and Unboxing
• Inner and abstract Classes & Interfaces
Java Content
• Java Generics
• Naming Conventions and Packages
• static and final keywords, scope, Access Modifiers
• Java Collections:
• Basic Input & Output (+ java.util)
• Lambda Expressions
• Regular expressions:
• Debugging and Unit Testing
• Algorithms
• Databases:
• Java 9 Module System
Android Content
• Android Studio Tours
• Android Widget
• Activity and Intents
• Activity LifeCycle
• Android Fragments
• Android Menu
• Option Menu
• Android Service
• Android AlarmManager
• Android Storage
• Android Preferences
Android Content
• Android SQLite
• XML and JSON
• Android Multimedia
• Android Animation
• Android Web Service
• Google Map
• Adding Ads
• Firebase
• Register and publishing on Play Store
Administration - general
● 3 months / 12 weeks
● 2 classes per week
● 3 hours
● 24 classes total
● Central Project with sub assignments (tasks)
● Independent task execution
● Class passed by graded tasks and exam
Administration - materials & contact
Course related:
• Java syntax: https://www.tutorialspoint.com/java/

• –Objects First with Java -A Practical Introduction using BlueJ, ©


David J. Barnes, Michael Kölling, ed.5, Pearson, 2012
• –Java HowtoProgram: Deitel, ed. 8, Pearson, 2015
• –Object-Oriented Analysis and Design, Grady Booch,ed. 3, Addison-
Wesley, 200
• Android Programming for Beginners , Packt Publishing Limited,
Birmingham John Horton, 2015

Extra materials:
• Java documentation: https://docs.oracle.com/javase/8/docs/
or
https://docs.oracle.com/javase/7/docs/api/
Tugas & Ujian
6-8 Tasks - 20 points
Successive tasks that amount to each materials
1 Mid Exam (week 6) - 30 points
Theory(5p)+ assignment(25p)
1 Final Exam (week 11) - 40 points
Theory (10p) + assignment(30p)
1 Final Project (week 12) - 40 points
Theory (10p) + assignment(30p)
Tujuan
The goal of the course if to give you the following:

1. Knowledge to continue individual studies in programming


2. Interest to pursue higher knowledge in computer science
3. Preparation for the next step of Android courses in Haltegh IT
a. Kotlin Android Development
b. React Native
Software yang di gunakan

Intelli J IDEA Android Studio


Any Questions ?
Information Systems Development:
Fundamentals with OO Java

Introduction
Perbedaan Programming Languages
● Machine languages - interpreted directly in hardware
● Assembly languages - wrappers over a corresponding machine language
● High-level languages - machine-independent
○ Python
○ Java
○ C++
○ ...
● …
Sejarah Java
• 1) James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in
June 1991. The small team of sun engineers called Green Team.
• 2) Originally designed for small, embedded systems in electronic appliances like set-top boxes.
• 3) Firstly, it was called "Greentalk" by James Gosling and file extension was .gt.
• 4) After that, it was called Oak and was developed as a part of the Green project.
• 5) Why Oak? Oak is a symbol of strength and choosen as a national tree of many countries like
U.S.A., France, Germany, Romania etc.
• 6) In 1995, Oak was renamed as "Java" because it was already a trademark by Oak
Technologies.
Sejarah Java
• 7) Why had they choosen java name for java language? The team gathered to choose a new
name. The suggested words were "dynamic", "revolutionary", "Silk", "jolt", "DNA" etc. They
wanted something that reflected the essence of the technology: revolutionary, dynamic, lively,
cool, unique, and easy to spell and fun to say.
• According to James Gosling "Java was one of the top choices along with Silk". Since java was so
unique, most of the team members preferred java.
• 8) Java is an island of Indonesia where first coffee was produced (called java coffee).
• 9) Notice that Java is just a name not an acronym.
• 10) Originally developed by James Gosling at Sun Microsystems (which is now a subsidiary of
Oracle Corporation) and released in 1995.
• 11) In 1995, Time magazine called Java one of the Ten Best Products of 1995.
• 12) JDK 1.0 released in(January 23, 1996).
Environment setup

• How to install Java Development Kit (JDK)


• Open the Terminal
• $ sudo apt-get update
• $ sudo add-apt-repository ppa:webupd8team/java
• $ sudo apt-get update
• $ sudo apt-get install oracle-java8-installer
• Got through the setup wizard
• $ sudo update-alternatives --config java
• $ java -version
• $ javac #compiler
Environment setup
• How to install intelliJ IDEA
• Firefox
• https://www.jetbrains.com/idea/download/#section=linux
• Download Community edition
Buat Hello World pertama mu
public class HelloWorld {

public static void main(String[] args) {


System.out.println(“Welcome to Haltegh IT"); // Prints
‘Welcome to Haltegh IT"
}

}
End
Struktur Java
Struktur Program Java
• In the Java programming language:
• Program dibuat dengan atau lebih dari 1 kelas
• Satu kelas biasanya memiliki ebih dari 1 method
• Suatu method berisi berbagai statement

• Suatu aplikasi Java sealalu membutuhkan method main


Struktur Kelas di Program Java
// comments about the class
public class MyProgram
{
Header kelas/ Nama kelas

Badan kelas

Komentar bisa di tempatkan di manapun


}
Java Method Program Structure
// comments about the class
public class MyProgram
{

// comments about the method


public static void main (String[] args)
{
method header/method main
Badan method
}

}
Tipe Data
Data Types
• Konstan
• Variable
What is a Constant?
• 456—nomor yang diset langsung
• System.out.println(456); // Java
• Console.writeline(456); // Visual C#
• “A Literal String Constant”
• System.out.println(“My First Java”); // Java
• Console.writeline(“My First C#”); // Visual C#
Apa itu variabel
• Suatu yang di set memiliki nama dan isinya dapat diganti-ganti, dan
dioperasikan di dalam program
Tipe data Primitive
Deklarasi tipe data
• int, short, long
• float, double
• boolean
• char
Tipe Data– Integer / Angka
• Int – the default declaration – 4-byte integer
• Byte—1-byte integer
• Short—2-byte integer
• Long—8-byte integer
Tipe Data Float / koma
• Float—a 4-byte floating point number, contoh 4,5
• Double—an 8-byte floating point number , contoh 4,54
8 Tipe Data Primitive
• Boolean, byte, char, double, float, int, long, short
Ukuran dan Range
PRIMITIVE SIZE IN BITS RANGE

int 32 -2 to the 31st to 2 to the 31st

int 4 bytes 2147483648

long 64 -- 8 bytes -2 to the 63rd to 2 to the 63rd

float 32 +- 1.5 x 10^45

double 64 +- 5.0 x 10^324

decimal (C# only) 128 28 significant figures

string 16 bits per char Not applicable

char 16 One character

bool (boolean in Java) 8 True or false


Jadi, kenapa kita butuh Tipe
Data primitive ?
Operator di Java
Operasi Aritmatik Sederhana
• * / % (kali, bagi, modulo)
• + - (tambah, kurang)
• int result = 2 + 3 * 4;
• Jawabannya 14 atau 20??
• int result = (2 + 3) * 4
Operasi Biner
• The simple arithmetic operators are also called binary operators
because they have two operands exactly
• Never three
• Never o
• ne OPERAND
DAN ATAU
Kondisi 1 Kondisi 2 && Hasil Kondisi 1 Kondisi 2 || Hasil
Benar Salah Salah Benar Salah Benar
Salah Benar Salah Salah Benar Benar
Benar Benar Benar Benar Benar Benar
Salah Salah Salah Salah Salah Salah
Tipe Data Boolean
• Boolean variables dapat memiliki 2 nilai, yakni —benar atau salah
Boolean isItPayday = salah;
Boolean areYouBroke = benar;
Operasi Perbandingan
Hasil dari boolean, selalu
< kurang dari
> Lebih dari
== sama dengan
<= Kurang dari sama dengan
>= Lebih dari sama dengan
!= tidak sama dengan
Contoh Boolean
boolean is SixBigger = (6 > 5);
// value stored in is SixBigger is true
Boolean is SevenSmaller = (7 <= 4);
// value stored in is SevenSmaller is false
Data formats
The character format—uses an assigned decimal value
The integer format
The floating point format—consists of an exponent part and a
mantissa part—for example the 4-byte floating point word might
have a 1-byte exponent and a 3-byte mantissa.
Apa yang terjadi jika kita mengoperasikan
tipe data yang berbeda
Hiarki tingkat urutan format tipe data
1. double
2. float
3. long
4. int
Example
int hoursWorked = 37;
Double payRate = 6.73;
Double grossPay = hoursWorked * payRate;

Here, hoursWorked is converted from int to double before the *


operation is performed; the result, grossPay contains 249.01 stored
as a double
Int dengan double maka hasilny harus ditulis double
In the above…
• Without the use of the (float), the code segment would not compile
Operators Summary
HALTEGH
IT LEARNING CENTER

Another type casting example


float myMoney = 47.82f;
int dollars = (int) myMoney;
// dollars is 47, the integer part of myMoney
// note that myMoney was not rounded
HALTEGH
IT LEARNING CENTER

Your Assignment
• Create some codes that prove our topics today / Operator type
• Try to create something awesome
HALTEGH
IT LEARNING CENTER

End
HALTEGH
IT LEARNING CENTER

Pertanyaan ?

You might also like