5

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!

Luca Carlon
  • 9,546
  • 13
  • 59
  • 91

2 Answers2

3

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.

Sogartar
  • 2,035
  • 2
  • 19
  • 35
Luca Carlon
  • 9,546
  • 13
  • 59
  • 91
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.

Cheryl Simon
  • 46,552
  • 15
  • 93
  • 82
  • 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! – Luca Carlon Jan 18 '11 at 20:36
  • 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.. – Cheryl Simon Jan 18 '11 at 21:10
  • 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). – Luca Carlon Jan 18 '11 at 22:40