Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-18-2011, 09:36 PM   #1
s.august
Junior Member
s.august began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2011
Device: Kindle 3 Wi-Fi
Reading from text files in Kindlets

Hi everyone,

I'm working on writing a Kindlet as part of a Senior Project that will display my professor's weekly schedule. I want him to be able to easily change this schedule so I'm attempting to have the app read from an external text file. However, I'm running into problems using either InputStreamReader or FileReader, as the app will return a "An error occurred opening the title" message when I try to open it. Here are the two versions of the code I've tried that yield errors.

Code:
File file = new File("/mnt/us/documents/monday.txt");
FileReader reader = new FileReader(file);
BufferedReader bufferedReader = new BufferedReader(reader);
and the version with InputStreamReader

Code:
InputStream stream = this.getClass().getResourceAsStream("/mnt/us/documents/monday.txt");
InputStreamReader reader = new InputStreamReader(stream);
BufferedReader bufferedReader = new BufferedReader(reader);
If anyone has any advice I'd greatly appreciate it. Take care.
s.august is offline   Reply With Quote
Old 05-19-2011, 12:55 AM   #2
kindle3zeng
Enthusiast
kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.
 
Posts: 35
Karma: 1566
Join Date: Nov 2010
Device: kindle 3wifi
it seems that kindlets are not allowed to access files outside of their work directories (/mnt/us/developer/your_app/work)
kindle3zeng is offline   Reply With Quote
 
Enthusiast
Old 05-19-2011, 07:20 PM   #3
s.august
Junior Member
s.august began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2011
Device: Kindle 3 Wi-Fi
That was exactly it! Thanks so much for your help. Take care.

s.august is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindlet Guide: How to write Kindlets KukMan Kindle Developer's Corner 67 07-08-2013 07:23 AM
Is is possible to use the internal API when writing kindlets? kindle3zeng Kindle Developer's Corner 6 02-07-2011 10:35 PM
Reading software with marking text nettomb Android Devices 9 10-01-2010 02:55 PM
Text tool for formatting Gutenberg text files bob_ninja Workshop 5 11-13-2007 12:28 PM
Reading Text Files ? grayfox iRex 8 10-17-2007 11:20 PM


All times are GMT -4. The time now is 03:11 PM.


MobileRead.com is a privately owned, operated and funded community.