14 thg 10, 2011
8 thg 9, 2011
Bubble Sort
package com.exercise.AndroidBubbleSort;
import java.util.Random;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class AndroidBubbleSortActivity extends Activity {
TextView src, result;
int[] data = new int[10];
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
src = (TextView)findViewById(R.id.src);
result = (TextView)findViewById(R.id.result);
Random random = new Random();
String stringSrc = "Src = ";
for (int i = 0; i < data.length; i++){
data[i] = random.nextInt(100);
stringSrc += data[i] + " ";
}
src.setText(stringSrc);
bubblesort();
String stringResult = "Result = ";
for (int i = 0; i < data.length; i++){
stringResult += data[i] + " ";
}
result.setText(stringResult);
}
void bubblesort() {
int min;
for (int i = 0; i < data.length - 1; i++){
min = i;
for (int j = i + 1; j < data.length; j++){
if (data[j] < data[min]){
min = j;
}
}
if (i != min){
int tmp = data[i];
data[i] = data[min];
data[min] = tmp;
}
}
}
}
Nguồn : Android-er.10 thg 6, 2011
Mùa Tôm
Đêm khuya lặng lẽ
Mưa rơi khe khẽ
Tay cầm chuột...
Ta vẽ ...
Những đường kẽ ...
.........Xong hình cần vẽ
Bỗng ...
Chấm sáng... đốm sáng...
Nghĩ đến ma...
sờ sợ. tắt máy đi ngủ. hết ngày cũ....
24 thg 5, 2011
Source Code Game Sudoku Android
Đây là toàn bộ source code game Sudoku. Các bạn download về kham khảo vào phát triển thêm.
Link download : Tại Đây
Link download : Tại Đây
19 thg 5, 2011
Tao Alert Dialog with OK and Cancel options Trong Android
AlertDialog.Builder myAlertDialog = new AlertDialog.Builder(AndroidAlertDialog.this);
myAlertDialog.setTitle("--- Title ---");
myAlertDialog.setMessage("Alert Dialog Message");
myAlertDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
// do something when the OK button is clicked
}});
myAlertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
// do something when the Cancel button is clicked
}});
myAlertDialog.show();(Suu tam).
Doc Doan Text trong EditText
Khi ban nhap vao button Play Random Tetx . Chuong trinh se doc doan van ban cua ban voi ngon ngu ma ban chon san. O day minh chon ngon ngu la English.
Do dung ubuntu chua co unikey nen viet khong dau. Mong cac ban thong cam.
Hinh cua chuong trinh :
Đăng ký:
Bài đăng (Atom)
Bản beta đầu tiên
Sau 6 tháng cả team cặm cụi làm việc điên cuồng, bản alpha cũng được giới thiệu ra toàn bộ công ty và được testing nội bộ công ty mà thôi. ...
-
Phần mềm đọc truyện tranh trên hệ điều hành android là 1 phần mềm cho phép hiển thị tuần tự các hình ảnh của 1 tập truyện được nén lại tron...
-
Đây là 1 bài viết vẽ đường đi giữa 2 tọa độ trên maps sử dụng kml file. Bài viết được lấy trên blog của 1 người TQ. Mình đang làm việc vớ...
-
Đang viết ứng dụng này. Mới xong được phần 1 của ứng dụng. Up thử lên youtube xem nào. :D Phần mềm giải quyết các điểm sau : - Kết nối đế...
