Skip to content

Instantly share code, notes, and snippets.

@phi-lira
Last active January 20, 2016 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phi-lira/db8191fdae3873291d56 to your computer and use it in GitHub Desktop.
Save phi-lira/db8191fdae3873291d56 to your computer and use it in GitHub Desktop.
Mali Graphics Debugger Activity. It extends UnityNativePlayerActivity and loads MGD library in order to connect MGD to Unity
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.arm.mgdactivity" android:versionName="1.0.0" android:versionCode="1">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:debuggable="false">
<activity android:name="com.arm.mgdactivity.MGDNativeActivity" android:label="@string/app_name" android:screenOrientation="landscape" android:configChanges="screenSize|orientation|keyboardHidden|keyboard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="21" />
<uses-feature android:glEsVersion="0x00030000" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
</application>
</manifest>
// replace package name with your bundle identifier
package com.arm.mgdactivity;
import android.os.Bundle;
import android.util.Log;
public class MGDNativeActivity extends UnityPlayerNativeActivity
{
@Override protected void onCreate (Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
try {
System.loadLibrary("MGD");
}
catch( UnsatisfiedLinkError e ) {
// Feel free to remove this log message.
Log.i("MGD", "libMGD.so not loaded.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment