Android httpclient php_mysql
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Android httpclient php_mysql

on

  • 3,768 views

Android tutorial guide ...

Android tutorial guide
HTTPClient & PHP MySQL
by Chalermchon Sommana
at Roi-et Hostpital
date 28Feb - 1 Mar 2011

see more android/iOS application Development : http://adayd3sign.wordpress.com/
join me : http://www.brightest-idea.com

Statistics

Views

Total Views
3,768
Views on SlideShare
3,767
Embed Views
1

Actions

Likes
3
Downloads
136
Comments
2

1 Embed 1

http://adayd3sign.wordpress.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Android httpclient php_mysql Presentation Transcript

  • 1. ANDROIDHTTPCLIENT & PHP MYSQL 28Feb - 1Mar 2011 ณ โรงพยาบาลรอยเอ็ด จังหวัดรอยเอ็ด Special Course วิทยากร เฉลิมชนม สมณะ
  • 2. Outline• Day 1 – Get Start and Setup tool – Create Simple application – Simple Connect PHP MySQL: select • Day 2 – Simple Connect PHP MySQL: select insert update delete – ListView UI Android: HTTPCLIENT & PHP MYSQL 28 Feb 2 - 1 Mar
  • 3. ExampleAndroid: HTTPCLIENT & PHP MYSQL 28 Feb 3 - 1 Mar
  • 4. Get Start• Install SDK• Install ADT in eclipse• Create simple application “Hello World” – Android File & Folder: R.java manifestfile.xml layout.xml – Basic UI – How to use Simulator Android: HTTPCLIENT & PHP MYSQL 28 Feb 4 - 1 Mar
  • 5. Simple Application• Activity• method: onCreate• findViewByID Android: HTTPCLIENT & PHP MYSQL 28 Feb 5 - 1 Mar
  • 6. Connect PHP MySQL• Overview Select request Insert response Connect DB Update MySQL Delete Android: HTTPCLIENT & PHP MYSQL 28 Feb 6 - 1 Mar
  • 7. HttpClient (code)//connect• HttpClient httpClient = new DefaultHttpClient();• HttpPost httpPost = new HttpPost(url);• httpPost.setEntity(new UrlEncodedFormEntity(param));• HttpResponse httpRespose = httpClient.execute(httpPost);• HttpEntity httpEntity = httpRespose.getEntity();//read content• InputStream in = httpEntity.getContent();• BufferedReader read = new BufferedReader(new InputStreamReader(in));• String content = "";• String line = "";• while((line = read.readLine())!=null){ content += line;• } Android: HTTPCLIENT & PHP MYSQL 28 Feb 7 - 1 Mar
  • 8. Post Parameter • Overview Key + value $w = $_REQUEST[‘whereId’]param.add(new BasicNameValuePair("whereId", "19")); or $w = $_POST[‘whereId’] NameValuePair Request+parameter Insert response Update Android: HTTPCLIENT & PHP MYSQL 28 Feb 8 - 1 Mar
  • 9. Post Parameter (code)• ArrayList<NameValuePair> param = new ArrayList<NameValuePair>();//test select: whereId• param.add(new BasicNameValuePair("whereId", "19"));//add parameter• httpPost.setEntity(new UrlEncodedFormEntity(param)); Android: HTTPCLIENT & PHP MYSQL 28 Feb 9 - 1 Mar
  • 10. Thank You. Android: HTTPCLIENT & PHP MYSQL 28 Feb 10 - 1 Mar