hi all,

My intention is to let two applications communicate using DBus .

i know that DBus is already integrated into android,Dbus binaries DBus
send,DBus-monitor,DBus-daemon are already available.

i am trying to create an application which will connect to the Dbus
and start sending signals and messages over DBus . for this i have
used basic DBus API's to establish connection to the bus.

i have written native code to connect to the DBus.here is the code

static void
Java_com_example_android_simplejni_SimpleJNI_DBusConnect(JNIEnv *env,
jobject thiz) {
DBusConnection *connection;
DBusError error;
dbus_error_init(&error); /* Initialize the error structure */
connection = dbus_bus_get(DBUS_BUS_SESSION,&error); /* Or
DBUS_BUS_SYSTEM */
if ( dbus_error_is_set(&error) )
{
LOGI("Error connecting to the daemon bus");
dbus_error_free(&error);
}
LOGI("Dbus connected");
}

i included the above module into the android repo(android build
system) and compiled it .i got the native library
libsimplejni.so .i copied this into the libs/armeabi/ folder and ran
the application from eclipse.

i am not able to see the output ,i get the following messages when i
see the logcat .

Starting activity: Intent { action=android.intent.action.MAIN
categories={android.intent.category.LAUNCHER} flags=0x10000000
comp={com.MultPkg/com.MultPkg.Mult} }
D/AndroidRuntime( 1386): Shutting down VM
D/dalvikvm( 1386): DestroyJavaVM waiting for non-daemon threads to
exit
D/dalvikvm( 1386): DestroyJavaVM shutting VM down
D/dalvikvm( 1386): HeapWorker thread shutting down
D/dalvikvm( 1386): HeapWorker thread has shut down
D/jdwp    ( 1386): JDWP shutting down net...
D/jdwp    ( 1386): +++ peer disconnected
I/dalvikvm( 1386): Debugger has detached; object registry had 1
entries
D/dalvikvm( 1386): VM cleaning up
I/ActivityManager(  578): Start proc com.MultPkg for activity
com.MultPkg/.Mult: pid=1392 uid=10025 gids={}
D/dalvikvm( 1386): LinearAlloc 0x0 used 639228 of 4194304 (15%)
I/jdwp    ( 1392): received file descriptor 20 from ADB
W/System.err( 1392): Can't dispatch DDM chunk 4d505251: no handler
defined
I/JNI     ( 1392): Trying to load libMult.so
D/dalvikvm( 1392): Trying to load lib /data/data/com.MultPkg/lib/
libMult.so 0x435bc6a0
D/dalvikvm( 1392): Added shared lib /data/data/com.MultPkg/lib/
libMult.so 0x435bc6a0
D/libc-abort( 1392): abort() called in pid 1392
I/DEBUG   (  551): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG   (  551): Build fingerprint: 'generic/generic/generic/:1.5/
CUPCAKE/eng.root.20101026.172257:eng/test-keys'
I/DEBUG   (  551): pid: 1392, tid: 1392  >>> com.MultPkg <<<
I/DEBUG   (  551): signal 11 (SIGSEGV), fault addr deadbaad
I/DEBUG   (  551):  r0 00000003  r1 deadbaad  r2 00000027  r3 ffff6150
I/DEBUG   (  551):  r4 ffff6128  r5 afe2fef8  r6 afe39dd0  r7 be9ab360
I/DEBUG   (  551):  r8 be9ab550  r9 41049d24  10 41049d10  fp 00000000
I/DEBUG   (  551):  ip 0000001b  sp be9ab2c8  lr afe1ff33  pc
afe1066a  cpsr 20000030
I/DEBUG   (  551):          #00  pc 0001066a  /system/lib/libc.so
I/DEBUG   (  551):          #01  pc 00032a42  /system/lib/libdbus.so
I/DEBUG   (  551):          #02  pc 00017ce8  /system/lib/libdbus.so
I/DEBUG   (  551):          #03  pc 00017d48  /system/lib/libdbus.so
I/DEBUG   (  551):          #04  pc 000310e4  /system/lib/libdbus.so
I/DEBUG   (  551):          #05  pc 0003562c  /system/lib/libdbus.so
I/DEBUG   (  551):          #06  pc 00035726  /system/lib/libdbus.so
I/DEBUG   (  551):          #07  pc 000353f4  /system/lib/libdbus.so
I/DEBUG   (  551):          #08  pc 00012e02  /system/lib/libdbus.so
I/DEBUG   (  551):          #09  pc 0001531a  /system/lib/libdbus.so
I/DEBUG   (  551):          #10  pc 0001563a  /system/lib/libdbus.so
I/DEBUG   (  551):          #11  pc 0000ead2  /system/lib/libdbus.so
I/DEBUG   (  551):          #12  pc 0000ec1c  /system/lib/libdbus.so
I/DEBUG   (  551):          #13  pc 000005b4  /data/data/com.MultPkg/
lib/libMult.so
I/DEBUG   (  551):          #14  pc 0000e3b4  /system/lib/libdvm.so
I/DEBUG   (  551):          #15  pc 00040a8a  /system/lib/libdvm.so
I/DEBUG   (  551):          #16  pc 00013118  /system/lib/libdvm.so
I/DEBUG   (  551):          #17  pc 00017b1c  /system/lib/libdvm.so
I/DEBUG   (  551):          #18  pc 00017560  /system/lib/libdvm.so
I/DEBUG   (  551):          #19  pc 00052268  /system/lib/libdvm.so
I/DEBUG   (  551):          #20  pc 000596ee  /system/lib/libdvm.so
I/DEBUG   (  551):          #21  pc 00013118  /system/lib/libdvm.so
I/DEBUG   (  551):          #22  pc 00017b1c  /system/lib/libdvm.so
I/DEBUG   (  551):          #23  pc 00017560  /system/lib/libdvm.so
I/DEBUG   (  551):          #24  pc 000520ec  /system/lib/libdvm.so
I/DEBUG   (  551):          #25  pc 0003f0f8  /system/lib/libdvm.so
I/DEBUG   (  551):          #26  pc 00031ac2  /system/lib/libdvm.so
I/DEBUG   (  551):          #27  pc 00028280  /system/lib/
libandroid_runtime.so
I/DEBUG   (  551):          #28  pc 00028d7e  /system/lib/
libandroid_runtime.so
I/DEBUG   (  551):          #29  pc 00008bf2  /system/bin/app_process
I/DEBUG   (  551):          #30  pc 0001fd22  /system/lib/libc.so
I/DEBUG   (  551):          #31  pc 0000bcb2  /system/lib/libc.so
I/DEBUG   (  551): stack:
I/DEBUG   (  551):     be9ab288  afe39f90
I/DEBUG   (  551):     be9ab28c  afe148a5  /system/lib/libc.so
I/DEBUG   (  551):     be9ab290  afe39f90
I/DEBUG   (  551):     be9ab294  afe39fe4
I/DEBUG   (  551):     be9ab298  00000000
I/DEBUG   (  551):     be9ab29c  afe13e4d  /system/lib/libc.so
I/DEBUG   (  551):     be9ab2a0  ae843e70  /system/lib/libdbus.so
I/DEBUG   (  551):     be9ab2a4  d1492754
I/DEBUG   (  551):     be9ab2a8  be9ab320  [stack]
I/DEBUG   (  551):     be9ab2ac  ffff6128
I/DEBUG   (  551):     be9ab2b0  afe2fef8  /system/lib/libc.so
I/DEBUG   (  551):     be9ab2b4  afe39dd0
I/DEBUG   (  551):     be9ab2b8  be9ab360  [stack]
I/DEBUG   (  551):     be9ab2bc  afe10663  /system/lib/libc.so
I/DEBUG   (  551):     be9ab2c0  df002777
I/DEBUG   (  551):     be9ab2c4  e3a070ad
I/DEBUG   (  551): #00 be9ab2c8  afe39f90
I/DEBUG   (  551):     be9ab2cc  ae84965c
I/DEBUG   (  551):     be9ab2d0  be9ab360  [stack]
I/DEBUG   (  551):     be9ab2d4  afe17b57  /system/lib/libc.so
I/DEBUG   (  551):     be9ab2d8  ae843e70  /system/lib/libdbus.so
I/DEBUG   (  551):     be9ab2dc  fffffbdf
I/DEBUG   (  551):     be9ab2e0  ae8493b4
I/DEBUG   (  551):     be9ab2e4  afe39f90
I/DEBUG   (  551):     be9ab2e8  ae84965c
I/DEBUG   (  551):     be9ab2ec  ae832a47  /system/lib/libdbus.so
I/DEBUG   (  551): #01 be9ab2f0  ae8493b4
I/DEBUG   (  551):     be9ab2f4  ae817ced  /system/lib/libdbus.so
I/ActivityManager(  578): Process com.MultPkg (pid 1392) has died.
D/Zygote  (  553): Process 1392 terminated by signal (11)


can anyone tell me whats going wrong ,why its not able to connect to
the Bus.i am including libdus.so shared library in the makefile,so
there shouldn't be any problem in acessing the DBus methods like
dbus_bus_get(DBUS_BUS_SESSION,&error).

pleas help me out,this has consumed lot of my time.

thanks
siva

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to