android-non-transparent

Enable hardware keyboard on Android emulator

Posted in Java | Leave a comment

I thought it was possible in previous version, but it appears that now it is not possible to use the physical hardware keyboard of a computer in an Android emulator… Hopefully, this is just a small configuration to edit!

  • Open the AVD Manager: in Eclipse > AVD Manager
  • Select the particular AVD, or create a new one, and click on Edit
  • Go to the « Hardware » section, click on « New ».
  • Select the Property: « Keyboard Support », and change its value to « yes » (it is « no » by default)
  • That’s it! You can start your emulator and use your physical keyboard.

AVD Manager

More information

Logo Virgo

Virgo OSGi and command line

Posted in OSGi | Leave a comment

I already wrote about Virgo, a complete OSGi stack, based on Equinox and easily integrable on Eclipse (eh, it is done for that). Yes, it is possible to launch and manage our Virgo server using Eclipse (read: Let’s work OSGi Virgo on Eclipse), but if you try to launch a big project like Societies, you might may soon be blocked by an ugly Java « Out of memory ». This is because Eclipse is heavily using the Java memory, and if you launch your OSGi server using Eclipse, you increase again this memory usage.
So, what is the solution? It’s easy: don’t launch Virgo using Eclipse, launch it with command line. So, the server will have its own memory cluster. Lets do this.
Continue reading

How to clear Cygwin screen in Windows?

Posted in Geekeries | Leave a comment

How to « clean » our Cygwin window? Not that obvious because the « clean » command doesn’t exist in Cygwin. Anyway, the solution is simple and usefull: CTRL+L. Hum… wait? :-)
Found thanks to Mahbubur Rahman: » How to clear CYGWIN screen in Windows? Mahbubur Rahman – jQuery, PHP, JavaScript, Codeigniter, CSS.

Logo Eclipse

Automatically generate PHP get and set using Eclipse

Posted in PHP | Leave a comment

How to automatically generate PHP getter and setter using Eclipse? There are several possibilities, and no perfect one, but let’s try to list them all:

  • Using Eclipse templates: semi-automatic
    Window > Preferences > PHP > Editor > Templates -> New and use something like this:

    private $$${PropertyName};
    ${cursor}    
    public function get${PropertyName}() 
    {
      return $$this->${PropertyName};
    }
    
    public function set${PropertyName}($$value) 
    {
      $$this->${PropertyName} = $$value;
    }
    

    And then, to use this template type its name and press ctrl+space to generate this code. A context menu should also automatically appear when you type the name.

  • Use the Eclipse PDT plugin E-Surf: automatic, useful but not very clean and their is no way to configure it.
  • Use the Eclipse PDT PHPClassGenerator plugin by IBM to generate automatically classes and accessors: automatic but maybe to complex to configure and use. And it can’t generate getters / setters for attributes that have been added after the class creation.

If you don’t know yet how to install an Eclipse plugin: Let’s work OSGi Virgo on Eclipse (fr).

Humpf… At the moment, their is no perfect solution, and it is a shame! In Java, a simple right clic on a class > Source > Generate get/set or Generate toString… That is why developing in PHP on Eclipse is not yet as easy as developing in Java.

How to Make Your Laptop Choose a Wired Connection Instead of Wireless – How-To Geek

Posted in Geekeries | Leave a comment

Very useful tip for me: How to Make Your Laptop Choose a Wired Connection Instead of Wireless – How-To Geek. In my office, the Wifi connection can’t access the intranet, but the wired one can! Now I will be able to keep my Wifi ON :-)

Maven Error « Could not find Launcher »

Posted in Java | Leave a comment

If you have the following error when launching a Maven command, for example « mvn install »:

Could not find the main class: org.codehaus.plexus.classworlds.launcher.Launcher

Your are probably using a Maven 2 configuration for a Maven 3 usage. Delete your global variable M2_HOME and it should work. You can use M3_HOME instead to select the folder for the « repository » of dependencies, and the emplacement of the configuration file settings.xml.

Logo PhoneGap

PhoneGap Plugin System

Posted in HTML et CSS | Leave a comment

Overall Architecture

I have already presented PhoneGap, my goal here is to present its plugin system. Indeed, to enlarge web application possibilities, it may be useful to use native calls through Javascript. For example, to use a piece of complex Android code (Java code) easily in Javascript. This is possible using the PhoneGap plugin system.
The overall architecture of these plugins is the following:

  • a native component making the job, for example a Java Android file
  • a HTML / CSS / Javascript GUI using this native component through Javascript calls
  • a bridge between Javascript and the native code to create the link.

This bridge is composed of:

  • one native file (i.e. one Java file),
  • one Javascript file exposing this native component,
  • and generally one quick configuration file specific to the platform.

Continue reading

Problèmes de mémoire ?

Maven OutOfMemoryError

Posted in Java | Leave a comment

Maven Error

Maven failed during a build whit the following error:

The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: PermGen space

Solution

Add the environment variable MAVEN_OPTS: -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m

Logo PhoneGap

PhoneGap: first overview

Posted in HTML et CSS | 1 Comment

PhoneGap is a platform for building mobile application using Web technologies: HTML, CSS and Javascript. Mobile platforms like Android, iPhone or Blackberry are not ready yet to manage such application, that is why PhoneGap is filling in the gap by providing a plugin system to use native call through Javascript.
This is very interesting platform because there is a global movement between Web technologies interacting with mobile, smartphone, … You know: HTML5, CSS3, Boot 2 Gecko (see also: B2G Wiki), Apache Cordova, SOCIETIES project, …


Continue reading

Raspberry PI: more than a cheap little computer under GNU Linux

Posted in Geekeries | Leave a comment

Did you know Raspberry PI? You have to! Raspberry PI, oh yeah :-)