[maemo-developers] profile functions ran on emulator does not ran on device!

From: mohamed ismael mohamed.ismael at asgatech.com
Date: Tue Nov 17 11:44:00 EET 2009
Dear Sir;

I am trying to create a simple Application to change the current phone 
profile to silent.
I installed the libprofile-dev package from nokia binaries repository,
found the documentation in the file : /<scratchbox 
target>/usr/include/profiled/libprofile.h (both targets : X86 and ARMEL)

/** \brief Get name of the current profile
 * Get name of the currently active profile.
 * @returns profile name, NULL on error
char         *profile_get_profile  (void);

/** \brief Set the active profile
 * Set currently active  profil.
 * @param profile profile name
 * @returns 0 on success, -1 on error
int           profile_set_profile  (const char *profile);

So, I used them to write the following application:

#include <hildon/hildon.h>
#include <libprofile.h>
int main(int argc, char *argv[]) {
       char * profile =  profile_get_profile();
        printf("profile does not exist");

    int state =profile_set_profile("silent");
    if(state == 0)
        printf("profile set successfully");
        printf("there is an error");
    return 0;

the application ran perfectly on the Emulator (it viewed the current 
profile and changed it to silent), But when creating a debian package 
out of it (using ESBOX : 'Build debian package' command) and trying the 
package on the phone; I found the following:

    the application works but it can't get the current profile neither
    change it to silent.
    it prints : "profile does not exist" and then "there is an error".

Although I installed the libprofile-dev package ON the phone - from the 
nokia binaries repository- and made sure that the libprofile.so file 
exists inside the phone's '/usr/lib/' dierctory. But nothing seems to work

where is the problem?? Can you help me to find the solution?

More information about the maemo-developers mailing list