Weeks have passed and still no update from HTC regarding the availability of the HTC Desire’s Linux kernel source code. Let’s take a look back at the history of the case: On April 3rd, I initially asked for the Desire’s Linux kernel source code in accordance with the GPLv2. A couple of mails and a few weeks later, HTC finally escalated the support ticket and eventually forwarded my request to R&D on April 16th. (more…)
Posts Tagged ‘English’
Java Method Signature Name Mangling
Sunday, April 25th, 2010
As with any modern programming language that supports method overloading, Java uses name mangling to distinguish methods that share the same name, but only differ in their parameters. Now, actually figuring out the exact algorithm used by javac by googling the Internet turned out to be quite tricky. Eventually, I dug up the following description, which at least serves as a starting point:
P.S.: This would not even have been an issue if HTC would open-source their proprietary code for the HTC Desire…
Hash It! Updated to Version 1.0.2
Tuesday, April 20th, 2010
It has been a while since I last worked on Hash It!, but thanks to the bug report of an attentive user I just uploaded a new version (1.0.2) of Hash It! to the Android Market. Bottom line: Hash It! now works correctly on Android 1.5.
Hash It! is licensed under the GPLv3 and as such comes with full source code for your entertainment.
Further details on how to download it to your mobile phone as well as the changelog are available at: http://android.ginkel.com/
Get it while it is still hot!
Android: Maps API Key Issues
Monday, April 19th, 2010
When using Google Maps from within your Android application you need to obtain an API key in order to be able to retrieve Maps data at run-time. This API key is derived from the fingerprint of the signature key used to sign the application’s APK. Consequently, if the signature key used by your application at a given point in time no longer matches the one used to register the Maps API key, using the MapView will silently fail (the map will just display a gray grid instead of the expected map data). So far, so good.
As it seems, the Android ADT Eclipse plug-in also comes with an undocumented “feature”: If no “Custom debug keystore” is set in the Android Build Preferences, it will apparently use a different key to sign the APK when deploying it to a phone connected via USB than when deploying it to the Emulator. So, all your Maps applications will suddenly start to fail displaying map data once they are deployed on a real device for testing purposes.
To work around this issue, set the “Custom debug keystore” setting (empty by default) to the same value as the “Default debug keystore”.
HTC’s GPL (non-)compliance
Saturday, April 3rd, 2010
Well, Linux is not just free as in beer, but also free as in speech. As I wanted to dig a little deeper into HTC’s modifications applied to the Desire’s Linux kernel I did, what I am entitled to as per the GPLv2 the Desire’s Linux kernel is licensed under: I requested the source code via HTC’s support as the “HTC Developer Center” at http://developer.htc.com/, which usually hosts the Linux kernel source code drops for their Android phones, does not mention the Desire yet:
Dear HTC support,
I would hereby like to request the Linux Kernel source code for my HTC Desire phone according to section 3 of the GNU General Public License v2 under which the Linux kernel the Desire is based on is licensed. A download URL will be fine.
Thanks,
Thilo
The answer I received was somewhat unexpected, but I will leave the judgment up to the reader:
Dear Thilo-Alexander
Thank you for your enquiry about linux.
Sorry we don’t support Linux, even though linux and android have similarities they’re not made for eachother. But here is the link for our kernals http://developer.htc.com/, happy Easter!
Best regards,
xxxx x
HTC Tech Support
www.htc.com
Tel: +44 8458900xxx
Better luck next time… I replied through their ticketing system insisting on a source code copy (along with a short educational section about the true origins of the Android platform
). Let’s see what their next reply will look like…
PHP Unicode support – or the lack thereof
Wednesday, March 31st, 2010
Well, I just had the pleasure to fix special character (umlaut) handling in a legacy PHP application. To put it short: It has been a while since I saw so many i18n issues as I figured out in PHP (version 5) during the last hour:
- PHP strings are just plain byte arrays. Their content is non-portable as it is dependent on the current default encoding.
- The same applies to the representation built by
serialize. It contains a length-prefixed byte representation of the string without actually storing any encoding information. - Most PHP (string) functions have no clue about Unicode. For a detailed list including each function’s risk level, refer to: http://www.phpwact.org/php/i18n/utf-8
Note to self: Never ever use PHP for a new project.
Duplicity – Backup to the Cloud
Sunday, March 7th, 2010
Due to current events I started to think about options for a backup solution that would be able to cope with a complete disastrous loss of hardware. So, off-site storage was warranted.
What I came up with is a backup solution based on Duplicity and Amazon S3.
Storing personal data in the cloud may ring one or another alarm, but with Duplicity the data is safe from prying eyes as all backed up data is sent through GnuPG using public-key encryption before being transferred to Amazon’s data center. You should, however, make sure that one of the private keys used for encrypting the backup is locked away in a safe place, so you have it handy when it is time to perform a restore.
As far as storage costs are concerned, storing 50 GB of data in the AWS S3 cloud for a month costs around 6 EUR, which I personally consider quite competitive for redundant off-site data storage.
Naturally, one drawback remains: Bandwidth usage. It takes a while to load the first full backup into the cloud as the upstream of most DSL lines is rather limited. After that initial load has completed, however, Duplicity is capable of appending incremental backup sets to the existing backup data, so the incremental backups complete much faster.
P.S.: It may sound a little weird that I chose Amazon Web Services as a storage provider after my recent trouble with Amazon.de, but after some thorough market analysis AWS remained as the only feasible option.
Ruby on Rails naming collisions
Saturday, February 27th, 2010
Well, this post merely serves as a note to myself:
Do not create an instance variable named @template in an ActionController or bad things will happen, such as this not very self-explanatory error:
NoMethodError (undefined method `view_paths’ for #<EmailTemplate:0×7f751953fad0>):
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run’
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread’
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread’
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each’
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start’
/var/lib/gems/1.8/gems/ruby-debug-ide-0.4.5/lib/ruby-debug.rb:101:in `debug_load’
/var/lib/gems/1.8/gems/ruby-debug-ide-0.4.5/lib/ruby-debug.rb:101:in `debug_program’
/var/lib/gems/1.8/gems/ruby-debug-ide-0.4.5/bin/rdebug-ide:82
/var/lib/gems/1.8/bin/rdebug-ide:19:in `load’
/var/lib/gems/1.8/bin/rdebug-ide:19
-e:2:in `load’
-e:2
This invoice is brought to you by java.lang.NullPointerException
Wednesday, January 27th, 2010
ActionMailer and mod_fcgi
Tuesday, January 26th, 2010
Lately, I have been playing around a lot with Ruby on Rails and am currently finishing my first full-fledged application. While I am using WEBrick directly launched from my Eclipse development IDE in my development environment the production site is currently using Apache + mod_fcgi to run the application. This is where all the problems started.
The application sends out e-mail notifications (using ActionMailer) for various state transitions, which worked flawlessly on the development machine. In the production setting, however, sending mails failed complaining that it cannot find the associated mail template:
ActionView::MissingTemplate (Missing template event_mailer/approval_requested_notification.erb in view path app/views):
app/models/event_observer.rb:3:in `after_enter_awaiting_approval'
/usr/lib/ruby/1.8/observer.rb:185:in `notify_observers'
/usr/lib/ruby/1.8/observer.rb:184:in `each'
/usr/lib/ruby/1.8/observer.rb:184:in `notify_observers'
(eval):10:in `create_or_update_without_callbacks'
app/controllers/event_controller.rb:71:in `request_approval'
public/dispatch.fcgi:24
Well, after putting some thought into possible differences between development and production and ruling out any relevant configuration differences in config/* all that remained was the fact that dev uses WEBrick while production uses mod_fcgi. One thought lead to another and it turned out that WEBrick sets the application root as the current working directory during startup while mod_fcgi does not.
So, the workaround is simple: Set the current working directory to the application root in config/environment.rb, such as:
Dir.chdir(File.dirname(__FILE__) << '/../')
