【Android】ListView

 

区切り線設定

  <ListView
    android:id="@+id/ListView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:divider="#80000000"
    android:dividerHeight="1px" >   

区切り線なし

  <ListView
    android:id="@+id/ListView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:divider="@null" >
  </ListView>

 

 

【Android】volley setup

volley is new network lib.

 

・apache antをinstallする
brew install ant
または、
https://ant.apache.org/bindownload.cgi
volleyをclone
git clone https://android.googlesource.com/platform/frameworks/volley

・cd volleyで下記をantを実行

android update project -p .
ant jar

[jar] Building jar: /Users/mknod/git/volley/bin/volley.jar

・jarをAndroidのlibsへコピー

 

【Python】preparate to use python module.

distribute for packaging

pip for easy installation/removal of packages
virtualenv for nice isolated environments

sudo apt-get install python-dev
curl -O http://python-distribute.org/distribute_setup.py
python distribute_setup.py

curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
python get-pip.py
sudo pip install virtualenv

 

【タイムゾーン】sudo pip install pytz

【シリアル】sudo pip install pyserial

 

【Python】シリアル通信

【OS X】sudo easy_install -U pyserial

【Linux】apt-get instal python-serial

import serial
import pytz

def initSerial():

  com = serial.Serial( 
    port='/dev/ttyAMA0', 
    baudrate=9600,
    parity = serial.PARITY_NONE,
    bytesize = serial.EIGHTBITS,
    stopbits = serial.STOPBITS_ONE,
    timeout = None )
  return com


com = initSerial()
f = open('log.txt')
line = f.readline()

while line:
    com.write(line)
    line = f.readline()