@@ -21,17 +21,53 @@ allprojects {
2121 }
2222```
2323## Methods and how to use them
24+ We have Two classes FetchData and PutData. Import the Library to your file first (In android studio paste the code and press alt + enter).
25+ ### Read Data From a URL - FetchData.class
24261 . Create an object for FetchData class, pass the URL as argument. Don't forget to import the class.
2527```
26- FetchData fetchData = new FetchData("https://projects.vishnusivadas.com/AdvancedHttpURLConnection/readtest.php");
28+ String URL = "https://projects.vishnusivadas.com/AdvancedHttpURLConnection/readTest.php";
29+ FetchData fetchData = new FetchData(URL);
2730```
28312 . Start the fetching data.
2932```
3033fetchData.start();
3134```
32353 . Get the result as string.
3336```
34- String data = fetchData.getValue();
37+ String data = fetchData.getResult();
38+ ```
39+
40+ ### Write data with POST and GET methods - PutData.class
41+ 1 . Creating array for parameters
42+ ```
43+ String[] param = new String[2];
44+ param[0] = "param-1";
45+ param[1] = "param-2";
46+ ```
47+ _ Use any parameter name that you like._
48+
49+ 2 . Creating array for data
50+ ```
51+ String[] data = new String[2];
52+ data[0] = "data-1";
53+ data[1] = "data-2";
54+ ```
55+ _ Add as many as data and parameters as you like. Make sure number of parameters is equal to number of data. Also add them in exact order._
56+
57+ 3 . Create an object for PutData class, pass the URL as argument. Don't forget to import the class.
58+ ```
59+ String URL = "https://projects.vishnusivadas.com/AdvancedHttpURLConnection/putDataTest.php";
60+ PutData putData = new PutData(URL, "POST", param, data);
61+ ```
62+
63+ 4 . Start the putData process.
64+ ```
65+ putData.start();
66+ ```
67+
68+ 5 . Get the result as string.
69+ ```
70+ String data = putData.getResult();
3571```
3672
3773This is just like a pre-release version there are lot of other features coming soon.
0 commit comments