fixed bugs, added progress saving, setted MIN API to 19
This commit is contained in:
1 parent
3e3daf6c0c
commit
ba9cba22eb
7 files changed
+164
-49
No files matched your search
@@ -6,18 +6,14 @@ android {
|
||||
buildToolsVersion "28.0.0"
|
||||
defaultConfig {
|
||||
applicationId "fishrungames.DoubleHitBalls"
|
||||
minSdkVersion 24
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 28
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
|
||||
abiFilters "armeabi-v7a", "x86"
|
||||
|
||||
arguments "-DANDROID_STL=c++_shared"
|
||||
|
||||
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86'
|
||||
cppFlags "-std=c++17 -frtti -fexceptions -fsigned-char -Wno-c++11-narrowing"
|
||||
}
|
||||
}
|
||||
@@ -38,6 +34,13 @@ android {
|
||||
assets.srcDirs = ['../../assets/']
|
||||
}
|
||||
}
|
||||
splits {
|
||||
abi {
|
||||
enable true
|
||||
reset()
|
||||
include 'arm64-v8a', 'armeabi-v7a', 'x86'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -36,6 +36,8 @@ public class GL2JNIActivity extends Activity
|
||||
EngineWrapper.LoadSalmonEngineLibrary();
|
||||
EngineWrapper.SetActivityInstance(this);
|
||||
EngineWrapper.SetupEnviroment();
|
||||
JniWrapper.SetJavaVM();
|
||||
JniWrapper.SetContext(this);
|
||||
|
||||
String apkFilePath = null;
|
||||
ApplicationInfo appInfo = null;
|
||||
|
||||
@@ -1,11 +1,52 @@
|
||||
package fishrungames.doublehitballs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
public class JniWrapper
|
||||
{
|
||||
static Context context = null;
|
||||
|
||||
public static void SetContext(Context context)
|
||||
{
|
||||
JniWrapper.context = context;
|
||||
}
|
||||
|
||||
static {
|
||||
System.loadLibrary("DoubleHitBalls");
|
||||
}
|
||||
|
||||
public static native void Init(int width, int height);
|
||||
public static native void SetJavaVM();
|
||||
|
||||
public static String LoadFile(String fileName)
|
||||
{
|
||||
try {
|
||||
File file = new File(context.getFilesDir(), fileName);
|
||||
FileInputStream inputStream = new FileInputStream(file);
|
||||
byte[] data = new byte[(int) file.length()];
|
||||
inputStream.read(data);
|
||||
inputStream.close();
|
||||
return new String(data, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
Log.d("SaveFile", "Failed to save a file.");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void SaveFile(String fileName, String fileContent)
|
||||
{
|
||||
try {
|
||||
File file = new File(context.getFilesDir(), fileName);
|
||||
FileOutputStream outputStream = new FileOutputStream(file);
|
||||
outputStream.write(fileContent.getBytes());
|
||||
outputStream.close();
|
||||
} catch (Exception e) {
|
||||
Log.d("SaveFile", "Failed to save a file.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user