SlideShare a Scribd company logo
ANDROID

HTTPCLIENT & PHP
     MYSQL
     28Feb - 1Mar 2011
    ณ โรงพยาบาลรอยเอ็ด จังหวัดรอยเอ็ด



                                           Special Course
                                  วิทยากร เฉลิมชนม สมณะ
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
Example




Android: HTTPCLIENT & PHP MYSQL 28 Feb
                                         3
                 - 1 Mar
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
Simple Application
• Activity
• method: onCreate
• findViewByID




              Android: HTTPCLIENT & PHP MYSQL 28 Feb
                                                       5
                               - 1 Mar
Connect PHP MySQL
• Overview
                                                      Select
                 request
                                     Insert
             response                                   Connect DB


                              Update
                                                       MySQL
                                Delete




             Android: HTTPCLIENT & PHP MYSQL 28 Feb
                                                                     6
                              - 1 Mar
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
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
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
Thank
 You.


 Android: HTTPCLIENT & PHP MYSQL 28 Feb
                                          10
                  - 1 Mar

More Related Content

What's hot

Test and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 AppTest and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 App
Michele Capra
 
Hacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech Talk
Hacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech TalkHacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech Talk
Hacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech Talk
Red Hat Developers
 
Leveraging Azure Search in Your Application
Leveraging Azure Search in Your ApplicationLeveraging Azure Search in Your Application
Leveraging Azure Search in Your Application
Jeremy Hutchinson
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code維佋 唐
 
Goa tutorial
Goa tutorialGoa tutorial
Goa tutorial
Bruce McPherson
 
Parse Advanced
Parse AdvancedParse Advanced
Parse Advanced
Tushar Acharya
 
Firebase ng2 zurich
Firebase ng2 zurichFirebase ng2 zurich
Firebase ng2 zurich
Christoffer Noring
 
Node.js and Parse
Node.js and ParseNode.js and Parse
Node.js and Parse
Nicholas McClay
 
Dependency injection in CakePHP
Dependency injection in CakePHPDependency injection in CakePHP
Dependency injection in CakePHP
markstory
 
Building Android apps with Parse
Building Android apps with ParseBuilding Android apps with Parse
Building Android apps with Parse
DroidConTLV
 
How to send gzipped requests with boto3
How to send gzipped requests with boto3How to send gzipped requests with boto3
How to send gzipped requests with boto3
Luciano Mammino
 
Scalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSScalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSCosmin Mereuta
 
#ajn3.lt.marblejenka
#ajn3.lt.marblejenka#ajn3.lt.marblejenka
#ajn3.lt.marblejenka
Shingo Furuyama
 
Icinga2 api use cases
Icinga2 api use casesIcinga2 api use cases
Icinga2 api use cases
roy peter
 
Spca2014 hillier build your_own_rest_service
Spca2014 hillier build your_own_rest_serviceSpca2014 hillier build your_own_rest_service
Spca2014 hillier build your_own_rest_serviceNCCOMMS
 
PUT Knowledge BUCKET Brain KEY Riak
PUT Knowledge BUCKET Brain KEY RiakPUT Knowledge BUCKET Brain KEY Riak
PUT Knowledge BUCKET Brain KEY Riak
Philipp Fehre
 
Android getting started
Android getting startedAndroid getting started
Android getting started
Uptech
 
Additional action script 3.0
Additional action script 3.0Additional action script 3.0
Additional action script 3.0Brian Kelly
 

What's hot (19)

Test and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 AppTest and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 App
 
Hacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech Talk
Hacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech TalkHacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech Talk
Hacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech Talk
 
Leveraging Azure Search in Your Application
Leveraging Azure Search in Your ApplicationLeveraging Azure Search in Your Application
Leveraging Azure Search in Your Application
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 
Goa tutorial
Goa tutorialGoa tutorial
Goa tutorial
 
Parse Advanced
Parse AdvancedParse Advanced
Parse Advanced
 
Firebase ng2 zurich
Firebase ng2 zurichFirebase ng2 zurich
Firebase ng2 zurich
 
Node.js and Parse
Node.js and ParseNode.js and Parse
Node.js and Parse
 
Dependency injection in CakePHP
Dependency injection in CakePHPDependency injection in CakePHP
Dependency injection in CakePHP
 
Building Android apps with Parse
Building Android apps with ParseBuilding Android apps with Parse
Building Android apps with Parse
 
How to send gzipped requests with boto3
How to send gzipped requests with boto3How to send gzipped requests with boto3
How to send gzipped requests with boto3
 
Scalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSScalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JS
 
#ajn3.lt.marblejenka
#ajn3.lt.marblejenka#ajn3.lt.marblejenka
#ajn3.lt.marblejenka
 
Icinga2 api use cases
Icinga2 api use casesIcinga2 api use cases
Icinga2 api use cases
 
Q
QQ
Q
 
Spca2014 hillier build your_own_rest_service
Spca2014 hillier build your_own_rest_serviceSpca2014 hillier build your_own_rest_service
Spca2014 hillier build your_own_rest_service
 
PUT Knowledge BUCKET Brain KEY Riak
PUT Knowledge BUCKET Brain KEY RiakPUT Knowledge BUCKET Brain KEY Riak
PUT Knowledge BUCKET Brain KEY Riak
 
Android getting started
Android getting startedAndroid getting started
Android getting started
 
Additional action script 3.0
Additional action script 3.0Additional action script 3.0
Additional action script 3.0
 

Similar to Android httpclient php_mysql

Android intermediatte Full
Android intermediatte FullAndroid intermediatte Full
Android intermediatte Full
Ahmad Arif Faizin
 
Android Intermediatte IAK full
Android Intermediatte IAK fullAndroid Intermediatte IAK full
Android Intermediatte IAK full
Ahmad Arif Faizin
 
Learn Spring Boot With Bisky - 3.pptx
Learn Spring Boot With Bisky - 3.pptxLearn Spring Boot With Bisky - 3.pptx
Learn Spring Boot With Bisky - 3.pptx
MarshallChabaga
 
How to implement email functionalities with Mailjet api
How to implement email functionalities with Mailjet apiHow to implement email functionalities with Mailjet api
How to implement email functionalities with Mailjet api
E Boisgontier
 
SharePoint 2013 REST APIs
SharePoint 2013 REST APIsSharePoint 2013 REST APIs
SharePoint 2013 REST APIs
Giuseppe Marchi
 
API Versioning in the Cloud
API Versioning in the CloudAPI Versioning in the Cloud
API Versioning in the Cloud
Cloud Elements
 
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопсКирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
ScrumTrek
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
Lorna Mitchell
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
 
The Materials API
The Materials APIThe Materials API
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
Sumy PHP User Grpoup
 
The ASP.NET Web API for Beginners
The ASP.NET Web API for BeginnersThe ASP.NET Web API for Beginners
The ASP.NET Web API for Beginners
Kevin Hazzard
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
Lorna Mitchell
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
Lorna Mitchell
 
RedisConf18 - Open Source Built for Scale: Redis in Amazon ElastiCache Service
RedisConf18 - Open Source Built for Scale: Redis in Amazon ElastiCache ServiceRedisConf18 - Open Source Built for Scale: Redis in Amazon ElastiCache Service
RedisConf18 - Open Source Built for Scale: Redis in Amazon ElastiCache Service
Redis Labs
 
Androidphpmysql
AndroidphpmysqlAndroidphpmysql
Androidphpmysql
DigneshPrajapati1
 
Enjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIEnjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web API
Kevin Hazzard
 
RESTing with JAX-RS
RESTing with JAX-RSRESTing with JAX-RS
RESTing with JAX-RS
Ezewuzie Emmanuel Okafor
 

Similar to Android httpclient php_mysql (20)

Android httpclient
Android httpclientAndroid httpclient
Android httpclient
 
Android intermediatte Full
Android intermediatte FullAndroid intermediatte Full
Android intermediatte Full
 
Android Intermediatte IAK full
Android Intermediatte IAK fullAndroid Intermediatte IAK full
Android Intermediatte IAK full
 
Learn Spring Boot With Bisky - 3.pptx
Learn Spring Boot With Bisky - 3.pptxLearn Spring Boot With Bisky - 3.pptx
Learn Spring Boot With Bisky - 3.pptx
 
How to implement email functionalities with Mailjet api
How to implement email functionalities with Mailjet apiHow to implement email functionalities with Mailjet api
How to implement email functionalities with Mailjet api
 
SharePoint 2013 REST APIs
SharePoint 2013 REST APIsSharePoint 2013 REST APIs
SharePoint 2013 REST APIs
 
API Versioning in the Cloud
API Versioning in the CloudAPI Versioning in the Cloud
API Versioning in the Cloud
 
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопсКирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
The Materials API
The Materials APIThe Materials API
The Materials API
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
 
The ASP.NET Web API for Beginners
The ASP.NET Web API for BeginnersThe ASP.NET Web API for Beginners
The ASP.NET Web API for Beginners
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
RedisConf18 - Open Source Built for Scale: Redis in Amazon ElastiCache Service
RedisConf18 - Open Source Built for Scale: Redis in Amazon ElastiCache ServiceRedisConf18 - Open Source Built for Scale: Redis in Amazon ElastiCache Service
RedisConf18 - Open Source Built for Scale: Redis in Amazon ElastiCache Service
 
Androidphpmysql
AndroidphpmysqlAndroidphpmysql
Androidphpmysql
 
Enjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIEnjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web API
 
RESTing with JAX-RS
RESTing with JAX-RSRESTing with JAX-RS
RESTing with JAX-RS
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 

Android httpclient php_mysql

  • 1. ANDROID HTTPCLIENT & 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. Example Android: 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