Skip to content

Commit 57a7548

Browse files
Merge remote-tracking branch 'origin/master'
2 parents 57cc208 + 9499d0c commit 57a7548

1 file changed

Lines changed: 38 additions & 2 deletions

File tree

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
2426
1. 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
```
2831
2. Start the fetching data.
2932
```
3033
fetchData.start();
3134
```
3235
3. 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

3773
This is just like a pre-release version there are lot of other features coming soon.

0 commit comments

Comments
 (0)