PIXNET Logo登入

在我心中有一個夢

跳到主文

我的程式備忘錄

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 11月 15 週五 201312:36
  • BluetoothChatService改良

最近都在處理android藍芽傳輸的問題,雖然以前處理過不過被eclipse吃掉了,後面也忘記怎麼用,然後同學說官方有提供bluetooth chat的範例直接改比較快,但後來發現此範例字串有漏接的情況,最後改BluetoothchatService中ConnectThread的run部份解決了此問題,程式碼如下
public void run() {
Log.i(TAG, "BEGIN mConnectedThread");
// Keep listening to the InputStream while connected
while (true) {
Scanner scanner = new Scanner(mmInStream);
while( scanner.hasNext()) {
String readMessage = scanner.nextLine();
mHandler.obtainMessage(Oscillator.MESSAGE_READ, -1, -1, readMessage)
.sendToTarget();
}
}
}
(繼續閱讀...)
文章標籤

jeff810123 發表在 痞客邦 留言(0) 人氣(572)

  • 個人分類:Android API
▲top
  • 8月 01 週三 201221:33
  • 索貝爾算子

豌豆荚截图20120801214411
之前用WindowsAPI寫顯示經由索貝爾算子運算後的點陣圖,這次改用Android程式顯示圖片。運算的方法是一樣,這邊我是定一個myView類別,繼承View,用來處理、顯示圖片。主要要了解的東西有索貝爾算子、Bitmap類別,還有一維陣列當二維陣列用的概念,然後我直接用myView類別產生的物件當做Activity的容器,所以沒動到layout部分。
程式碼如下
MainActivity.java
(繼續閱讀...)
文章標籤

jeff810123 發表在 痞客邦 留言(0) 人氣(247)

  • 個人分類:Android API
▲top
  • 4月 11 週三 201220:38
  • 字體變化

索引2
因為對Android系統感興趣,所以專題就決定朝這方向去做。然後每個禮拜都要做一個進度。這就是這禮拜的進度啦!功能是透過SeekBar去改變字體大小,RadioButton設定字體顏色。程式碼如下:
main.xml部分
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
android:id="@+id/textView0"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="HelloWorld!" />

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="字體大小" />

<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="14px" />

<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />


<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="字體顏色" />

<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >


<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="紅色" />


<RadioButton
android:id="@+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="藍色" />


<RadioButton
android:id="@+id/radio2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="綠色" />

</RadioGroup>

</LinearLayout>
(繼續閱讀...)
文章標籤

jeff810123 發表在 痞客邦 留言(0) 人氣(226)

  • 個人分類:Android API
▲top
1

我的FB

個人資訊

jeff810123
暱稱:
jeff810123
分類:
數位生活
好友:
累積中
地區:

熱門文章

  • (113)Wav Player

文章分類

toggle Java (2)
  • Console (2)
  • GUI (1)
toggle Android (1)
  • Android API (3)
toggle 單晶片 (1)
  • AVR (1)
toggle C語言 (4)
  • OpenCV (1)
  • Windows API (2)
  • Console (1)
  • OpenGlut (1)
  • 社團教學文摘錄 (2)
  • 未分類文章 (1)

最新文章

  • BluetoothChatService改良
  • CUI Windows Application和 GUI Windows Application的實現概論
  • RS232傳輸(使用DMAR-128開發板,開發環境為AVR Studio)
  • OpenCV找球
  • Wav Player
  • C語言呼叫dll
  • 透過AVIcap32.dll抓WebCam影像
  • 索貝爾算子
  • Sobel算子
  • 字串串接

最新留言

  • [18/04/11] one 於文章「Java作業-帕斯卡三角形 ...」留言:
    厲害 啊 大師...

文章精選

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: