• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

widget to display a text file and be able to refresh

I have scripts that download things every hour and would like to have them displayed automatically in a widget and have the widget refresh every hour. I couldn't find anything in the market that would simply display a file, let alone refresh.

That's the general idea, here's some brainstorming:

Should have a transparent option, I hate most non-transparent widgets.

It should be able to display any text file on /sdcard but might as well make it work for any location for rooted users.

Instead of coding a battery draining scheduler for the refresh, I suppose it wouldn't hurt if the refresh was handled only by an intent. Tasker and Locale are the only ways I know of to change a file on a schedule, so there's probably not many other people who will have a use for the refresh and anyone with Tasker/Locale should be able to figure it out and schedule the update through those.
 
Even though this is my first post, I have been lurking for quite a while.

Now to the point, over the past week or so I have been working on a widget that will do just this.

So far everything is working on the virtual device, but I will need some real testers soon.

Current features:

  • Widget can be resized with a launcher to display more text at a time.
  • Widget has two buttons to scroll up and down. However, the scroll is based on the individual lines / paragraphs.
  • Widget reads in the file only every 30 minutes / first time load of widget and then caches the file contents for scrolling.
  • Widget has a selection between black backing / transparent, and black text / white text.
  • On widget configuration, the configuration searches the device and sdcard for available compatible text files.
  • Widget can read in .txt, .docx, and .pdf. Future release will hopefully be able to just extract the text from an .rtf file also. Note: any images / tables in the docx and pdf are discarded. Only the text is extracted from them. PDF text extraction isn't perfect, but will suffice.
  • There can be more than 1 version of the widget active. Want to view 2 different files? No problem, just add another widget and select a different file to view. Each widget operates independently of one another. Meaning the contents and scrolling does not affect the other.
I am hoping to complete it by next week, and get it out for testing. It currently is only lacking some code optimizations that are pointed out in the android design documentation.
 
  • Like
Reactions: Saney
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones