Skip to content

Instantly share code, notes, and snippets.

View manorgass's full-sized avatar
🎯
Focusing

JungWon Kim manorgass

🎯
Focusing
View GitHub Profile
package com.example.fusedlocationtest.provider
import android.Manifest
import android.content.Context
import android.content.pm.PackageManager
import android.location.Location
import android.location.LocationListener
import android.location.LocationManager
import android.util.Log
import androidx.core.app.ActivityCompat
package com.example.fusedlocationtest.provider
import android.Manifest
import android.content.Context
import android.content.pm.PackageManager
import android.os.Looper
import android.util.Log
import androidx.core.app.ActivityCompat
import com.example.fusedlocationtest.OnLocationUpdateListener
import com.google.android.gms.location.*
@manorgass
manorgass / StringTemplate.java
Last active March 4, 2020 14:52
문자열 템플릿 예제
package com.tistory.manorgass;
import java.util.Locale;
public class StringTemplate {
private static final String TAG = "StringTemplate";
public static void main(String[] args) {
int size = 30;
String method_1 = "" + size;
@manorgass
manorgass / camSnippet.java
Created June 25, 2019 01:51
Android Camera setPreviewCallbackWithBuffer
private byte yuv420Buffer[] = null;
Camera.Size size = parameters.getPreviewSize();
if (yuv420Buffer == null) {
int bufSize = size.width * size.height * 3 / 2;
yuv420Buffer = new byte[bufSize];
}
//콜백용 버퍼 지정 (콜백함수에서도 호출해야 한다.)
camera.addCallbackBuffer(yuv420Buffer);
@manorgass
manorgass / GLES20_init_shader.java
Last active April 17, 2019 09:05
OpenGL ES 20 for Android / Init Shader
final String vertexShader =
"uniform mat4 u_MVPMatrix; \n" // A constant representing the combined model/view/projection matrix.
+ "attribute vec4 a_Position; \n" // Per-vertex position information we will pass in.
+ "attribute vec4 a_Color; \n" // Per-vertex color information we will pass in.
+ "varying vec4 v_Color; \n" // This will be passed into the fragment shader.
+ "void main() \n" // The entry point for our vertex shader.
+ "{ \n"
+ " v_Color = a_Color; \n" // Pass the color through to the fragment shader.
// It will be interpolated across the triangle.
+ " gl_Position = u_MVPMatrix \n" // gl_Position is a special variable used to store the final position.