Bonjour,
J'aimerais savoir comment faire pour aller chercher des informations dans un fichier XML autre part que dans le dossier " res " du projet Android. Par exemple, dans un autre endroit dans le téléphone.. !
Je vous remercie !:zoubi:
Version imprimable
Bonjour,
J'aimerais savoir comment faire pour aller chercher des informations dans un fichier XML autre part que dans le dossier " res " du projet Android. Par exemple, dans un autre endroit dans le téléphone.. !
Je vous remercie !:zoubi:
Bonjour,
Tu peux récupérer des fichiers xml dans le répertoire Assets je te mets un lien vers la class permettant d'ouvrir un fichier quelqueconque dans ton répertoire assets.
http://developer.android.com/referen...etManager.html
Après tu peux toujours lire un fichier sur la sdcard.
Voilà c'est ce que je veux faire, lire un fichier sur la sd card!! :)
Bonjour,
Tu as tout expliqué sur ce cette page ;).
http://developer.android.com/guide/t...#filesExternal
Citation:
Accessing files on external storage
If you're using API Level 8 or greater, use getExternalFilesDir() to open a File that represents the external storage directory where you should save your files. This method takes a type parameter that specifies the type of subdirectory you want, such as DIRECTORY_MUSIC and DIRECTORY_RINGTONES (pass null to receive the root of your application's file directory). This method will create the appropriate directory if necessary. By specifying the type of directory, you ensure that the Android's media scanner will properly categorize your files in the system (for example, ringtones are identified as ringtones and not music). If the user uninstalls your application, this directory and all its contents will be deleted.
If you're using API Level 7 or lower, use getExternalStorageDirectory(), to open a File representing the root of the external storage. You should then write your data in the following directory:
/Android/data/<package_name>/files/
The <package_name> is your Java-style package name, such as "com.example.android.app". If the user's device is running API Level 8 or greater and they uninstall your application, this directory and all its contents will be deleted.