简体   繁体   中英

How do I know if my shared library is being used?

I have written a shared library (.so) for an android emulator. It is supposed to read and write to the /dev file of a sensor device. I have an app which list the emulators sensors and prints their readings. I have pushed the sensors.goldfish.so file to the emulator through adb, so my question is how do I find out if my library is being used?

Thanks.

When you read/write to the sensor, you could also write to a text log something like "reading from sensor value %d" and "writing to sensor value %d".

Example (not tested):

FILE *f;
f = fopen("/sdcard/log.txt", "a");
if (isReading) {
    fprintf(f, "reading\n");
}
else {
    fprintf(f, "writing\n");
}
fclose(f);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM