Contents
J2ME (Review) GUI dalam J2ME (RadioButton dan CheckBox) Passing parameter dgn radiobutton dan checkbox Interkoneksi client server (PHP MySQL)
Komponen ChoiceGroup
Memberikan user pilihan dari list yang tersedia. Terdapat 3 format ChoiceGroup : EXCLUSIVE : satu pilihan MULTIPLE : banyak pilihan POPUP : satu pilihan dengan tampilan popup
Komponen ChoiceGroup
Format: ChoiceGroup(String label, int choiceType) Membuat obyek ChoiceGroup dan menentukan title dan tipenya. ChoiceGroup(String label, int choiceType, String[] stringElements, Image[] imageElements) Membuat obyek ChoiceGroup, menentukan title dan tipe serta array dari string dan gambar untuk nilai awal. Untuk passing parameter dari pilihan user gunakan getSelectedIndex(), getString(int elementNum) and isSelected(int elementNum). 7
Contoh TextFieldChoiceGroupTest
Form Registrasi untuk memasukkan data pribadi dan menampilkannya di dalam console.
10
11
12
13
14
Untuk fungsi pauseApp(), destroyApp(), awal(), keluar() sama dengan program sebelumnya 15
16
17
18
Introduction
J2ME provides networking features to the mobile devices. It is possible to get up-to-the-minute stock quotes or updated currency exchange rates on a mobile phone. The javax.microedition.io classes and interfaces handle the networking capability of MIDP. The java.io package provides input/output (I/O) capability to MIDP.
19
20
Low-level IP networking
This category involves socket, datagram, serial port, and file I/O communication. Socket-based communication conforms to the connection-oriented TCP/IP protocol. Datagram-based communication conforms to the connectionless UDP/IP protocol. e.g. URI for a datagram connection for sending to a server on a certain port: datagram://123.456.789.12:1234 Low-level IP networking can also handle file I/O and can allow a MIDlet to use a local serial port.
21
HTTP networking
The communication between a mobile device and a Web server is based on HTTP (Hypertext Transfer Protocol). HTTP is a connection-oriented request-response protocol.
22
23
24
26
27
28
29
server
30
31
32
33
server
34
35
36
37
server
39
40
server
41
42
Memilih database
mysql_select_db(namadatabase,$conn);
43
Akan dibuat aplikasi untuk memasukkan data baru, dan menampilkan data dengan J2ME.
44
server
45
46
47
server
48
49
50
TUGAS
Buat aplikasi untuk menghitung biaya total pemakaian PDAM : a. Buat databasenya Golongan Biaya (m3) 1 500 2 1000 3 1500 b. Input user : Nama user : Fakhri [TextField] Golongan : 1 [ChoiceGroup dgn 1 pilihan] Pemakaian : 20 [TextField] c. Output : Nama : Fakhri Total yang harus dibayar : Rp. 10000
51
TUGAS
Presentasi tiap kelompok untuk proyeknya : a. Blok Diagram Sistem b. Sistem Database
52