File doesn't create so i thin k my /sdcard is not recongnized but when
i launch emulator with

emulator -avd my_avd -sdcard C:\SDCard

I have no error.

On Aug 17, 2:48 pm, Dany BREARD <[email protected]> wrote:
> Ok thanks dillirao
>
> So firslty,  to create my File, I have to launch my AVD amulator with
> the following line on cmd:
>
> emulator -avd my_avd -sdcard C:\SDCard
>
> My emulator is launched
>
> And then I run my application :
>
> File oText = new File("C:/SDCard/File.wav");
> FileOutputStream fStream = new FileOutputStream(oText);
> fStream.write(decoded);
> fStream.close();
>
> But there is the same error, so this preceding code is it true ??
>
> I think i had to set permission  "writeOwnerData" after that its why i
> don't use that now.
>
> thanks
>
>  Dany
>
> On Aug 17, 12:10 pm, dillirao malipeddi <[email protected]>
> wrote:
>
> > and also set permission  "writeOwnerData"
>
> > On Mon, Aug 17, 2009 at 3:39 PM, dillirao malipeddi <[email protected]
>
> > > wrote:
> > >  Hi   Dany BREARD
> > > you have no permissions to access windows file system through emulator
>
> > > if u want to create a file  use
> > > byte[] decoded = Base64.decode( StringBase64 );
>
> > > File oText = new File("/sdcard/filename.ext");
> > > //or: File oText = new File( "File");
> > > //FileNotFoundException
>
> > > FileOutputStream fStream = new FileOutputStream(oText);
> > > fStream.write(decoded);
> > > fStream.close();
>
> > > set sdcard while launching the emulator by -sdcard option
>
> > > On Mon, Aug 17, 2009 at 3:02 PM, Dany BREARD <[email protected]>wrote:
>
> > >> Maybe is about Security and Permissions or User IDs and File Access
>
> > >> On Aug 17, 9:53 am, Dany BREARD <[email protected]> wrote:
> > >> > All Errors:
>
> > >> > 08-17 07:50:29.964: WARN/System.err(860):
> > >> > java.io.FileNotFoundException: /C:/Documents and Settings/.../
> > >> > workspace/SocketInterface/File
> > >> > 08-17 07:50:29.984: WARN/System.err(860):     at
> > >> > org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:
> > >> > 231)
> > >> > 08-17 07:50:29.993: WARN/System.err(860):     at
> > >> > java.io.FileOutputStream.<init>(FileOutputStream.java:96)
> > >> > 08-17 07:50:30.004: WARN/System.err(860):     at
> > >> > java.io.FileOutputStream.<init>(FileOutputStream.java:69)
> > >> > 08-17 07:50:30.004: WARN/System.err(860):     at
> > >> > com.dany.android.socketinterface.Client.start(Client.java:343)
> > >> > 08-17 07:50:30.025: WARN/System.err(860):     at
> > >> > com.dany.android.socketinterface.TabVoicemail.onCreate
> > >> > (TabVoicemail.java:51)
> > >> > 08-17 07:50:30.044: WARN/System.err(860):     at
> > >> > android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> > >> > 1123)
> > >> > 08-17 07:50:30.044: WARN/System.err(860):     at
> > >> > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> > >> > 2231)
> > >> > 08-17 07:50:30.054: WARN/System.err(860):     at
> > >> > android.app.ActivityThread.startActivityNow(ActivityThread.java:2112)
> > >> > 08-17 07:50:30.064: WARN/System.err(860):     at
> > >> > android.app.LocalActivityManager.moveToState(LocalActivityManager.java:
> > >> > 127)
> > >> > 08-17 07:50:30.073: WARN/System.err(860):     at
> > >> > android.app.LocalActivityManager.startActivity
> > >> > (LocalActivityManager.java:339)
> > >> > 08-17 07:50:30.084: WARN/System.err(860):     at android.widget.TabHost
> > >> > $IntentContentStrategy.getContentView(TabHost.java:600)
> > >> > 08-17 07:50:30.094: WARN/System.err(860):     at
> > >> > android.widget.TabHost.setCurrentTab(TabHost.java:310)
> > >> > 08-17 07:50:30.103: WARN/System.err(860):     at
> > >> > android.widget.TabHost.addTab(TabHost.java:203)
> > >> > 08-17 07:50:30.103: WARN/System.err(860):     at
> > >> > com.dany.android.socketinterface.InterfaceGraphiqueVVM.onCreate
> > >> > (InterfaceGraphiqueVVM.java:24)
> > >> > 08-17 07:50:30.113: WARN/System.err(860):     at
> > >> > android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> > >> > 1123)
> > >> > 08-17 07:50:30.113: WARN/System.err(860):     at
> > >> > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> > >> > 2231)
> > >> > 08-17 07:50:30.113: WARN/System.err(860):     at
> > >> > android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> > >> > 2284)
> > >> > 08-17 07:50:30.133: WARN/System.err(860):     at
> > >> > android.app.ActivityThread.access$1800(ActivityThread.java:112)
> > >> > 08-17 07:50:30.133: WARN/System.err(860):     at
> > >> > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
> > >> > 08-17 07:50:30.143: WARN/System.err(860):     at
> > >> > android.os.Handler.dispatchMessage(Handler.java:99)
> > >> > 08-17 07:50:30.153: WARN/System.err(860):     at android.os.Looper.loop
> > >> > (Looper.java:123)
> > >> > 08-17 07:50:30.153: WARN/System.err(860):     at
> > >> > android.app.ActivityThread.main(ActivityThread.java:3948)
> > >> > 08-17 07:50:30.153: WARN/System.err(860):     at
> > >> > java.lang.reflect.Method.invokeNative(Native Method)
> > >> > 08-17 07:50:30.153: WARN/System.err(860):     at
> > >> > java.lang.reflect.Method.invoke(Method.java:521)
> > >> > 08-17 07:50:30.153: WARN/System.err(860):     at
> > >> > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> > >> > (ZygoteInit.java:782)
> > >> > 08-17 07:50:30.163: WARN/System.err(860):     at
> > >> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> > >> > 08-17 07:50:30.163: WARN/System.err(860):     at
> > >> > dalvik.system.NativeStart.main(Native Method)
>
> > >> > On Aug 17, 9:29 am, Dany BREARD <[email protected]> wrote:
>
> > >> > > Hi I want to create new File into android or in my workspace but a
> > >> > > FileNotFoundException is thrown.
>
> > >> > > [syntax="java"]
>
> > >> > > byte[] decoded = Base64.decode( StringBase64 );
>
> > >> > > File oText = new File("C:/Documents and Settings/.../workspace/
> > >> > > SocketInterface", "File");
> > >> > > //or: File oText = new File( "File");
> > >> > > //FileNotFoundException
>
> > >> > > FileOutputStream fStream = new FileOutputStream(oText);
> > >> > > fStream.write(decoded);
> > >> > > fStream.close();
>
> > >> > > [/syntax]
>
> > >> > > How can I create my File ??
> > >> > > Maybe there is something to instantiate about android security or
> > >> > > something other ???
>
> > >> > > Thanks in advance.
> > >> > > Dany
>
> > > --
> > > Dilli Rao. M
> > > Software Developer
> > >www.arijasoft.com
> > > - a pioneer in Mobile App Development
>
> > --
> > Dilli Rao. M
> > Software Developerwww.arijasoft.com
> > - a pioneer in Mobile App Development
--~--~---------~--~----~------------~-------~--~----~
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