vistaでandroid studio その13

# 概要
vistaでandroid studio 1.0.1やってみた。
openglやってみた。

# 写真

![device-2022-09-03-172706.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/18104/4645cfaf-f2c7-68e7-bf9a-d6df26ba8a01.png)

# レイアウト

```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:tools="http://schemas.android.com/tools"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:paddingLeft="@dimen/activity_horizontal_margin"
	android:paddingRight="@dimen/activity_horizontal_margin"
	android:paddingTop="@dimen/activity_vertical_margin"
	android:paddingBottom="@dimen/activity_vertical_margin"
	tools:context=".MainActivity">

</RelativeLayout>
```

# サンプルコード

```
package com.ohisamallc.ohiapp154.ohiapp154;

import android.content.Context;
import android.content.Intent;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioTrack;
import android.net.Uri;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import android.os.AsyncTask;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.view.View;
import android.widget.Toast;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import javax.net.ssl.HttpsURLConnection;

public class MainActivity extends ActionBarActivity {
	GLSurfaceView gLView;
	GLRenderer mRenderer;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		gLView = new GLSurfaceView(this);
		gLView.setEGLContextClientVersion(1);
		mRenderer = new GLRenderer();
		gLView.setRenderer(mRenderer);
		gLView.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
		setContentView(gLView);

	}
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.menu_main, menu);
		return true;
	}
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		int id = item.getItemId();
		if (id == R.id.action_settings)
		{
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
	class GLRenderer implements GLSurfaceView.Renderer {
		@Override
		public void onDrawFrame(GL10 gl) {
			GLES20.glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
			GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
		}
		@Override
		public void onSurfaceChanged(GL10 gl, int width, int height) {
		}
		@Override
		public void onSurfaceCreated(GL10 gl, EGLConfig config) {
		}
	}

}


```


以上。