简体   繁体   中英

Where is the Android jar library?

As an academic exercise, I'm following this to build an Android app from the command line using just the android sdk.

I was wondering where in the Android SDK I could find the Android library to javac against? Otherwise, javac doesn't know where to find, for instance, android.app.Activity . I think dx needs the library too right?

As an academic exercise, I'm following this to build an Android app from the command line using just the android sdk.

That blog post is from 2009. At the time of this writing, it is 2015. The build process has substantially changed since 2009.

I was wondering where in the Android SDK I could find the Android library to javac against?

$ANDROID_SDK/platforms/platform-NNN , where $ANDROID_SDK is wherever you have the Android SDK installed and NNN is an API level (eg, 21). In there, you will find an android.jar file that contains the mocks of the Android SDK API that we compile against.

I looked at the docs on the Android page for creating a project through cli, but it would generate an Ant project?

I have heard that you can have a -g switch to generate Gradle build files instead of Ant, but I haven't ever used it. Personally, I would just copy the Gradle build files from a known-working project and modify them to suit.

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