开发者

What are the steps to take in order to build Android AOSP/CyanogenMod after adding a new file

Say I want to add a CustomizedAlarmManagerService class on top of what is already there in AOSP or CyanogenMod, and put it into a new package 'com.myandroid.server'.

What are the steps I need to take in order for the build to be successful?

Currently if I just add the file, reference the class somewhere, and build the whole project, I will get error "Package (com.myandroid.server) does not exist开发者_开发问答".

Thanks!


Check the appropriate Android.mk file and add your new file to the list of sources.


Since I lasted asked the question, there are now quite a lot of docs online detailing how Android Build system works.

For example, a blog post like this explains things pretty well.

Yes it has something to do with Android.mk file, but no, it's not just adding the files.

Basically for any new module you are creating, you need to create a new Android.mk file, give it a module name (by setting LOCAL_MODULE), then make sure places where this module is referenced has their respective Android.mk files include the pointer to the module (e.g. setting LOCAL_STATIC_LIBRARIES).

Oh, and remember the build orders in Android.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜