December 29, 2009
apache rewrite for mobile browser
mobile browser detection and redirection using apache:
(from ohryan.ca)
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/m/.*$
RewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]
RewriteCond %{HTTP_USER_AGENT} !macintosh [NC] #*SEE NOTE BELOW
RewriteRule ^(.*)$ /m/ [L,R=302]
(from ohryan.ca)
December 28, 2009
tele2 gprs: real ip! and some interesting udp stuff
The Tele2 cell operator provides a real (not from the private network) ip for phone, so it's possible to exchange UDP (just tested it) to WAN. The problem is that each time the phone enables GPRS it has different ip, even from different B class networks ;-)
By the way, I used the simple java udp echo server and simple midlet to test udp interconnection and latency.
By the way, I used the simple java udp echo server and simple midlet to test udp interconnection and latency.
December 26, 2009
J2ME on-device logging
Read an article at Sun tech tips: http://blogs.sun.com/mobility_techtips/entry/simple_strategy_for_logging_and
Article by Vikram Goyal (the great book "J2ME for beginners" author).
Article by Vikram Goyal (the great book "J2ME for beginners" author).
December 23, 2009
think 'bout a new monitor...?
...'cause existing has bad (old, yellow) colors? Recalibrate it! 30 seconds using adobe gamma (or, even simplier, MS Color Control Applet) and you've great colors :-)
Last week before printing a lot photos in A3 format I recalibrated monitor and now say "Wow" each time I turn computer on :)
Last week before printing a lot photos in A3 format I recalibrated monitor and now say "Wow" each time I turn computer on :)
Labels: calibration, monitor
December 20, 2009
url: progress icons generator
December 5, 2009
J2ME: Workaround for "Class NoClassDefFoundError not found"
When you compile for CDLC 1.0 if you use SomeClass.class, you could get this error: "class file for java.lang.NoClassDefFoundError not found".
There're two ways of workaround: compile for CLDC 1.1 or use this style:
instead of:
, although it has the right syntax.
There're two ways of workaround: compile for CLDC 1.1 or use this style:
Class class = Class.forName("package.SomeClass");
instead of:
Class class = package.SomeClass.class;
Labels: j2me, java, NoClassDefFound, programming