質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Webサイト

一つのドメイン上に存在するWebページの集合体をWebサイトと呼びます。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Q&A

解決済

1回答

9670閲覧

WebViewでERR_NAME_NOT_RESOLVEDと表示されます。

hanlio

総合スコア14

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Webサイト

一つのドメイン上に存在するWebページの集合体をWebサイトと呼びます。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

0グッド

0クリップ

投稿2018/04/02 08:52

編集2018/04/02 09:48

検索ワードを入力して検索ボタンを押すと、イラスト屋の画像検索結果が、WebViewに表示されるようにしたいのですが、ERR_NAME_NOT_RESOLVEDと表示されます。
何が間違っているかご教示いただきたく存じます。

情報が足りない場合は、おっしゃってください。

イメージ説明

###activity_main.xml

<?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="to.msn.wings.irasutoya_search.MainActivity"> <EditText android:id="@+id/txt" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:ems="10" android:inputType="textPersonName" android:text="" android:hint="検索ワードを入力ください" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <Button android:id="@+id/search_button" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:text="検索" android:onClick="btn_onclick" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/txt" /> <WebView android:id="@+id/wv" android:layout_width="368dp" android:layout_height="358dp" android:layout_marginBottom="8dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/url"> </WebView> <TextView android:id="@+id/url" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:text="TextView" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/search_button" /> </android.support.constraint.ConstraintLayout>

###AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="to.msn.wings.irasutoya_search"> <uses-permission android:name="android.permission.INTERNET"/> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>

###MainActivity.java

java

1package to.msn.wings.irasutoya_search; 2 3import android.support.v7.app.AppCompatActivity; 4import android.os.Bundle; 5import android.view.View; 6import android.webkit.WebView; 7import android.webkit.WebViewClient; 8import android.widget.EditText; 9import android.widget.TextView; 10 11public class MainActivity extends AppCompatActivity { 12 13 @Override 14 protected void onCreate(Bundle savedInstanceState) { 15 super.onCreate(savedInstanceState); 16 setContentView(R.layout.activity_main); 17 } 18 19 //ボタンクリック時の処理 20 public void btn_onclick(View view){ 21 22 EditText txt = (EditText)findViewById(R.id.txt); 23 TextView txtResult = (TextView)findViewById(R.id.url); 24 txtResult.setText(String.format("https://www.irasutoya.com/search?q=%s", txt.getText())); 25 26 WebView wv = (WebView)findViewById(R.id.wv); 27 wv.setWebViewClient(new WebViewClient()); 28 //クリックされたらページを読み込む。 29 wv.loadUrl(txtResult.getText().toString()); 30 } 31}

###Logcat
文字数オーバーになってしまったので、一部のみ記載します。

04-02 08:44:11.026 15141-15220/to.msn.wings.irasutoya_search I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es 04-02 08:44:11.042 15141-15220/to.msn.wings.irasutoya_search W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device. 04-02 08:44:11.045 15141-15220/to.msn.wings.irasutoya_search W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device. 04-02 08:44:11.110 15141-15220/to.msn.wings.irasutoya_search D/EGL_emulation: eglCreateContext: 0xa08871c0: maj 3 min 0 rcv 3 04-02 08:44:11.111 15141-15220/to.msn.wings.irasutoya_search D/EGL_emulation: eglMakeCurrent: 0xa08871c0: ver 3 0 (tinfo 0x8b383f70) 04-02 08:44:11.114 15141-15220/to.msn.wings.irasutoya_search E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf 04-02 08:44:11.115 15141-15220/to.msn.wings.irasutoya_search E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf 04-02 08:44:11.115 15141-15220/to.msn.wings.irasutoya_search E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824 04-02 08:44:11.116 15141-15220/to.msn.wings.irasutoya_search E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824 04-02 08:44:11.139 15141-15220/to.msn.wings.irasutoya_search E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008a34 04-02 08:44:11.140 15141-15220/to.msn.wings.irasutoya_search E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008a34 04-02 08:44:11.141 15141-15220/to.msn.wings.irasutoya_search E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008073 04-02 08:44:11.142 15141-15220/to.msn.wings.irasutoya_search E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008073 04-02 08:44:11.142 15141-15220/to.msn.wings.irasutoya_search E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ff 04-02 08:44:11.142 15141-15220/to.msn.wings.irasutoya_search E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ff 04-02 08:44:11.224 15141-15141/to.msn.wings.irasutoya_search W/zygote: Attempt to remove non-JNI local reference, dumping thread 04-02 08:45:31.597 15141-15141/to.msn.wings.irasutoya_search W/zygote: Attempt to remove non-JNI local reference, dumping thread

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

ERR_NAME_NOT_RESOLVEDというエラーは単純にURLが間違っているような場合に起きるエラーですが、これは何でしょうね?提示されたコードにあるURLは誤っていないようですし、こちらで同じソースを記述してみましたが、(描画はなんか変だが)正常にアクセスは通るようです。Android Studioを動かしているホストPCは、正常にインターネットに繋がる状態なのですよね?

これについては、今出ている情報ではちょっとわかりません。


それから、logCatに

E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf

のようなエラーが繰り返し出るのは、エミュレーターの画面をGPUが描画するときの問題と思われます。エミュレーターの設定を変更して、ソフトウェアレンダリングに変えてみたら改善する可能性はあります。AVD Managerを開き、当該AVDの右端にある鉛筆マークをクリックして設定画面を出してください。Emulated Performanceの設定をAutomaticからSoftware - GLES 2.0に変更してみてください。

投稿2018/04/03 08:58

編集2018/04/03 09:03
keicha_hrs

総合スコア6768

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

hanlio

2018/04/04 10:33

ご回答ありがとうございます。 私の方でも表示が出来ました。iPhoneのテザリングを使っていたことが要因のようです。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問