My basic requirement is to compile some of my existing C++ code with android
ndk. I already have some existing logging in it which is writing to a file.
I compiled my code and executed the same and found that the log file i
wanted was empty. Hence i wrote a sample test application as below, which
was also resulting in an empty file.

On Sat, Dec 5, 2009 at 1:51 AM, Dinesh Harjani
<[email protected]>wrote:

>
> I'm no expert,  but if you allow me, why do you need to use the ndk?
> This can be done perfectly and quickly using the sdk. Besides, it's
> easy to find samples for the sdk; just Google it.
>
> On Dec 4, 11:56 am, KK <[email protected]> wrote:
> > Hi,
> >
> >   I am very new to Android. I am trying the following code in the
> > android ndk.
> >
> > FILE* fp = fopen("/sdcard/test", "wb")
> > if(NULL == fp)
> > {
> >   return errno;}
> >
> > int written = fwrite("Test", 1, 4, fp);
> > if(4 != written)
> > {
> >   return -1;}
> >
> > fclose(fp);
> >
> > return 0;
> >
> > I am trying this on emulator and I have created and sdcard for the
> > emulator. The function returns 0. When I check the sdcard, a file with
> > the name is created, but it is empty. Can anyone please help me on
> > this?
> >
> > Thanks in advance
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
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