> In one of my applications, I am pushing few image files say "xyz.png"
> into the device using "adb push " command. And I use these files in my
> application by giving their exact filepaths (say if I have pushed them
> into /data, I wud say /data/xyz.png).

You cannot write to /data on production devices.

> But my requirement is that I should not be pushing the files manually
> into the device. Instead I need these images to be a part of my .apk
> itself. And I should get their fullpath which are the input parameter
> to my method in the application.

Files in APKs (e.g., assets, raw resources) are not stored as files in the
device filesystem -- generally, they remain in the APK.

You can get InputStreams on those via the Resources object (obtained via
getResources() in your activity). This may mean that you will need to
modify your method to accept an InputStream as input, rather than a File.

If these are files you intend to modify, you will need to use the
InputStream to copy the file from the APK to some location on the device
(e.g., openFileOutput()).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to