Hello,

I am working on a GPS library which needs to interact directly with an
application.
I am not supposed to change any framework code. Hence I have managed
to implement this solution using sockets.

The GPS library creates a new detached thread on startup, which opens
up a socket.
The application also connects to the same socket on onCreate() method.

However the problem is that this setup uses a lot of resources, and I
am looking for a way to solve this problem.
I am looking for a design which will create both the client and server
sockets on application startup, and destroy the same when the
application quits.
To make this happen, I have thought of one approach:

Implement JNI in the vendor directory and create a so, that will be
loaded, and this communicates with GPS library.
When the application is launched, call a function in the library which
opens the socket, and on onDestroy() call another method, which
destroys the socket connection.

But this also suffers from resource problem since the so it is a
process in memory.

Please suggest a method to overcome this problem.

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

Reply via email to