Archive for the ‘Android’ Category

android2po: Managing Android translations 0

I've always liked gettext a lot. Rather than asking you to maintain a database of strings, assigning an id to each, it simply uses the original strings itself as the string id. To me, it's a classical example of choosing practicality over purity.
The Android localization system, of course, uses the former approach. Each string is [...]

Clickable URLs in Android TextViews 6

Android's TextView widget can contain clickable URLs. It can easily make web addresses open in the browser, or connect phone numbers with the dialer. All that is amazing compared to the last GUI framework I used, Delphi's once great VCL).
Unfortunately, both TextView and the Linkify utility it uses basically hardcode URL click handling to Intents, [...]

Android: Determine if running in emulator 1

if ("1".equals(SystemProperties.get("ro.kernel.qemu")) {
// Emulator
}

[via]

Writing an Android Widget: What the docs don't tell you 7

Having recently written my first Widget for Android, here are some of the things I learned in the process.
Use a thread, not just a service
In the blog post introducing the AppWidget framework, you are encouraged to use a service to perform your widget updates if you are doing anything that might take a little longer, [...]

Layout Editor in 1.5 SDK 6

Android's layout editor  for Eclipse is much improved in the 1.5 SDK vs. the old 1.0/1.1 versions. Unfortunately, I didn't realize that until yesterday, because the new controls didn't show up for me. Instead, Eclipse just said:
Eclipse is loading framework information and the Layout library from the SDK folder.  file.xml will refresh automatically once the [...]

Android: Fix package uid mismatches 4

A while ago, I set up Apps2SD on my ADP, and while I am not sure what, I must have done something wrong, because afterwards, Android refused to boot properly, claiming that the file system permissions of pretty much all installed packages didn't match up:
Package x.y.z has mismatched uid: 10089 on disk, 10079 in settings
Here's [...]

Android: System hangs on reboot after upgrade? 2

While upgrading my G1 to the new 1.5 JF image, the system wouldn't come back up after applying the update.zip file (yes, it's normal that the first reboot takes a while, but this was too long).
adb logcat was usuable at that point, and kept looping messages like:
D/AndroidRuntime(   66): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime(   66): CheckJNI is [...]

Android: Using metric units from within code 0

When designing a layout in XML, Android supports a number of different metrics. From your Java code though, methods like setPadding or setTextSize only take absolute pixel values. It took me a while to find a solution, but apparently the (slightly too cumbersome, I feel) way to to this is through defining a Dimension Resource.
For [...]