Author Archive
Google API getFromLocationName throws IOException
by gurucoder on Nov.08, 2011, under Android, Java
If you are using the Google GPS API for Android you could encounter an IOException for “Service Not Available” , calling the method getFromLocationName() of the GeoCoder class.
This method should be able, given a location name, to retrieve an array of Address objects related to the specified string.
Sometimes the mehod works pretty good, but others the exception is thrown.
The Solution
Here there is a long discussion about the issue:
http://code.google.com/p/android/issues/detail?id=8816
On comment 21 there the workaround calling the web api directly and retrieving data using a JSON object.
Hopefully the google api for android will be fixed soon…
How to Change the Android ListView divider color
by gurucoder on Nov.08, 2011, under Android, Java
If you need to change the divider colo in an android ListView view, all you need to do is to add the following code inside the xml layout file
<ListView
android:id="@+id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:divider="#FFCC00"
android:dividerHeight="1px"/>
In this way you have applied the #FFCC00 color to the divider.
It is important to reset the divider height after changing the color or the divider will be hidden.
How to install JSON on Linux server
by gurucoder on Nov.04, 2011, under PHP
If you would use JSON to get data from your Linux Server, but you encounter this error:
Error: PHP Fatal error: Call to undefined function json_encode()
The problem is that when PHP 5.2 version supports natively json functions ( json_encode() and json_decode() ), the previous version PHP 5.0 doesn’t support JSON.
Solution 1: Install JSON on PHP 5.0
# yum install php-pear gcc # pecl install json # cd /etc/php.d # echo "extension=json.so" >> json.ini # /etc/init.d/httpd restart
Solution 2: Upgrade your PHP version to 5.2
Send Translated SMS via Skype with STranslator
by gurucoder on Jul.22, 2011, under STranslator, Ubuntu Linux, Windows
If you want to send your SMS in many different languages in a simple, fast and reliable matter, what you need is STranslator app.
One of STranslator’s key features is the capability t0 send translated SMS via Skype in the language that you want!
After selecting the destination language, when you write an SMS in YOUR language, a preview of the translated SMS is immediately shown.
STranslator is available for Windows and Ubuntu and can be easily downloaded and installed from the official website: http://www.stranslator.org
Java Preferences on Mac OS
by gurucoder on Jul.14, 2011, under Java, Mac
While on Windows the Java Preferences keys are stored inside the system registry ( regedit ), under MAC OS it is far more simple to get access to that info.
The preferences files generated by the Preferences API are named com.apple.java.util.prefs.
The user’s preferences file is stored in their home directory (~/Library/Preferences/).
The system preferences are stored in /Library/Preferences/ and are only persisted to disk if the user is an administrator.




