|
1 |
| -# easy-csv |
2 |
| -Creates csv file for Android |
3 | 1 |
|
4 |
| -## Download |
| 2 | +# easy-csv |
| 3 | + |
| 4 | +Creates csv file for android |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +## Download |
| 9 | + |
5 | 10 | **Add it in your root build.gradle at the end of repositories:**
|
| 11 | + |
6 | 12 | <pre>
|
| 13 | + |
7 | 14 | allprojects {
|
8 |
| - repositories { |
9 |
| - ... |
10 |
| - maven { url 'https://jitpack.io' } |
11 |
| - } |
| 15 | + |
| 16 | +repositories { |
| 17 | +... |
| 18 | + maven { url 'https://jitpack.io' } |
| 19 | + } |
12 | 20 | }
|
| 21 | + |
13 | 22 | </pre>
|
14 | 23 |
|
| 24 | + |
| 25 | + |
15 | 26 | **Add the dependency**
|
| 27 | + |
16 | 28 | <pre>
|
| 29 | + |
17 | 30 | dependencies {
|
18 |
| - implementation 'com.github.hsmnzaydn:easy-csv:1.0.0' |
| 31 | +implementation 'com.github.hsmnzaydn:easy-csv:1.0.0' |
19 | 32 | }
|
| 33 | + |
20 | 34 | </pre>
|
21 | 35 |
|
22 |
| -## Use Steps |
| 36 | + |
| 37 | + |
| 38 | +## Use Steps |
| 39 | + |
23 | 40 | **Step 1: Create EasyCsv Object**
|
24 |
| - |
25 |
| - ``` java |
26 |
| - EasyCsv easyCsv = new EasyCsv(MainActivity.this); |
27 |
| - ``` |
| 41 | + |
| 42 | +``` java |
| 43 | + |
| 44 | +EasyCsv easyCsv = new EasyCsv(MainActivity.this); |
| 45 | + |
| 46 | +``` |
| 47 | + |
| 48 | + |
28 | 49 |
|
29 | 50 | **Step 2: Create your headerlist and datalist**
|
30 |
| - |
31 |
| - ``` java |
32 |
| - List<String> headerList = new ArrayList<>(); |
33 |
| - headerList.add("Name.Surname.Age-"); |
34 |
| - |
35 |
| - List<String> dataList = new ArrayList<>(); |
36 |
| - dataList.add("Serkan.Ozaydin.23-"); |
37 |
| - ``` |
| 51 | + |
| 52 | +``` java |
| 53 | +List<String> headerList = new ArrayList<>(); |
| 54 | +headerList.add("Name.Surname.Age-"); |
| 55 | + |
| 56 | +List<String> dataList = new ArrayList<>(); |
| 57 | +dataList.add("Serkan.Ozaydin.23-"); |
| 58 | + |
| 59 | +``` |
| 60 | + |
38 | 61 | **Step 3: Select separators for column and line**
|
39 |
| - |
40 |
| - ``` java |
41 |
| - easyCsv.setSeparatorColumn("."); |
42 |
| - easyCsv.setSeperatorLine("-"); |
43 |
| - ``` |
| 62 | + |
| 63 | +``` java |
| 64 | +easyCsv.setSeparatorColumn("."); |
| 65 | +easyCsv.setSeperatorLine("-"); |
| 66 | +``` |
| 67 | + |
44 | 68 | **Step 4: Select separators for column and line**
|
45 |
| - |
46 |
| - |
47 |
| - ``` java |
48 |
| - /** |
49 |
| - * |
50 |
| - * @param fileName Name of the file to be created |
51 |
| - * @param WRITE_PERMISSON_REQUEST_CODE EasyCsv request runtime permission for Write permission to user. When user "Accept" or "Decline" for you can handler |
52 |
| - */ |
53 |
| - easyCsv.createCsvFile(fileName, headerList, dataList WRITE_PERMISSON_REQUEST_CODE, new FileCallback() { |
54 |
| - @Override |
55 |
| - public void onSuccess(File file) { |
56 |
| - } |
57 |
| - @Override |
58 |
| - public void onFail(String err) { |
59 |
| - } |
60 |
| - }); |
61 |
| - ``` |
62 |
| - |
63 |
| - |
64 | 69 |
|
| 70 | +``` java |
| 71 | + |
| 72 | +/** |
| 73 | +* @param fileName Name of the file to be created |
| 74 | +* @param WRITE_PERMISSON_REQUEST_CODE EasyCsv request runtime permission for Write permission to user. When user "Accept" or "Decline" for you can handler |
| 75 | +*/ |
| 76 | +easyCsv.createCsvFile(fileName, headerList, dataList WRITE_PERMISSON_REQUEST_CODE, new FileCallback() { |
| 77 | +@Override |
| 78 | +public void onSuccess(File file) { |
| 79 | +} |
| 80 | + |
| 81 | +@Override |
| 82 | +public void onFail(String err) { |
| 83 | +} |
| 84 | +}); |
65 | 85 |
|
| 86 | +``` |
0 commit comments