Bonjour à tous.

J'aimerai coder un programme concernant l'upload d'un fichier CSV mais je ne sais pas trop comment commencer.

Le programme que j'ai déjà réaliser est celui qui génère le fichier CSV:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  File exportDir = new File(Environment.getExternalStorageDirectory(), "MAGFTP");
 
        if (!exportDir.exists()){
            exportDir.mkdirs();
        }
 
        File file = new File(exportDir, id+".csv");
 
        try{
            file.createNewFile();
            CSVWriter csvWrite = new CSVWriter(new FileWriter(file));
 
            Cursor curCSV = magBase.getAllDataCritere(id);
 
            csvWrite.writeNext(curCSV.getColumnNames());
 
            while(curCSV.moveToNext()){
 
                String arrStr[] ={curCSV.getString(0),curCSV.getString(1),curCSV.getString(2),curCSV.getString(3),curCSV.getString(4)};
 
                csvWrite.writeNext(arrStr);
            }
 
            csvWrite.close();
 
            curCSV.close();
 
        }catch(SQLException sqlEx){
 
            Log.e("Test de exportation", sqlEx.getMessage(), sqlEx);
 
        } catch (IOException e) {
            e.printStackTrace();
        }


Est ce quelqu'un peux m'aider s'il vous plaît.

Merci d'avance