M3→M5変更点
Android SDKのバージョンがM3からM5にアップしいろんな変更がありました。
気になったところをピックアップします。
- Content Provider関連
ContentUriクラス名変更
→Uri
メソッド名変更Old New
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(); - Xmpp関連
com.google.android.xmppserviceパッケージ名変更
→com.google.android.gtalkservice
IXmppServiceインターフェース名変更
→IGTalkService
IXmppSessionインターフェース名変更
→IGTalkSession
XmppServiceConstantsクラス名変更
→GTalkServiceConstants
クラスおよびインターフェース追加
→GroupChatInvitation、IChatListener、IChatSession、
IGroupChatInvitationListener、IRosterListener
IXmppSession#sendTextMessageメソッド廃止
→代わりにIChatSession#sendTextMessageメソッドを使用する - Notification Manager
notifyTextメソッド廃止、Toastクラス追加
→Toast.makeText(context, R.string.some_string, Toast.LENGTH_SHORT).show(); - レイアウト
id属性名称変更
→android:id - ListView
android:gravity属性廃止
→setStackFromBottomメソッドを使用する。代替XML属性は無い模様 - SimpleCursorAdapter
ImageViewが表示できるようなった
setViewTextメソッド引数変更
→setViewText(TextView v, String text)
setViewImageメソッド追加 - AndroidManifest.xml
android:value名称変更
→android:name