70603

Android source referencing missing classes

Question:

I cloned some of the trees from the Android Open Source Project to take a look at the code, but I can't build them because they reference classes which don't seem to exist.

For instance, the music application <a href="http://android.git.kernel.org/?p=platform/packages/apps/Music.git;a=blob;f=src/com/android/music/AlbumBrowserActivity.java;h=ba3e2127606f310f61b1f32fe2d01656cd81a57e;hb=master" rel="nofollow">here</a> references android.media.MediaFile which according to the <a href="http://developer.android.com/reference/android/media/package-summary.html" rel="nofollow">package summary</a> does not exist, as well as things like ArrayListCursor which has an old <a href="http://www.androidjavadoc.com/m5-rc15/android/database/ArrayListCursor.html" rel="nofollow">javadoc</a> around but is <a href="http://developer.android.com/reference/android/database/AbstractCursor.html" rel="nofollow">absent in current documentation</a>.

So is the open source project disjoint from the released SDK? Also, is there a way to build these open source packages with the current SDK?

Thanks,

-JQP

Answer1:

<blockquote>

So is the open source project disjoint from the released SDK?

</blockquote>

The stock Android applications have nothing whatsoever to do with the SDK. Most were written before the SDK existed.

So, for example, there is an <a href="http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/media/java/android/media/MediaFile.java&q=package:android%20MediaFile&sa=N&cd=1&ct=rc" rel="nofollow">android.media.MediaFile</a> class, and an <a href="http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/com/android/internal/database/ArrayListCursor.java&q=package:android%20ArrayListCursor&sa=N&cd=1&ct=rc" rel="nofollow">ArrayListCursor</a> class. They are not part of the SDK, but you can find the source for them quickly using <a href="http://www.google.com/codesearch?hl=en" rel="nofollow">Google Code Search</a> and the package:android qualifier.

<blockquote>

Also, is there a way to build these open source packages with the current SDK?

</blockquote>

If by "open source packages" you mean applications, then generally no, they cannot be built using the SDK. Someday, perhaps they can be, but not without substantial work in some cases.

Recommend

  • jOOQ - INSERT INTO … SELECT … RETURNING
  • how to play a mp3 file from the middle
  • How can I pause an MP3 file using C#?
  • NumberFormat problem
  • How to get style in Elm
  • django admin - how to display thumbnail instead of path to file
  • BackgroundMediaPlayer set Uri source of Media library item
  • ResponseBuilder is not working when used with entity object
  • Is it possible to control programs with Javascript?
  • Pointer vs Reference difference when passing Eigen objects as arguments
  • LNK1104: cannot open file 'kernel32.lib'
  • Can my PDF ping my server when it is opened?
  • Pycharm: Marking a folder as 'sources root' is not recursive for subfolders
  • Updating both a ConcurrentHashMap and an AtomicInteger safely
  • where do I find the xml.dom python package for the python-2.6.0-8.9.28 and I have a suse/x86_64 vers
  • Make new pandas columns based on pipe-delimited column with possible repeats
  • How to get current document uri in XSLT?
  • Spring boot 2.0.0.M4 required a bean named 'entityManagerFactory' that could not be found
  • Read text file that is not in the main package in a runnable jar
  • Roxygen error “Skipping invalid path”
  • WPF ICommand CanExecute(): RaiseCanExecuteChanged() or automatic handling via DispatchTimer?
  • ViewController With Transparent Background Entering Current ViewController With Push Transition
  • Remove final comma from string in vb.net
  • onBackPressed() not being executed
  • azure media services - The request body is too large and exceeds the maximum permissible limit
  • Refering to the class itself from within a class mehod in Objective C
  • Disable Enter in editText android
  • Cannot resolve symbol 'MyApi'
  • If I include Java 8 in my Android app does that affect which devices it will work on?
  • C# - Serializing and deserializing static member
  • Sending data from AppleScript to FileMaker records
  • Release, debug version and Authorization Google?
  • To display the title for the current loaction in map in iphone
  • Invalid access key error using credentials redeemed from an amazon open id token
  • PHP: When would you need the self:: keyword?
  • How to include full .NET prerequisite for Wix Burn installer
  • Acquiring multiple attributes from .xml file in c#
  • Is it possible to post an object from jquery to bottle.py?
  • reshape alternating columns in less time and using less memory
  • How can I use threading to 'tick' a timer to be accessed by other threads?