My tech exploits. Nah... closer to a tech diary, and work log, so if I forget something, but know I forgot, I'll maybe be able to look it up here. And as a bonus, perhaps someone out there will find it useful or interesting. As is only fair, being nearly all the information put here was gleaned from elsewhere on the web.
Showing posts with label LG dLite. Show all posts
Showing posts with label LG dLite. Show all posts
Sunday, June 12, 2011
Published J2ME Image Viewer MIDlet
Published my first J2ME MIDlet, my first open source application, named simply "J2ME Image Viewer".
I was annoyed that I could not find a good full resolution image viewer for my LG phone. The photo viewer app included with the phone automatically reduces the resolution of images to fit the screen. And even though it has a zoom in function, when zoomed in the image is still shown at lower resolution instead of the true resolution of the underlying image file, resulting in a blurry image when viewing zoomed in hires images. This makes viewing images that require full resolution detail like maps and text in images useless. J2ME Image Viewer fixes all of that.
Link to J2ME Image Viewer
Saturday, May 21, 2011
How to use LG GD570 dLite phone Ad Hoc Playlist
(I couldn't find this useful feature explained in the LG GD570 manual or in google.)
Friday, May 20, 2011
python script to replace html Entities (&; codes)
This script converts html files in place, replacing html character entities with standard characters. I'm using this to clean up html entities unrecognized by the Anyview j2me javame midlet ebook reader for LG dlite gd570 phone.
# htmlcodefix.py (dlc 5/2011)
# replace html entity codes . writes new html file in place.
import sys
import os
import re
trans = { "“" : "\"",
" " : " ",
"”" : "\"",
"’" : "'",
"—" : "--",
}
def main():
if len(sys.argv) != 2:
print("Usage: " + sys.argv[0] + " {html file to convert in-place}")
exit();
filename = sys.argv[1]
if(not filename.endswith(("htm", "html"))):
print(filename + " not html!")
exit();
if(not os.path.exists(filename)):
print(filename + " not found!")
exit();
print("converting ... " + filename)
with open(filename, 'r') as f:
read_data = f.read()
for (srch, repl) in trans.items():
print (srch, repl)
read_data = read_data.replace(srch, repl)
print(read_data)
with open(filename, mode='w') as f:
f.write(read_data)
if __name__ == '__main__':
main()
Subscribe to:
Posts (Atom)