Your SlideShare is downloading. ×
Android httpclient
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Android httpclient

655
views

Published on

Published in: Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
655
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Android Application Development CourseHttpClient and PHP MySQL Mr.Chalermchon Sommana Brightest IDEA
  • 2. OutlineDay 1●● Get start and setup android tool● Create simple application● Simple connection with PHP MySQL: selectDay 2●● Simple connection with PHP MySQL: select, insert, update, delete● ListView and Custom Adapter
  • 3. Overview: Connect PHP MySQL Select request Insert response Connect DB MySQL Update Delete
  • 4. Workshop Output of Connect with PHP Present by ListView
  • 5. Get Start●Install Android SDK and Eclipse IDE●Install ADT in Eclipse●Create Simple application “Hello Android”●Android File and Folder System●manifest.xml, layout.xml, R.java●Basic UI●Using Android Simulator
  • 6. Simple Application●Activity●method: OnCreate●method: findViewById
  • 7. HttpClient (Code)//connectHttpClient httpClient = new DefaultHttpClient();HttpPost httpPost = new HttpPost(url);httpPost.setEntity(new UrlEncodedFormEntity(param));HttpResponse httpRespose = httpClient.execute(httpPost);HttpEntity httpEntity = httpRespose.getEntity();//read contentInputStream in = httpEntity.getContent();BufferedReader read = new BufferedReader(new InputStreamReader(in));String content = "";String line = "";while((line = read.readLine())!=null){ content += line;}
  • 8. Overview: Post Parameter $w = Key + value $_REQUEST[‘whereId’]param.add(new BasicNameValuePair("whereId", "19")); or $w = $_POST[‘whereId’] Selec NameValuePair Request+parameter Insert C response Update 88
  • 9. Post Parameter (Code)ArrayList<NameValuePair> param = new ArrayList<NameValuePair>();//test select: whereIdparam.add(new BasicNameValuePair("whereId", "19"));//add parameterhttpPost.setEntity(new UrlEncodedFormEntity(param));
  • 10. Android Application Development CourseHttpClient and PHP MySQLContact usBrightest IDEA: http://www.brightest-idea.comMr.Chalermchon SommanaBlog: http://adayd3sign.wordpress.comThank you.