Sunday, 11 April 2010

bublesort

Kita akan mencoba membuat sebuah program sorting dengan algoritma bublesort
We will try to make some program with bublesort algorithm
Program ini akan menggenerated secara otomatis data asal yang akan disorting (setelah tombol generated di klik ) dan akan mensorting data setelah tombol sorting di klik
This program will generated the bgeinning/first data (if generated button clicked) and will sort the data when sorting button clicked

Ini screen shootnya gan, tampilan awal program
This is the first appearance program

Setelah di generated data nya secara acak
After the first data generated randomly



Setelah di sorting
After sort



Program ini di coding dan di modif ulang dari buku tuntunan pemrograman java jilid 3  karangan pak rangsang purnama
This code was code dan modify from tuntunan pemrograman java jilid 3 book by rangsang purnama

Silahkan dunlud disini mohon dikoment yaa gan …..
kalo ada yang mau revisi silahkan...!

You can download this code here ,give your comment or something modify about my code

Friday, 19 March 2010

sending sms (bit)

Mengirim sms dengan bentuk format bit
send sms (short message service) in bit

untuk memakai di netbeans tinggal di copy dan di compile ulanguntuk wtk tinggal ditulis dan di compile
for netbeans just copy it same in wtk

WMA (Wireless Messaging API) adalah api java yang digunkan pada MIDP 2.o
api in berfungsi untuk menghanle teks, binary dan multiprt messages


WMA (Wireless Messaging API) is a wireless messaging api defined in MIDP 2.0. These apis are designed to handle text, binary and multipart messages. To make a connection, the application obtains an object implementing the MessageConnection from the Connector class by providing an URL connection string that identifies the address.

/* Make a connection */
public boolean connectSMSServer()
{
try
{
messageConnection messageConnection =
(MessageConnection)Connector.open("sms://:" + port);
messageConnection.setMessageListener(this);
}
catch (Exception e) {
}
}


/* Send text message */
public void sendTextmessage(String address,String message)
{
try
{
//creates a new TextMessage
TextMessage textMessage = (TextMessage)messageConnection.newMessage(
MessageConnection.TEXT_MESSAGE, address);
textMessage.setPayloadText(message);
messageConnection.send(textMessage);
}
catch (Exception e) {
}
}

/* Recieve text message */
public void receiveTextMessage()
{
try
{
Message message = messageConnection.receive();
if (message instanceof TextMessage)
{
TextMessage textMessage = (TextMessage)message;
}
else
{
//Message can be binary or multipart
}
}
catch (Exception e) {
}
}

/* Notify Incoming Message */
public synchronized void notifyIncomingMessage(MessageConnection conn)
{
//notiy thread of incoming message
synchronized (this)
{
notify();
}
}

/* Close Connection */
public void closeConnection()
{
if (messageConnection != null)
{
try
{
messageConnection.setMessageListener(null);
messageConnection.close();
}
catch (Exception e) {
}
}
}
}
blog ini ditujukan pada smua orang yang mempunyai penghargaan tertinggi terhadap sesuatu yang mereka cinta dan sayangi