[Q] Issue using custom SDK for application development - Android Q&A, Help & Troubleshooting

Hi,
I have built a custom SDK (modifying SDK 23) and set its build version (API) to 50 (So as not to clash with the existing ones). I want to use custom libraries of this SDK in my Android Studio Application. For this purpose I want to compile the application against the SDK version 50(compileSdkVersion=50).
But when I change compileSdkVersion to 50, it gives dependency errors. The support libraries, needed by application, are not generated along with Sdk generation.
Need help regarding using this custom SDK in android application.

Related

[Q] AOSP and Android SDK

How does the AOSP and the Android SDK relate?
If I repo the AOSP do I by default now have the SDK?
Do I have to download it separately?
Or can I/Should I compile it from the AOSP?
I ask because after following the instructions up until: source.android.com/source/building.html. I successfully compiled full-eng and ran the emulator and everything works just fine. It also seems like adb is installed which from what I understand is a part of the SDK. I can't seem to find an answer to this.
So I am going to do my best at answering my own questions and posting for the benefit of anyone else who may be confused; if any of the statements I make are wrong feel free to correct me. This is just from my experience. There seems to be little information regarding how the two relate excepting the build/core/build-system.html, and sdk/docs/howto_build_SDK.txt included with AOSP and airtower.wordpress.com/2010/07/25/building-the-android-sdk/ and of course, trial and error.
NB: jindroid.com/2009/06/08/howto-build-sdk-from-android-source-code/ points to documentation that has since moved to the above location it seems. At least it wasn't there for me as of the most recent repo sync against master.
rpowell8 said:
How does the AOSP and the Android SDK relate?
Click to expand...
Click to collapse
The android SDK is a subset of the ADT (Android Developer Toolkit). The SDK as you download it today is basically just a few binarys for getting the actual content SDK.
I think the best way to describe the SDK is that it is divided into to parts tools, and libraries. The tools are for managing the sdk (tools/android) and misc tools to build apk's, align them, emulate an api etc, and then there are the tools in platform-tools which allow you to perform operations on your device (adb fastboot etc). The "libraries" are a set of API's , system images (file for running an android virtual device (emulator)), and documentation for each release of Android. These seem to reside under platform/
You can either download the above components from the command line, or from eclipse. Eclipse is actually included in the ADT as well with the plugin for android apps preloaded. If you don't have the plugin, you can get it vie Help/Install New Software. This launches what seems to be a front end for the android SDK Manager which allows you to graphically choose which platforms you want to support and emulate.
Now, how does the SDK (the tools and libraries) relate to the AOSP as you repo init/sync from the master repository? It seems you can't build apps from the code downloaded from the AOSP git repo (I'm not sure about this but doesn't seem like it). Instead, what you do, is you use the AOSP to build the SDK (NB: when you use the SDK Manager as mentioned above, you are getting prebuild SDKs, if you want to build the SDK yourself you use the AOSP code) as described in the above mentioned howto. Once the build for the Android SDK is complete it is located in out/host/linux-x86/sdk or similar directory. You can actually point the eclipse plugin to this directory as the location for the SDK...but I recommend using the .zip file that is in that directory and putting it somewhere other than the out directory. Reason being if you decide to do a lunch full-eng after you did the lunch sdk-eng, and then proceed to make, it will force a make cleaninstall and that will basically do a rm -rf on the out directory, deleting all of your SDK and any other platforms you downloaded through the sdk manager.
After you've built the sdk, you now have the necessary tools and API's to build for the platform you repo'd. A word of warning is that it seems if you repo the master branch, it is labeled as "AOSP" for the version indicating to Eclipse that the minimum platform required is the one you just built and so if you want to run it on your device you'll need the full platform loaded onto it or it will show you are running a version earlier than AOSP (also called 'Preview'). Example, as of this writing the version of AOSP is 4.2.1 and the API level is 17 (An API level is just a set of functions/datastructures available for a particular release of Android OS, so for Level 17 it corresponds to 4.2, You can use a higher API than your target (accept in the case of AOSP Preview) and still make sure you are compatible, but you can't use a lower API and expect to have functions/datastructures that were only implemented in later versions of Android). If you have downloaded the Android SDK for API level 17 it will be 4.2, not 4.2.1. You will not be able to run your app that you built using the API level 17 "Preview" based on 4.2.1...on your 4.2 emulator (or device for that matter). You will need to use the emulator based on the AOSP Preview build.
So in short the AOSP contains the sources to build the SDK, but you can also get prebuilt SDK's if you don't want to go through and build each API level.
rpowell8 said:
If I repo the AOSP do I by default now have the SDK?
Click to expand...
Click to collapse
No, you have the components to /build/ the SDK
rpowell8 said:
Do I have to download it separately?
Click to expand...
Click to collapse
No, you can either build it from the AOSP, or you can download it separately.
rpowell8 said:
Or can I/Should I compile it from the AOSP?
Click to expand...
Click to collapse
Probably should if you're building against the latest android development, but I don't see the need if you are building apps for already released API levels.

[Q] Selecting a platform in Android NDK

Among the platforms available in Android NDK, e,g. android-3, android-17, android-19 etc, how do I select a specific one while building the application?

[Q] Editing Android Kernel - HCE/NFC

I'm currently in the process of creating a custom version of AOSP that will edit the functionality of the Host-Card Emulation feature of Android, allowing me to manually set the AID produced when my device goes into emulation mode.
I've downloaded the Android source, and have located the files I think governs HCE functionality.
From the NFC System Service, I've located the following files:
"CardEmulationManager.java" and "HostEmulationManager.java" located in "/aosp/packages/apps/Nfc/src/com/android/nfc/cardemulation/"
And from the Android core framework, for the NFC API I have found:
"CardEmulation.java" located at "/frameworks/base/core/java/android/nfc/cardemulation/CardEmulation.java"
From here, i'm unsure how to get started in editing the code. I'm unsure of the interactions between the files, and how they are called at run (I.e. which functions in the file I should be looking at, how would I go about adding my own code/modifying existing code in the file)
Is there any documentation online about how these files work/are ran? Or how would I go about finding out on my own (Through debugger tools etc.)
I'm currently using Eclipse for Ubuntu, and will be developing for a Nexus 7

Request for android.jar library

I need the android.jar library provided in the android-sdk. But I don't want to download the whole android-sdk as I am not a developer and I don't need the whole package. So, If any of you reading this have the android-sdk downloaded in their computer, please upload the android.jar library. I would want the library of the latest API (Android 6, API 23) but if you have the library of lower version you can still provide it.
Thank you.

Help - How to build Android SDK

Hi,
I need to edit some java class files in Android SDK (Target: API 23) because i want to create custom feature for my app.
Do someone know how i can rebuild SDK?
Thanks

Categories

Resources