Android Studio エミュレータのネットワーク設定

最近は使えるのかな,とひさびさにエミュレータ...

はい,DNSエラー.

エミュレータ内にて.


generic_x86:/ $ ifconfig
lo        Link encap:UNSPEC
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope: Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:310 TX bytes:310

eth0      Link encap:UNSPEC    Driver virtio_net
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fe12:3456/64 Scope: Link
          inet6 addr: fec0::5054:ff:fe12:3456/64 Scope: Site
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3506 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3523 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:270699 TX bytes:274244


generic_x86:/ $ getprop
...
[net.bt.name]: [Android]
[net.eth0.dns1]: [10.0.2.3]
[net.eth0.gw]: [10.0.2.2]
[net.gprs.local-ip]: [10.0.2.15]
[net.qtaguid_enabled]: [1]
[net.tcp.default_init_rwnd]: [60]
...

仮想ネットワークは正しく構築できているようですが.

Set Up Android Emulator Networking | Android Studio

結局これ,パソコン上のDNSに Google Public DNS アドレスを追記で繋がるようになります.

Firewall などはONのままでよいです.

DNSとして設定されたルータのローカルアドレスをうまくエミュレータ側で認識/変換できないのだろうと思われます.

ちなみに,接続成功時のパソコン内にて以下.

~$ cat /var/run/resolv.conf
#
# Mac OS X Notice
#
# This file is not used by the host name and address resolution
# or the DNS query routing mechanisms used by most processes on
# this Mac OS X system.
#
# This file is automatically generated.
#
search flets-east.jp iptvf.jp
nameserver 192.168.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4

~ $ cat /etc/resolv.conf
#
# Mac OS X Notice
#
# This file is not used by the host name and address resolution
# or the DNS query routing mechanisms used by most processes on
# this Mac OS X system.
#
# This file is automatically generated.
#
search flets-east.jp iptvf.jp
nameserver 192.168.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4

Run Apps on the Android Emulator | Android Studio

エミュレータ内にて setprop -> restart network で接続できたとしても毎回いちいち面倒です.

戻ろう、Genymotion に。
→ Genymotion 無料版 を入れる 2018


Google Play Services 11.2.2 で OSSライセンス一覧 を表示する

Including Open Source Notices  |  Google APIs for Android  |  Google Developers

build.gradle に追記します.

root-level:


buildscript {
  repositories {
    //...
    maven { url "https://maven.google.com" } // or google() for Gradle 4+
  }
  dependencies {
    //...
    // Add this line:
    classpath 'com.google.gms:oss-licenses:0.9.0'
   }

app-level:


apply plugin: 'com.google.gms.oss.licenses.plugin'

compile 'com.google.android.gms:play-services-oss-licenses:11.2.2'

コードに追加する行は一行.
アクティビティが用意されています.


startActivity(new Intent(this, OssLicensesMenuActivity.class));

あれ, URLだけしか表示されないけど.

This will display a list of open source libraries that are compiled into the app, whether part of Google Play services or not. Tapping the library name will display the URL of the license.

いいのか...

Show Open Source Notices [65533155] - Visible to Public - Issue Tracker

一応, スターをつけてマークしておきますか...


Android 8.0 Oreo「Picture in Picture」を実際に確認する

YouTube で使うには YouTube Red のサブスクリプションが必要.

YouTube's Picture-in-Picture mode in Oreo is only available to paying Red customers in five countries, and that's a problem

よって, 日本国内 YouTube では, 現在, アプリ・ブラウザ共に使えない模様.

Chrome上でのYouTube以外の動画 や GoogleMap のナビゲーションモード では国内でも使える.

設定からインストールしている*実装上は*対応しているアプリを把握できる.

[設定]

[アプリと通知]

[特別なアプリアクセス]

[PinP]

動画を表示するアプリを中心に対応が進んでいくのでしょうね.

WhatsApp update includes picture-in-picture calls for Android 8.0 Oreo | Tech | Life & Style | Express.co.uk