Skip to content

Commit f6c0e97

Browse files
committed
new readme for 1.3.4
1 parent d79379b commit f6c0e97

File tree

12 files changed

+58
-35
lines changed

12 files changed

+58
-35
lines changed

.gradle/4.1/fileHashes/fileHashes.bin

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
68 Bytes
Binary file not shown.
482 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

.idea/workspace.xml

Lines changed: 35 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ allprojects {
1414
Add the dependency
1515
```
1616
dependencies {
17-
implementation 'com.github.p32929:AndroidEasySQL-Library:1.3.3'
17+
implementation 'com.github.p32929:AndroidEasySQL-Library:1.3.4'
1818
}
1919
```
2020

@@ -94,10 +94,16 @@ Thus, it will return a boolean value.
9494
```False``` means data isn't added successfully.
9595

9696
### Get/Read All Data:
97-
To get all data as a ```Cursor``` object, call ```getAllData()``` like this:
97+
To get all data as a ```Cursor``` object, call ```getAllData()``` or ```getAllDataOrderedBy()``` like this:
9898

9999
```Cursor res = easyDB.getAllData();```
100100

101+
or
102+
103+
```Cursor res = easyDB.getAllDataOrderedBy(columnNumber, ascendingOrDescending);```
104+
105+
```ascendingOrDescending``` parameter in ```getAllDataOrderedBy()``` is a boolean value. To get all data in ascending order pass ```true```, or to get all in descending order pass ```false``` as the parameter.
106+
101107
Later use a while loop like this:
102108

103109
```
@@ -112,7 +118,7 @@ int anIntegerVariable = res.getInt(columnIndex);
112118
String aStringVariable = res.getString(columnIndex);
113119
```
114120

115-
here ```columnIndex``` is an integer, starts from 0
121+
here ```columnIndex``` is an integer, starts from 0.
116122

117123
Example:
118124

@@ -124,14 +130,26 @@ while (res.moveToNext()) {
124130
}
125131
```
126132

133+
or
134+
135+
```
136+
Cursor res = easyDB.getAllDataOrderedBy(columnIndex, false);
137+
while (res.moveToNext()) {
138+
int anIntegerVariable = res.getInt(columnIndex);
139+
String aStringVariable = res.getString(columnIndex);
140+
}
141+
```
142+
143+
Here, ```columnIndex``` >= 1
144+
127145
### Get/Read one row data:
128146
To get all column data from a row, call ```getOneRowData(rowID)```. It will return the data as a Cursor object. You can then retrieve each column data from the cursor.
129147
Example:
130148
```
131149
Cursor res = easyDB.getOneRowData(1);
132150
if (res != null) {
133151
res.moveToFirst(); // Because here's only one row data
134-
String ID = res.getString(0); // This is the rowID, getting from the ID column
152+
String ID = res.getString(0); // Column 0 is the ID column
135153
String c1 = res.getString(1);
136154
String c2 = res.getString(2);
137155
}

build/android-profile/profile-2018-12-16-22-36-31-228.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.

0 commit comments

Comments
 (0)