Force Locale on Android

by adrian vintu 1/14/2010 8:51:00 PM
While playing with localization on the Android for my app I came upon an annoying bug.
It seems running on Motorola Milestone the fonts were getting smaller on each locale update.

I use the following code for locale changing (from http://almondmendoza.com/2009/01/28/force-localize-an-application-on-android/):
String languageToLoad  = "de";
Locale locale = new Locale(languageToLoad);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config, null);
Also in the AndroidManifest.xml I have (without this entry you get "Something wrong here, didn't expect "mypackagename" to be resumed"):
<activity
  android:label="@string/app_name"
  android:name=".Dex"
  android:configChanges="locale">
Here is how my screen should look like:



And here is how it was looking on Motorola Milestone.



After changing the Locale from Preferences the fonts keep gettting smaller and smaller



This was very annoying. I did not know exactly why this was happening.
More...

Comparison of Android vs IPhone

by adrian vintu 1/14/2010 7:22:00 PM
Today I made a comparison of Android vs IPhone. I made the list together with an IPhone enthusiast. The results were surprising for both of us. If fact, they were so surprising that the IPhone user is now inclined to go for the Android on the next phone purchase.
Here is the comparison of Android vs IPhone.

Pros for Android
  1. SMS delivery report - for the IPhone you need a third party apparently
  2. notifications without INTERNET - one of the biggest drawback of the IPhone is that you cannot have notifications without Internet -> the notifications are stored on the Apple servers
  3. can install applications from any site - IPhone applications can only be installed from the Apple store (unless the phone is jail broken)
  4. multiple physical menu buttons - used for navigation and quick shortcuts, allows greater screen size (no more software menus)
  5. physical menu button allows recent 6 tasks (like ALT+TAB in Windows) - absolutely useful
  6. the Home screen is organized in 3, 4 or 5 virtual screens, the rest of the applications lie in a list - usability, quick to access most used apps - on the IPhone there are "limitless" virtual screens on Home
  7. can install on the Home screen - widgets, shortcuts, folders
  8. physical keyboard - on some models
  9. open source OS
  10. can install different/homebrewed firmwares
  11. can install home brewed apps
  12. background apps/ multitasking
  13. can make own application to hook into anything - calling, traffic, media, encryption, etc
  14. dev SDK is free and cross platform. IPhone is for $100+ and only works on MAC.
  15. programming is done in Java, bridges exist from J2ME, C#, etc. IPhone uses Objective C
  16. programming - can run interpreters. IPhone only allows running Objective C byte code
  17. easy access to the SD card (both from computer and from the phone). can copy MP3s, read ebooks, etc
  18. cheaper than the IPhone
  19. easy removable/replaceable battery.
  20. 5 mega pixel camera + blitz/flash
Pros for IPhone
  1. screen brightness/clarity
  2. bigger sofware keyboard - because of the wider screen
  3. great 3D apps and harware
  4. easy data synchronization
  5. proximity sensor - saves battery and "locks" the screen
  6. zoom using two fingers - pictures, browser, etc - though some Android phones also support multi touch

EDIT: An update comparison of Android vs iPhone vs Nokia vs BlackBerry vs Windows Mobile 7 is avalilable here http://adrianvintu.com/blogengine/post/Comparison-of-Android-vs-IPhone-vs-Nokia-vs-BlackBerry-vs-Windows-Mobile-7.aspx

About Adrian Vintu

Adrian Vintu I am a computer software professional lately designing and programming .NET and Android applications.
Send mail

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008 - 2013

Sign in