osdir.com
mailing list archive

Subject: [android-beginners] Re: Please help in creating simple text file - msg#00800

List: AndroidBeginners

Date: Prev Next Index Thread: Prev Next Index

nitin wrote:
> when i tried after changing the code like:
> catch (IOException ioe) {
> return ioe.toString();
> }
>
> Giving error:
> java.io.FileNotFoundException:
> /data/data/hello.world/files/test.txt
>
> online samples are giving the same code.......am i missing some
> setting/permission? pls help

Where are you getting the Context from? If it is your Activity instance,
this code should work. If you are somehow creating your own Context
object, then that might be the source of your problem -- use a Context
given to you by Android, such as an Activity or Service object.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Training: http://commonsware.com/training.html

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

Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

[android-beginners] Re: File Debuggin android question

sorry i-;; try to google better before i post, i found that i can write files a nd in DDMS view can locate them thanks...2009/8/22 Jose Ayerdis <joseayerdis@xxxxxxxxx> I am retrieving a file from a URL with android is there someway to write that file on my pc or debuggin.... is just too big to get a right view in Logcat -- Atte[[Jose Luis Ayerdis Espinoza]] http://blognecronet.blogspot.com -- Atte[[Jose Luis Ayerdis Espinoza]]http://blognecronet.blogspot.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@xxxxxxxxxxxxxxxx To unsubscribe from this group, send email to android-beginners-unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

Next Message by Date: click to view message preview

[android-beginners]

Hello I am android beginner looking for restaurant finder ,driving direction in mapview if u have the source code plz mail me --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@xxxxxxxxxxxxxxxx To unsubscribe from this group, send email to android-beginners-unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

Previous Message by Thread: click to view message preview

[android-beginners] Re: Please help in creating simple text file

when i tried after changing the code like: catch (IOException ioe) { return ioe.toString(); } Giving error: java.io.FileNotFoundException: /data/data/hello.world/files/test.txt online samples are giving the same code.......am i missing some setting/permission? pls help On Aug 21, 6:30 pm, Mark Murphy <mmur...@xxxxxxxxxxxxxxx> wrote: > nitin wrote: > > thanks for quick response, I am new to android and self learner. how > > to see the adb logcat or in Eclipse. > > http://developer.android.com/guide/developing/tools/ddms.htmlhttp://developer.android.com/guide/developing/tools/adb.html > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Android App Developer Training:http://commonsware.com/training.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@xxxxxxxxxxxxxxxx To unsubscribe from this group, send email to android-beginners-unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

Next Message by Thread: click to view message preview

[android-beginners] Re: Please help in creating simple text file

though I was using 'this' as context in onCreate event. I ran the same code after removing 'Context' as parameter, still same result. At last I uninstalled the application from Emulator and restarted everything........it worked with the same code :) Thanks for your valuable time....but I am still thinking does Emulator not refresh things properly? On Aug 22, 2:46 pm, Mark Murphy <mmur...@xxxxxxxxxxxxxxx> wrote: > nitin wrote: > > when i tried after changing the code like: > > catch (IOException ioe) { > > return ioe.toString(); > > } > > > Giving error: > > java.io.FileNotFoundException: > > /data/data/hello.world/files/test.txt > > > online samples are giving the same code.......am i missing some > > setting/permission? pls help > > Where are you getting the Context from? If it is your Activity instance, > this code should work. If you are somehow creating your own Context > object, then that might be the source of your problem -- use a Context > given to you by Android, such as an Activity or Service object. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Android App Developer Training:http://commonsware.com/training.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@xxxxxxxxxxxxxxxx To unsubscribe from this group, send email to android-beginners-unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by