2011/01/20

Java HTTP using HttpClient

* Package
- org.apache.commons.httpclient.HttpClient

* GET
- http://www.syboos.jp/java/doc/jakarta-commons-httpclient.html

* PUT
- http://hc.apache.org/httpclient-3.x/methods/put.html
- http://www.fireproject.jp/feature/uzumi/httpclient/intro.html

* POST
- http://sinsengumi.net/blog/2010/10/java%E3%81%AEhttpclient-4-%E3%82%92%E8%A7%A6%E3%81%A3%E3%81%A6%E3%81%BF%E3%81%9F%E3%80%82/

- reference :
-- http://sinsengumi.net/blog/2010/10/java%E3%81%AEhttpclient-4-%E3%82%92%E8%A7%A6%E3%81%A3%E3%81%A6%E3%81%BF%E3%81%9F%E3%80%82/

--

2011/01/15

Java HTTP GET using HttpURLConnection


import java.net.HttpURLConnection;
import java.net.URLConnection;
import java.net.URL;
//....
try {
URL u = new URL(STR_URL);
URLConnection uc = u.openConnection();
HttpURLConnection httpuc = (HttpURLConnection)uc;
httpuc.setRequestMethod("GET");

in_stream = con.getInputStream();
out_stream = new FileOutputStream(STR_FILE);

while (-1 != (len = in_stream.read(buffer))) {
out_stream.write(buffer, 0, len);
}

in_stream.close();
out_stream.close();

}catch(Exception e){
//..

2011/01/03

Install Android SDK



* Download & Install Android SDK

- memo : jdk is not found
-- next > back > next

* Install Eclipse
- see tag "eclipse"

* Install ADT Plug-in on Eclipse
- Eclipse Menu > Help > Install New Software
- Click Add
- enter
-- "ADT Plugin" for the Name
-- the following URL for the Location
--- https://dl-ssl.google.com/android/eclipse/
-- Click OK
-- Following Menu ....

-- Affirm "Eclipse Menu > Window > Preference > Android"



- Android SDK Loaction
-- Window > Preference > Android
--- C:\Android\android-sdk

* SDK Manager
- SDK Manager -> Settings
-- in office, you need proxy settings.
-- check "https -> http"

- It takes a good amount of time to Download


* Eclipse Plug-in (ADT Plug-in)

-0. In Office, you need proxy settings of Eclipse.
-- Window > Preference > General > Network Connection

- 1. Help > Install New Software > Add
-- Name : ADT
-- Location : https://dl-ssl.google.com/android/eclipse/
-- * "http" instead of "https"


* Create AVD (Android virtual device)
- Window > Android SDK and AVD Manager > Virtual devices > New

-- memo : Launch Options
--- Scale display to real size
--- Wipe user data


** Error

- invalid command-line parameter: Files\Android\android-sdk-windows\toos/emulator-arm.exe ...

-- before : C:\Program Files\Android\android-sdk
-- after : C:\Android\android-sdk