Wednesday, April 2, 2008

Android SDK M5 Release

La nueva versión de la SDK de android Android SDK M5 Release trae nuevas funcionalidades necesarias para le proyecto y otras reparadas.

El primero es la clase MediaPlayer que se le ha añadido ogg entre otros y supuesto streaming en mp4, a parte de alguna excepcion para algun invariante de sistema que antes no se tenía en cuenta.

MediaPlayer:

  • MediaPlayer:
    • Added support for OGG Vorbis (.ogg) and MIDI (.mid, .smf), XMF (.xmf, .mxmf), iMelody (.imy), RTTTL/RTX (.rtttl, .rtx) and OTA (.ota) audio file formats.
    • Added convenience methods for creating a android.media.MediaPlayer object from a Uri. See MediaPlayer.create(Context, Uri) and MediaPlayer.create(Context, Uri, Surface) for more details.
    • Added method for grabbing a frame from a video clip to use a thumbnail.
    • Added method to set power management behavior.
    • Added method to determine whether media is currently playing.
    • Added support for http streaming of MP4 media.
    • MediaPlayer.prepare() is now called from MediaPlayer.create() and you will get an exception if you call MediaPlayer.prepare() after using create().
  • MidiFile has been deleted in favor of android.media.MediaPlayer which offers improved functionality and a unified API for all multimedia files and streams.
  • There are numerous bugfixes in the media framework.
SQLite es el sistema de ficheros en el que se guardará toda la información que se necesite hacer persistente.

SQLite/Content Provider

  • The QueryBuilder class has been moved to the android.database.sqlite package and renamed SQLiteQueryBuilder as it now is responsible for building the SQL that is passed to android.database.sqlite.SQLiteDatabase.
  • The android.net.ContentURI class has be replaced with the new android.net.Uri class. This is not a 1:1 replacement and engenders a number of necessary changes in the way you use and manipulate URIs in Android applications. android.content.ContentUris provides some static helper methods for appending and parsing IDs. android.net.Uri.Builder is a builder class to help with creating new Uris (from existing ones if necessary). Take a look at the Notepad sample from the SDK to see how to use these classes to replace the ContentURI usage.

    Some suggested replacements:
    OldNew
    new ContentURI(String) Uri.parse(String)
    ContentURI.create(String) Uri.parse(String)
    ContentUri.countPathSegments() Uri.getPathSegments().size()
    ContentUri.getPathSegment() Uri.getPathSegments().get()
    or
    Uri.getLastPathSegment()
    ContentURI.addPath() Uri.Builder.appendPath()
    ContentURI.addId(id) uri = Uri.withAppendedPath(SOME_URI, id);
    or
    uri = ContentUris.appendId(uri.buildUpon(), id).build();
  • The previously unused groupBy and having parameters have been removed from ContentProvider.query().
  • ContentProvider has a new method, openFile() that takes a URI and returns a file descriptor to the opened file. The ContentProvider.openFileHelper() method covers the common case, override openFile and call it if you don't need anything fancy. It is now the responsibility of the ContentProvider to open the file, it no longer needs to have a special column with the file name, can open any file it wants, and also no longer needs to make the files world-readable. A file descriptor is returned to the client.
  • android.content.ContentURIParser has been removed, use android.content.UriMatcher instead.
  • ContentProvider.onSyncStart() and ContentProvider.onSyncStop() now each take an account parameter.
  • SQLiteCursor.supportsUpdates() could have returned true when updates were not supported, this is fixed.
  • SQLiteCursor.commitUpdates() now returns true when there are no updates to commit.
  • SQLiteCursor has a new method, hasUpdates() which returns true if any updates were made to the cursor.
  • The custom Android SQLite functions are now available in the sqlite3 shell tool.
  • SQLiteDatabase.query() may also take a SQLiteDatabase.CursorFactory now as well as the constructor.
  • android.database.Cursor has the new method getWantsAllOnMoveCalls() which tells the client side to send move notifications to the content provider for all moves, not just ones that cross window boundaries.
  • Cursor has the new method getExtras() which lets the cursor provide out of band data to the users.
  • Cursor has the new method respond() which lets the user send out of band data back to the Cursor implementation.
  • android.database.ArrayCursor has been replaced by android.database.ArrayListCursor.
  • Reading floating point and long values from android.database.sqlite.SQLiteCursor now works correctly.

No comments: