-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
72 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,86 @@ | ||
# easy-csv | ||
Creates csv file for Android | ||
|
||
## Download | ||
# easy-csv | ||
|
||
Creates csv file for android | ||
|
||
|
||
|
||
## Download | ||
|
||
**Add it in your root build.gradle at the end of repositories:** | ||
|
||
<pre> | ||
|
||
allprojects { | ||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
|
||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
|
||
</pre> | ||
|
||
|
||
|
||
**Add the dependency** | ||
|
||
<pre> | ||
|
||
dependencies { | ||
implementation 'com.github.hsmnzaydn:easy-csv:1.0.0' | ||
implementation 'com.github.hsmnzaydn:easy-csv:1.0.0' | ||
} | ||
|
||
</pre> | ||
|
||
## Use Steps | ||
|
||
|
||
## Use Steps | ||
|
||
**Step 1: Create EasyCsv Object** | ||
|
||
``` java | ||
EasyCsv easyCsv = new EasyCsv(MainActivity.this); | ||
``` | ||
|
||
``` java | ||
|
||
EasyCsv easyCsv = new EasyCsv(MainActivity.this); | ||
|
||
``` | ||
|
||
|
||
|
||
**Step 2: Create your headerlist and datalist** | ||
|
||
``` java | ||
List<String> headerList = new ArrayList<>(); | ||
headerList.add("Name.Surname.Age-"); | ||
|
||
List<String> dataList = new ArrayList<>(); | ||
dataList.add("Serkan.Ozaydin.23-"); | ||
``` | ||
|
||
``` java | ||
List<String> headerList = new ArrayList<>(); | ||
headerList.add("Name.Surname.Age-"); | ||
|
||
List<String> dataList = new ArrayList<>(); | ||
dataList.add("Serkan.Ozaydin.23-"); | ||
|
||
``` | ||
|
||
**Step 3: Select separators for column and line** | ||
|
||
``` java | ||
easyCsv.setSeparatorColumn("."); | ||
easyCsv.setSeperatorLine("-"); | ||
``` | ||
|
||
``` java | ||
easyCsv.setSeparatorColumn("."); | ||
easyCsv.setSeperatorLine("-"); | ||
``` | ||
|
||
**Step 4: Select separators for column and line** | ||
|
||
|
||
``` java | ||
/** | ||
* | ||
* @param fileName Name of the file to be created | ||
* @param WRITE_PERMISSON_REQUEST_CODE EasyCsv request runtime permission for Write permission to user. When user "Accept" or "Decline" for you can handler | ||
*/ | ||
easyCsv.createCsvFile(fileName, headerList, dataList WRITE_PERMISSON_REQUEST_CODE, new FileCallback() { | ||
@Override | ||
public void onSuccess(File file) { | ||
} | ||
@Override | ||
public void onFail(String err) { | ||
} | ||
}); | ||
``` | ||
|
||
|
||
``` java | ||
|
||
/** | ||
* @param fileName Name of the file to be created | ||
* @param WRITE_PERMISSON_REQUEST_CODE EasyCsv request runtime permission for Write permission to user. When user "Accept" or "Decline" for you can handler | ||
*/ | ||
easyCsv.createCsvFile(fileName, headerList, dataList WRITE_PERMISSON_REQUEST_CODE, new FileCallback() { | ||
@Override | ||
public void onSuccess(File file) { | ||
} | ||
|
||
@Override | ||
public void onFail(String err) { | ||
} | ||
}); | ||
|
||
``` |