Skip to content

Commit

Permalink
new readme for 1.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
p32929 committed Dec 16, 2018
1 parent d79379b commit f6c0e97
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 35 deletions.
Binary file modified .gradle/4.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/4.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/4.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/4.1/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file modified .gradle/4.1/javaCompile/javaCompile.lock
Binary file not shown.
Binary file modified .gradle/4.1/taskHistory/fileSnapshots.bin
Binary file not shown.
Binary file modified .gradle/4.1/taskHistory/taskHistory.bin
Binary file not shown.
Binary file modified .gradle/4.1/taskHistory/taskHistory.lock
Binary file not shown.
66 changes: 35 additions & 31 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ allprojects {
Add the dependency
```
dependencies {
implementation 'com.github.p32929:AndroidEasySQL-Library:1.3.3'
implementation 'com.github.p32929:AndroidEasySQL-Library:1.3.4'
}
```

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

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

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

or

```Cursor res = easyDB.getAllDataOrderedBy(columnNumber, ascendingOrDescending);```

```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.

Later use a while loop like this:

```
Expand All @@ -112,7 +118,7 @@ int anIntegerVariable = res.getInt(columnIndex);
String aStringVariable = res.getString(columnIndex);
```

here ```columnIndex``` is an integer, starts from 0
here ```columnIndex``` is an integer, starts from 0.

Example:

Expand All @@ -124,14 +130,26 @@ while (res.moveToNext()) {
}
```

or

```
Cursor res = easyDB.getAllDataOrderedBy(columnIndex, false);
while (res.moveToNext()) {
int anIntegerVariable = res.getInt(columnIndex);
String aStringVariable = res.getString(columnIndex);
}
```

Here, ```columnIndex``` >= 1

### Get/Read one row data:
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.
Example:
```
Cursor res = easyDB.getOneRowData(1);
if (res != null) {
res.moveToFirst(); // Because here's only one row data
String ID = res.getString(0); // This is the rowID, getting from the ID column
String ID = res.getString(0); // Column 0 is the ID column
String c1 = res.getString(1);
String c2 = res.getString(2);
}
Expand Down
1 change: 1 addition & 0 deletions build/android-profile/profile-2018-12-16-22-36-31-228.json

Large diffs are not rendered by default.

Binary file not shown.

0 comments on commit f6c0e97

Please sign in to comment.