Making Custom SDK and Integrating Car API/Vehicle Services -Android N(7.1.1)

2,320 views
Skip to first unread message

Renjith Rajagopal

unread,
Jul 17, 2017, 10:41:13 AM7/17/17
to android-porting
Hi,
I'm a newbie to Android AOSP.
I was trying to utilize the Car API/Services/HAL provided by Google from Android N version onwards(https://source.android.com/devices/automotive/).
My aim is to develop App that uses this Car API.Android N Standard SDK that was downloaded as a part of Android Studio doesn't include those APIs mentioned in link.
I verified it by try importing packages(import android.car ....)..But  Car package was not listing at all.I tried building a custom SDK

Steps I followed :
1. Downloaded Google AOSP-Android N from git.
2. Verify the existence of those Car services/API are located in /home/symbio/myandroid/packages/services/Car
3. Builded SDK with commands in order :
            1  . build/envsetup.sh
            2. lunch sdk-eng
            3.mm/mma /packages/services/Car
            4.make sdk

But even I couldn't find or do importing those Car services in newly builded SDK.
I'm kind of stuck.Which all makefile Shall I need to change so as to reflect the same ?
Any lead will be highly appreciated. 

Thanks in Advance!!!

sky...@gmail.com

unread,
Feb 24, 2018, 1:49:34 PM2/24/18
to android-porting
Hi,

I‘m facing exactly the same problem. Any progress ok this?

cmccl...@pillartechnology.com

unread,
Feb 28, 2018, 12:09:14 PM2/28/18
to android-porting
You have to include the following line in your product makefile.

$(call inherit-product, packages/services/Car/car_product/build/car.mk)


This will include all of the default (emulated) services and demo applications.

You'll probably also need to set SELinux to permissive in your BoardConfig.mk in order to get started.

BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive

Then follow the instructions here to add an SELinux domain for the vehicle hardware service.
Don't forget to modify the file_context.

That should be enough to get going.
I can't remember with 100% certainty, but I believe the car.mk file will copy the service.rc file to the device for you.
If the service isn't starting, make sure it's there.

Eric Williams

unread,
Mar 19, 2018, 1:09:39 PM3/19/18
to android-porting
I'm having same issue but this answer did not work for creating SDK with Car API added. Did it work for anyone else?

Christopher McClellan

unread,
Apr 13, 2018, 12:15:42 PM4/13/18
to android-porting
The Car API's aren't part of the SDK, even if you build the SDK yourself.
You can copy the jar from the intermediates directory of the output to your Android Studio project though.

cp out/target/common/obj/JAVA_LIBRARIES/android.support.car_intermediates/classes.jar ~/car-support-lib.jar

a.m.m...@gmail.com

unread,
Jul 3, 2018, 10:43:44 AM7/3/18
to android-porting
Hello Christopher,
do you know if it is possible to add  car-support-lib.jar directly to the SDK modifying for example the file ./development/build/sdk.atree? 

Maybe adding a line like the one for the main android.jar...

# Main Public API jar
${OUT_DIR}/target/common/obj/PACKAGING/android_jar_intermediates/android.jar                  platforms/${PLATFORM_NAME}/android.jar


BR,
Alessio

Bao Zhu

unread,
Jan 3, 2019, 11:42:56 AM1/3/19
to android-porting
Hi Christopher,

car-support-lib.jar is necessary.
However, How about the resource packages something like themes.xml and styles.xml and so on?

Would you please share a manual or guidance for us to integrate car features into android studio SDKs? 

Thanks in advance.
Hope your reply.

Bao

在 2018年4月14日星期六 UTC+8上午12:15:42,Christopher McClellan写道:

Sorin Steflea

unread,
Nov 1, 2019, 12:25:43 PM11/1/19
to android-porting
Hello,

Did you find a solution for this problem?
I am facing the same problem.

Regards,
Sorin
Reply all
Reply to author
Forward
0 new messages