2015年6月15日 星期一

android:layout_below

Force the control located below another control as follows:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    
                xmlns:tools="http://schemas.android.com/tools"    
                android:layout_width="fill_parent"    
                android:layout_height="fill_parent"    
                android:orientation="vertical" >
    <Button android:id="@+id/button1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/button1" />
    <Button android:id="@+id/button2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
           android:layout_below="@id/button1"
           android:text="@string/button2" />
    <TextView android:id="@+id/textView1"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
             android:layout_below="@id/button2"/>

</RelativeLayout>

android studio rendering problems

Ref; http://stackoverflow.com/questions/18195807/android-studio-rendering-problems
The default version is API 22 (5.1.1)
Change to API 19 (4.4.1)
OK。


2015年5月16日 星期六

Android 按按按

Ref :
1. http://android-er.blogspot.tw/2014/02/android-sercerclient-example-client.html
2. Msdn: tcpListener

硬體:
筆電:ASUS X450J
手機:Zenfone 6
Wifi 連線,伺服器IP: 192.168.1.111  port 13000
Server/Client端程式如後:
使用 Android 手機(Zenfone 6)
Android 端程式
伺服器 ASUS X450J
PC 伺服器端程式


2015年3月26日 星期四

USBeacon Sample by Android Studio

Ref: USBeacon Demo Sample

Import non-Android studio project and make a copy into work space.
匯入Android Studio Project,須依據Android studio架構處理,在Java目錄下的Layout非有效目錄,請在res目錄下調整。



2015年3月25日 星期三

錯誤1907。Error 1907. Could not register font. Verify that you have sufficient permissions to install font.

Ref:http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/error-1907-could-not-register-font-verify-that-you/57f3a671-feec-4dc7-873c-bb2a7de9521f

1. ASUS X450J Windows 10 Preview
2. 2015-3-26 更新後開啟 Access 2010 發生錯誤 1907。
3. 參考ref,sfc /scannow  by administrator 失敗。
4. Office2010安裝光碟(iso檔)解壓縮ProPsWW/ProPsWW2 @ xH:\x86\ProPlus.WW
5. Copy *.TTF into C:\Windows\Fonts

2015年3月22日 星期日

Android Bluetooth Le Gatt - Show RSSI

1. Add RSSI Textview @ listitem_device.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="wrap_content">
    <TextView android:id="@+id/device_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="24dp"/>
    <TextView android:id="@+id/device_address"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="12dp"/>
    <TextView android:id="@+id/device_RSSI"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="12dp"/>
</LinearLayout>
2. Add java code in DeviceScanActivity.java
2-1 Add RSSIV as a global variable.
2-2 Add set RSSIV as global var and show it.
3. Result: