Here is an example of how to build a shared library:

http://android.git.kernel.org/?p=platform/external/zlib.git;a=blob;f=Android.mk;hb=HEAD

This is the makefile for zlib, which builds both a shared library and
an executable program.

Here is an example of a BoardConfig.mk file (for the Dream build in master):

http://android.git.kernel.org/?p=platform/vendor/htc/dream.git;a=blob;f=BoardConfig.mk;hb=HEAD

Notice how it specifies which libraries to use to implement the GPS
API.  Whatever target you are building for should probably have a
"vendor" directory of files similar to those in the vendor/htc/dream
or vendor/asus/eee_701.

Mike

On Sun, Mar 15, 2009 at 1:45 AM, Daliang Luo <luodali...@gmail.com> wrote:
> Hi Mike,
>
> How to build a shared library on android? I am not sure as I am not familiar
> with this and it seems not the same with I build before. And  is the
>  BoardConfig.mk you refer to in the directory of /libhardware/gps/?  Or
> somewhere? Thanks again.
>
> 2009/3/15 Mike Lockwood <lockw...@android.com>
>>
>> On Sat, Mar 14, 2009 at 4:32 AM, Nio <luodali...@gmail.com> wrote:
>> >
>> > Hi all,
>> >
>> > Is there any possibilities to call Ril interface from Location Manager
>> > or any other service?
>> >
>> > I'm trying send AT commands to start or control GPS and AGPS via Ril.
>> > And this should be called by Location Manager service. Dose it
>> > possible?
>>
>> Hi Nio,
>>
>> No, you should not modify the location manager to integrate with your
>> GPS.  Instead you should write a shared library in C named libgps.so
>> that implements the interface defined in gps.h.
>>
>> You can look at the file hardware/libhardware_legacy/gps/gps_qemu.c
>> (the implementation for the emulator) as an example of how to do this.
>>
>> Then in your BoardConfig.mk, add:
>>
>> BOARD_GPS_LIBRARIES := libgps
>>
>> to tell the build system to use your library rather than the stubbed
>> out implementation of the GPS API.
>>
>> Mike
>>
>> --
>> Mike Lockwood
>> Google android team
>>
>>
>
>
> >
>



-- 
Mike Lockwood
Google android team

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to