6

I know that some methods and some classes that are implemented in Android are not exported to the Android public SDK. I've been able to create an application that uses some of these functions by compiling my application placing it inside the Android tree. Would it be possible to export these functions to the Android SDK by recompiling it from the sources? How can this be done? Can I include custom classes and functions in the Android SDK as well (supposing of course I create a new SDK and a new firmware)? Thanks!

2 Answers 2

4

I didn't try it, but this should be the answer to my question: https://android.googlesource.com/platform/sdk/+/master/docs/howto_build_SDK.txt.

Sign up to request clarification or add additional context in comments.

Comments

1

It is possible to download the SDK and make changes to it.

If you are releasing a public app, you should not use any non-public API's as there are no guarantees they will be available on all phones, or in future versions of OS.

3 Comments

I am developing for a firmware I am compiling, so I have control over this. But anyway, as far as I know the SDK sources are inside the same tree of the Android system sources. It is possible to compile with a mm sdk. And in fact I can do this. I compiled my own SDK. But, how do I make changes to it? What classes does it compile? The same that are compiled when compiling the system? But then, how is it possible that some APIs are not exported to the SDK if the source files are the same? I'm able to make changes to the system and compile my own, but how to do this to the SDK instead? Thanks!
I'm not sure what you mean by "not exported to the SDK". Can you give an example? I think the most they do is mark them hidden so they don't appear in the docs, but you can still access them..
Well, I've seen this some times in the past. Now I remember two examples: the class FileUtils, android.os.FileUtils, is used by an application like the MediaProvider, but I can't find documentation for it nor I can use that class in an Android project in Eclipse. Another example is I would like to be able to add the possibility to install packages (with the method installPackage) to the SDK. This can be done by the PackageManager application as it is compiled in the system but it is not possible with the default SDK (for security reasons that don't apply to me that I'm creating the firmware).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.