Skip to content
Permalink
Browse files

Merge branch 'master' into CMakeBuild-clean

  • Loading branch information...
MatthiasWM committed May 18, 2018
2 parents 96d97ec + bf8dc69 commit 0fe3bbf35a9feca432a94ed9c84f4784bc811003
Showing with 1,277 additions and 1,444 deletions.
  1. +10 −3 .gitignore
  2. +0 −6 _Build_/AndroidStudio/.idea/vcs.xml
  3. +16 −9 _Build_/AndroidStudio/app/build.gradle
  4. +4 −3 _Build_/AndroidStudio/app/src/main/AndroidManifest.xml
  5. +23 −21 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/Einstein.java
  6. +53 −58 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/EinsteinApplication.java
  7. +87 −90 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/EinsteinService.java
  8. +26 −34 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/action/EinsteinActionHandler.java
  9. +73 −78 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/activity/ActionsActivity.java
  10. +135 −266 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/activity/EinsteinActivity.java
  11. +72 −84 ...roidStudio/app/src/main/java/com/newtonforever/einstein/activity/EinsteinPreferencesActivity.java
  12. +209 −210 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/activity/LoadPackageActivity.java
  13. +0 −14 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/dialog/DialogFragmentTags.java
  14. +39 −41 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/dialog/URLPickerFragment.java
  15. +140 −87 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/jni/Native.java
  16. +24 −26 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/sound/SoundManager.java
  17. +0 −10 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/startup/IStartup.java
  18. +11 −0 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/startup/LoadResult.java
  19. +66 −47 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/startup/Startup.java
  20. +63 −43 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/startup/StartupConstants.java
  21. +20 −18 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/utils/Dimension.java
  22. +8 −5 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/utils/MiscUtils.java
  23. +13 −9 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/utils/StringUtils.java
  24. +0 −126 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/utils/debug/DebugUtils.java
  25. +32 −20 ...ld_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/utils/screen/ScreenDimensions.java
  26. +60 −55 ...Studio/app/src/main/java/com/newtonforever/einstein/utils/screen/ScreenDimensionsInitializer.java
  27. +76 −65 _Build_/AndroidStudio/app/src/main/java/com/newtonforever/einstein/view/EinsteinView.java
  28. +0 −7 _Build_/AndroidStudio/app/src/main/res/layout/{actions.xml → actions_activity.xml}
  29. +3 −3 _Build_/AndroidStudio/app/src/main/res/values/colors.xml
  30. +1 −1 _Build_/AndroidStudio/app/src/main/res/values/styles.xml
  31. +9 −1 _Build_/AndroidStudio/build.gradle
  32. +2 −2 _Build_/AndroidStudio/gradle/wrapper/gradle-wrapper.properties
  33. +2 −2 app/TAndroidApp.cp
@@ -9,6 +9,13 @@ DerivedData/
*.moved-aside
*.xcuserdatad
.DS_Store
_Build_/Jam/build.LINUX/
_Build_/CMake/
!_Build/CMake/build.sh
/_Build_/Jam/build.LINUX/
/_Build_/CMake/
!/_Build/CMake/build.sh
/K/_Build_/Jam/build.LINUX
/_Build_/AndroidStudio/app/.externalNativeBuild
/_Build_/AndroidStudio/build
/_Build_/AndroidStudio/.gradle
/_Build_/AndroidStudio/.idea
/_Build_/AndroidStudio/local.properties
*.iml

This file was deleted.

@@ -1,24 +1,24 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion '25.0.0'
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.newtonforever.einstein"
minSdkVersion 15
targetSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
arguments "-DANDROID_STL=c++_shared"
cppFlags "-fexceptions -Wno-multichar -DTARGET_OS_ANDROID=1 -O3"
cFlags "-fexceptions -Wno-multichar -DTARGET_OS_ANDROID=1 -O3"
}
}
ndk {
// abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a'
abiFilters 'x86', 'armeabi', 'armeabi-v7a'
abiFilters 'x86', 'armeabi-v7a'
}

}
@@ -33,13 +33,20 @@ android {
path "CMakeLists.txt"
}
}
lintOptions {
disable 'MissingTranslation'
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:27.1.1'
testImplementation 'junit:junit:4.12'
}
@@ -26,7 +26,7 @@
android:label="@string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar">
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
@@ -36,15 +36,15 @@
android:name="com.newtonforever.einstein.activity.ActionsActivity"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Dialog">
android:theme="@style/Theme.AppCompat.Dialog">
</activity>
<activity android:name="com.newtonforever.einstein.activity.EinsteinPreferencesActivity">
</activity>
<activity
android:name="com.newtonforever.einstein.activity.LoadPackageActivity"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Dialog">
android:theme="@style/Theme.AppCompat.Dialog">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>

@@ -146,6 +146,7 @@
</activity>

<service
android:exported="false"
android:name="com.newtonforever.einstein.EinsteinService"
android:process=":remote">
<intent-filter>
@@ -2,26 +2,28 @@

import com.newtonforever.einstein.jni.Native;

/** Class interfacing to the native Einstein emulator.
* @author Matthias Melcher */
public class Einstein
{
/** Load the entire native program as a library at startup. */
static {
System.loadLibrary("native-lib");
}
private boolean pRunning = false;
/**
* Class interfacing to the native Einstein emulator.
*
* @author Matthias Melcher
*/
public class Einstein {
/* Load the entire native program as a library at startup. */
static {
System.loadLibrary("native-lib");
}

public void run(String dataPath, int screenWidth, int screenHeight)
{
Native.runEmulator(dataPath, screenWidth, screenHeight);
this.pRunning = true;
}

/** Returns <code>true</code> if the emulator is currently running. */
public boolean isRunning()
{
return this.pRunning;
}
private boolean isRunning = false;

public void run(String dataPath, int screenWidth, int screenHeight) {
Native.runEmulator(dataPath, screenWidth, screenHeight);
isRunning = true;
}

/**
* Returns <code>true</code> if the emulator is currently running.
*/
public boolean isRunning() {
return isRunning;
}
}
@@ -82,69 +82,64 @@

/**
* This class provides resources that must be available for the lifetime of this app.
*
* @author Matthias Melcher
*
* @author Matthias Melcher
*/
public class EinsteinApplication extends Application {

private Einstein pEinstein = null;

/**
* Get a link to the native emulator interface.
*
* @return access to the emulator
*/
public Einstein getEinstein()
{
return pEinstein;
}

/**
* Initialize what we need besides the Activity.
*
* Create the Einstein instance that is shared across Activities.
* Create a Service that will keep this app in the foreground as
* long as possible to avoid lengty emulator reboots.
*/
@Override
public void onCreate()
{
//Log.i("einstein", "--------> App.onCreate()");

super.onCreate();

// create and load the Emulator
pEinstein = new Einstein();

// create the keep-alive Service (will be created asynchronously)
Intent intent = new Intent(getApplicationContext(), EinsteinService.class);
intent.putExtra("task", EinsteinService.TASK_LAUNCH);
ComponentName name = startService(intent);
if (name==null) {
Log.i("einstein", "--------< App.onCreate() - CANT LAUNCH SERVICE");
}
//Log.i("einstein", "--------< App.onCreate()");
}

/**
* Use the Service to keep this application around as long as possible.
*/
public void raisePriority()
{
Intent intent = new Intent(getApplicationContext(), EinsteinService.class);
private Einstein pEinstein = null;

/**
* Get a link to the native emulator interface.
*
* @return access to the emulator
*/
public Einstein getEinstein() {
return pEinstein;
}

/**
* Initialize what we need besides the Activity.
* <p>
* Create the Einstein instance that is shared across Activities.
* Create a Service that will keep this app in the foreground as
* long as possible to avoid lengty emulator reboots.
*/
@Override
public void onCreate() {
//Log.i("einstein", "--------> App.onCreate()");

super.onCreate();

// create and load the Emulator
pEinstein = new Einstein();

// create the keep-alive Service (will be created asynchronously)
Intent intent = new Intent(getApplicationContext(), EinsteinService.class);
intent.putExtra("task", EinsteinService.TASK_LAUNCH);
ComponentName name = startService(intent);
if (name == null) {
Log.i("einstein", "--------< App.onCreate() - CANT LAUNCH SERVICE");
}
//Log.i("einstein", "--------< App.onCreate()");
}

/**
* Use the Service to keep this application around as long as possible.
*/
public void raisePriority() {
Intent intent = new Intent(getApplicationContext(), EinsteinService.class);
intent.putExtra("task", EinsteinService.TASK_RAISE_PRIORITY);
startService(intent);
}

/**
* Return this app to normal priority by sending the service to the background.
*/
public void normalPriority()
{
Intent intent = new Intent(getApplicationContext(), EinsteinService.class);
startService(intent);
}

/**
* Return this app to normal priority by sending the service to the background.
*/
public void normalPriority() {
Intent intent = new Intent(getApplicationContext(), EinsteinService.class);
intent.putExtra("task", EinsteinService.TASK_NORMAL_PRIORITY);
startService(intent);
}
startService(intent);
}

}

0 comments on commit 0fe3bbf

Please sign in to comment.
You can’t perform that action at this time.