-->

Tag: Java

Google API getFromLocationName throws IOException

by 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…

Leave a Comment :, more...

How to Change the Android ListView divider color

by 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.

Leave a Comment :, more...

Java Preferences on Mac OS

by 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.

 

Leave a Comment :, more...

Skype-Java-Api 1.1 the new Java API for Skype

by on Jul.11, 2011, under Java

If someone wants to integrate Skype services and functionalities inside a Java program, the best Java API it’s always been Skype4Java. The problem is that the library has not been updated since 2006 and it is quite old to fully manage all the Skype features and it is not compatible with Java 64 bit installations.
BUT now the things are changed!!!
Thanks to , Skype4Java revives with a new name and version!

skype-java-api 1.1

The library starts to be a clone of the old Skype4Java, solving some bugs and adding new features and methods:

getLanguageByISOCode()

is an example that permits to get the user language returning the language ISO code and not its full name.. I think it is a really useful method!

 ( Italian -> it )

The library is compatible with Windows , Linux 64bit and MacOs but soon it will be compatible also with Linux 32bit as well.

Any reference to SWT library have been erased making this peace of software more fast and reliable.

Here it is the link for the download from Maven repo and here it is the link to the developer blog .

Leave a Comment : more...

Disabilitare rotazione Activity in Android

by on Feb.27, 2011, under Android

Quando il dispositivo viene ruotato, avviene il ricaricamento dell’ Activity correntemente visualizzata e presentata nella cosidetta modalità ”Landscape Mode” . Se la vostra Activity non risulta ottimizzata per questa modalità di visualizzazione, conviene disabilitarne il carimamento. A questo scopo, basta aggiungere la seguente istruzione nel file AndroidManifest.xml del progetto della vostra app Android:

android:screenOrientation="portrait"

Eccone un esempio:

<activity android:name=".SomeActivity" 
        android:label="@string/app_name" 
        android:screenOrientation="portrait">
1 Comment :, more...

Cerchi qualcosa?

Usa questo form per cercare argomenti in questo blog:

Non riesci a trovare quello che cerchi? Lascia un commento in un post oppure contattami per risolvere il problema!

Puoi trovarmi su Twitter come @superbre