DroidKaigi 2018 - Day1 Room1 16:50~ にて発表する内容です
DroidKaigi 2018 - Day1 Room1 16:50~ にて発表する内容です
こんなものを作ります とても一般的な音楽プレーヤーの雛形を作ります。 また、専用の処理を実装しなくてもWearやAutoに対応できる方法を取ります。 Androidの音楽プレイヤーに関するの日本語記事って皆無ですよね。 色々苦労してなんとか実装できたので記事にしました。 長くなりますが、よければお付き合いください。 実装だけ見たい方は、いざ実装まで飛ばしてください。 Android上で動く音楽プレーヤーのあるべき姿 PCで動く音楽プレイヤーを作る時は、MediaPlayer等のインスタンスの各種メソッドを Formに貼り付けたボタンのクリックに応じて呼び出すのが主な作り方だったと思います。 しかし、近年のAndroidやiOSなどのモバイルプラットフォームはスマートフォンにとどまらず 腕時計やカーオーディオ、テレビなどの様々な機器に組み込まれるようになりました。 するとスマホとリンクして、
Androidエンジニアの @nissiy です。Androidが発表されてからもうすぐ10年になろうとしています。長いですね。 実はAndroid版IQON、今年の4月でリリースしてから丸5年を迎えます。ここまで長くサービスを続けられて、かつ3年連続でベストアプリをいただけたのは、使ってくれているユーザーの方々のおかげであると日々感謝しています。 この5年で様々な追加機能の開発を行ってきました。新機能を1つ追加する度に、古い機能を1つ削除することを徹底して開発を進めてきたものの、長く開発を続けているのでそれなりに巨大なアプリになっています。 今回はAndroid版IQONを長く開発し続けるためにチーム内で徹底しているルールをいくつか紹介したいと思います。 当たり前な話ばかりですが、大きくOSのアップデートを繰り返すAndroidのアプリ開発に取っては大事な話ばかりですので、少しでも参考に
というタイトルでKyoto.なんか #2で発表してきました. そして物語は何度目かのアプリ内通知再実装を迎える / Reimplement in app notification // Speaker Deck スライドの内容としては,アプリ内通知 (Twitter appで言うところの「通知」タブにあたる部分) のサーバサイドを実装する際にどういう問題があって,それをどういう風に実装したかという葛藤の記録となっています. Webアプリケーションやスマートフォンアプリケーションを書いていると,そこそこの確率でアプリ内通知を書くことになると思うんですが,ところがどっこい「実際にどういう風に実装しているか」みたいな知見が共有されている感じがあまりありません.みんな実装しているはずなのに,ググってもあまり情報が出てこなくて寂しい.地味な機能だから? という思いがあり,そこら辺アプリ内通知周辺の技
最近、Androidの設計やらテストの書き方やらを試行錯誤していて、ちょっと情報が散らばってきたので個人的なまとめです。これが絶対的にイケてる!とかじゃなくて単にいろんな人のスライド読んだり、自分で試したりして今こんな感じになったというレベルのものです。 コードは↓で作ったアプリをベースにいじってます。。Kotlin製のアプリなのでJavaに適時読み替えてください。 rei19.hatenablog.com 設計の話 設計の目標はモジュールの責務を分割して将来の変更に強くするという感じです。Androidの場合は特に適当に作るとActivityとFragmentが膨れ上がってメンテつらい作りになりがちです。で、去年に書いた記事(Androidのデザインパターンを考えてみたの続き。Kotlin対応版。 - もやもやエンジニア)とかを経て、いまのところはMVPな構成にしてModel層をDDDラ
アプリ自体のコーディング見積もりのみに注力してしまうと忘れがちで、たまにつらい目に遭うので、必要に応じて追加していく予定。 アプリ仕様 仕様はそもそも決まっているか 「仕様は決まっている。動かない」「移植なのでこれ以上はありません」と言ったな。 それは嘘だ。 既に仕様がガッチリ確定していることはありえない。要求仕様(必要機能リスト)がある程度固まっているならばまだ良い方で、「今から仕様を一緒に考えていきましょう」「アイディアレベルです」まで様々。 その他にも、GCM/FCM等のアプリ外サービスと連携する場合、遅延コスト等どの程度許容できるかも事前に確定させる。特にプッシュ系サービスでは、ありえないレベル(全端末遅延1秒以内必須、とか)を既定路線に含めないように留意する。 改修か、新規開発か これは見積もりの前提として大きな影響力をもつ。 テクノロジーや設計の自由度・柔軟性をある程度コントロ
Android Studioでプロジェクトを新規で作る時、テンプレートは何を選択していますか? テンプレートには自動でNavigation Drawerを生成してくれるものや、最近だと広告をつけてくれるものなど色々ありますが、実際のところ、Add No Activityを選択するか、Blank Activityを選択する人が多いのではないのでしょうか。 テンプレートはプロジェクト作る時に必ず通るのですが、正直あまりイケてると思えないので、今回もうちょっとましなテンプレートを作ってみました。 Android Studioの標準テンプレートの問題点 Android Studioの標準テンプレートの問題点としては、以下があると思います。 余計なリソースファイルやコードが自動で生成されてしまう →例えば、Blank Activityだと、activityごとのmenu(menuリソース + onC
Android アプリ開発で SQLite を使っていると、しばしば次のような例外が投げられることがあります。*1 android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5) 軽く調べてみたところ このエラーをぐぐってみると、「複数スレッドから SQLite を使う場合に、それぞれのスレッドで異なる SQLiteDatabase オブジェクトを使っているとこのエラーが出ることがある」 とか書かれていて、回避策として 「複数スレッドで SQLite を使う場合は 1 つの SQLiteDatabase オブジェクトを複数スレッドで使いまわすこと」 というような情報が得られました。 あとは当たり前ですが 「トランザクションがちゃんと閉じられているか確認すること」 とか。 いくつかの質問やブ
eventbus.md EventBus EventBus は必ず onStart() と onStop() で呼ぶ。バックグラウンドで色々動かれて困る。 また、onStop() では super.onStop() よりも 先に 呼ぶ。 @Override protected void onStart() { super.onStart(); EventBus.getDefault().register(this); } @Override protected void onStop() { EventBus.getDefault().unregister(this); } proguard の設定 忘れがちですが、設定しないと最適化オプション付けたときに死ぬ -keepclassmembers class ** { public void onEvent*(**); } # Only r
こんにちは。モバイルチームの中川[twitter:@Nkzn]です。 droidkaigi.github.io Androidエンジニアのためのカンファレンス「DroidKaigi」に登壇する機会をいただきまして、サイバーエージェントのセミナールームでお話してきました。 本エントリは、発表原稿としてスライドの元にした文章です。技術的には同一の内容になっています。 スライド 僕らのデータ同期プラクティス from Yukiya Nakagawa www.slideshare.net はじめに ユーザーがどんな場所にアプリを持っていこうと、私達はそれを制止できません。自分たちのWebサービスを携帯網もWi-Fiもない場所でも使ってほしいと思ったとき、私たち開発者には何ができるでしょうか。 GmailアプリやEvernoteアプリのように、オフライン時に閲覧・作成・編集されたデータをサーバーと同
エンジニアがアプリ担当とAPI担当で分かれているチームで、API担当のエンジニアがアプリ開発経験が無かったりすると、アプリ担当のエンジニアはどんなAPIがクライアントアプリにとって使いやすいのか、上手く伝えるのに苦労する事がありますよね?本記事はそんな場面でAPI担当のエンジニアに読んでもらう事を想定しています。 APIと型 アプリ側はRESTクライアントにRetrofitやRestkit等、既に広く使われているライブラリを使用する事が多いです。それらのライブラリは、オブジェクト・JSON間の変換機能があり、アプリ側ではJSON等シリアライズされるデータ形式を意識せずに、処理系上のオブジェクトをそのまま扱えます。即ちAPI経由でやり取りされるデータは全て型を持つのです。 例えばAPI側のコードで以下の様に定義されたクラスが
この記事では、Android開発を始める方や、初めたての方向けにどのようなサイトを見たり、本を読んだらいいかをレベル別や用途別で解説します。 本の紹介などはすでに多く存在しますが、使いどころというのは本によって大きく違います。この記事ではその使いどころに意識してソースを紹介できればと思います。 また、Androidプログラミング初心者とプログラミング初心者は区別しません(合わせて"プログラミング初心者"と記述)。Androidのアプリ開発はベースとなっているJava言語が直感的に理解しやすいこともあり、他のプログラミング言語を習得していなくてもある一定のレベルまでは上達します。本当にAndroidアプリ開発に興味を持ってきた段階でJava言語の勉強を本格的に行うようにし、まずはAndroidをアプリを作成するというところにフォーカスしてやっていきましょう。 Androidプログラミングを始
概要 Espresso 2.0 が Android support library の一部としてリリースされた - ひだまりソケットは壊れない espressoの他にtesting-support-libというのがsupport packageに増えたそうです。 で、testing-support-libを使うと手軽にJUnit4をAndroidアプリケーションに導入できます。 手順 1. Android Support Repositoryを最新にする Android SDK ManagerでAndroid Support Repositoryを最新にします。 2. build.gradleに設定 build.gradleにtesting-support-libの設定を書く。差分は以下の通り。 android { defaultConfig { testInstrumentationRu
毎月開催しているiOS/AndroidのTips交換会、2014年最後になったpotatotipsに参加してきました。今回はpixiv社で開催され、LT時間5分順守の残り時間のみ質問というかなりメリハリある感じで行われました。 発表をまとめていますが問題があればご指摘ください pixivのAndroidアプリの画像取り扱い事情 pixiv社@__chocomelonの発表。pixiv Androidアプリでのサムネイル画像の種類や取得方法についてでした。 詳細はPixiv Engineering Blogに書かれています pixvアプリのサムネイルの種類 pixivではVolley+OkHttp ユーザーのネットワーク回線によってスレッド数を自動調整する Android 2系はもうサポートしない 水曜日はランチをやってるので暇があれば来てください iOS・Android 徹底比較! Sub
こちらは ピクシブ株式会社 Advent Calendar 2014 の12/15の記事です。 こんにちは。pixivのAndroidアプリ担当の @consomme72 です。 今回は、Googleのサービスである「App Indexing」についてご紹介します。 App Indexing とは? 2013年10月にGoogleが発表した、Googleで検索されたWebページのコンテンツと、アプリのコンテンツの紐付けを行うことができるサービスです。日本では2014年6月でも機能が公開され、pixivのアプリもローンチパートナーとして紹介されております。 Androidアプリでは、Manifestファイルにてhttpのリンクを受け取れるようにIntent-filterを設定しておけば、Webブラウザからリンクを開いた際にアプリを起動することができます。しかしその際に、ブラウザで開くかアプリ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く