Skip to content

Commit c552fb6

Browse files
+ initial commit
0 parents  commit c552fb6

36 files changed

+2333
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Project exclude paths
2+
.gradle/
3+
build/
4+
.idea
5+
*.iml
6+
local.properties

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apply plugin: 'com.android.application'
2+
3+
apply plugin: 'kotlin-android'
4+
5+
apply plugin: 'kotlin-android-extensions'
6+
7+
android {
8+
compileSdkVersion 29
9+
defaultConfig {
10+
applicationId "dev.abhishekbansal.nexrad"
11+
minSdkVersion 24
12+
targetSdkVersion 29
13+
versionCode 1
14+
versionName "1.0"
15+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16+
}
17+
buildTypes {
18+
release {
19+
minifyEnabled false
20+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21+
}
22+
}
23+
}
24+
25+
dependencies {
26+
implementation fileTree(dir: 'libs', include: ['*.jar'])
27+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
28+
implementation 'androidx.appcompat:appcompat:1.1.0'
29+
implementation 'androidx.core:core-ktx:1.1.0'
30+
implementation 'com.google.code.gson:gson:2.8.5'
31+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

app/src/main/AndroidManifest.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="dev.abhishekbansal.nexrad">
3+
4+
<application
5+
android:allowBackup="true"
6+
android:icon="@mipmap/ic_launcher"
7+
android:label="@string/app_name"
8+
android:roundIcon="@mipmap/ic_launcher_round"
9+
android:supportsRtl="true"
10+
android:largeHeap="true"
11+
android:theme="@style/AppTheme" >
12+
13+
<activity android:name="dev.abhishekbansal.nexrad.LessonOneActivity">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN" />
16+
17+
<category android:name="android.intent.category.LAUNCHER" />
18+
</intent-filter>
19+
</activity>
20+
</application>
21+
</manifest>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package dev.abhishekbansal.nexrad;
2+
3+
import android.app.Activity;
4+
import android.app.ActivityManager;
5+
import android.content.Context;
6+
import android.content.pm.ConfigurationInfo;
7+
import android.opengl.GLSurfaceView;
8+
import android.os.Bundle;
9+
10+
11+
public class LessonOneActivity extends Activity {
12+
/**
13+
* Hold a reference to our GLSurfaceView
14+
*/
15+
private GLSurfaceView mGLSurfaceView;
16+
17+
@Override
18+
protected void onCreate(Bundle savedInstanceState) {
19+
super.onCreate(savedInstanceState);
20+
setContentView(R.layout.lesson_one);
21+
22+
mGLSurfaceView = findViewById(R.id.gl_surface_view);
23+
24+
// Check if the system supports OpenGL ES 2.0.
25+
final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
26+
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
27+
final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;
28+
29+
if (supportsEs2) {
30+
// Request an OpenGL ES 2.0 compatible context.
31+
mGLSurfaceView.setEGLContextClientVersion(2);
32+
33+
// Set the renderer to our
34+
// demo renderer, defined below.
35+
final LessonOneRenderer renderer = new LessonOneRenderer();
36+
mGLSurfaceView.setRenderer(renderer);
37+
} else {
38+
// This is where you could create an OpenGL ES 1.x compatible
39+
// renderer if you wanted to support both ES 1 and ES 2.
40+
return;
41+
}
42+
}
43+
44+
@Override
45+
protected void onResume() {
46+
// The activity must call the GL surface view's onResume() on activity onResume().
47+
super.onResume();
48+
mGLSurfaceView.onResume();
49+
}
50+
51+
@Override
52+
protected void onPause() {
53+
// The activity must call the GL surface view's onPause() on activity onPause().
54+
super.onPause();
55+
mGLSurfaceView.onPause();
56+
}
57+
}

0 commit comments

Comments
 (0)