Hey all,

in case anyone else has a similar problem - here is a bit of code that
might help. All I do is write a dummy file to the location I want to
put a file to, making it world writable (not sure if I have to sue
this flag or not, but it does not matter really, as i will only use
this script once), then push right on top of it

public class Playback extends Activity {
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);

                try {
                        FileOutputStream fs = openFileOutput("ff.mp4",
Context.MODE_WORLD_WRITEABLE);
                        fs.close();
                } catch (FileNotFoundException e2) {
                        e2.printStackTrace();
                } catch (IOException e) {
                        e.printStackTrace();
                }
        }
}


Run that to create the correct folders and files
(org.you.yourapp.whatever/files/yourfile.woohoo), then push
squid$ adb -d push ~/Desktop/ff.mp4 /data/data/org.test/files/ff.mp4
failed to copy '/Users/squid/Desktop/ff.mp4' to '/data/data/org.test/
files/ff.mp4': Permission denied
squid$ adb -d push ~/Desktop/ff.mp4 /data/data/org.test/files/ff.mp4


HTH
Hamy

On Apr 6, 10:36 am, Bo <[email protected]> wrote:
> On Apr 5, 8:33 am, Mark Murphy <[email protected]> wrote:
>
> > Bowrote:
> > > Would you please give a little more detail about pushing files to that
> > > app-local file sotre? I still got the "permission denied" when I was
> > > trying to push a file there (My phone don't have that "files"
> > > subdirectory).
>
> > Then you can't push it there. Your application will need to do something
> > to cause that folder to be created (e.g., call openFileOutput() from
> > your application).
>
> Thank you~ I got it solved.
>
>
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to