This repository has been archived by the owner on May 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66cff3a
commit 961f4e6
Showing
10 changed files
with
198 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.DS_Store | ||
orion.pro.user* | ||
build | ||
android | ||
android/gradle* | ||
android/local* | ||
android/build* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?xml version="1.0"?> | ||
<manifest package="app.orion.android" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.1" android:versionCode="3" android:installLocation="auto"> | ||
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Orion" android:icon="@drawable/icon"> | ||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="com.orion.MainActivity" android:label="Orion" android:screenOrientation="unspecified" android:launchMode="singleTop"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
|
||
<!-- Application arguments --> | ||
<!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ --> | ||
<!-- Application arguments --> | ||
|
||
<meta-data android:name="android.app.lib_name" android:value="orion"/> | ||
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/> | ||
<meta-data android:name="android.app.repository" android:value="default"/> | ||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/> | ||
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/> | ||
<!-- Deploy Qt libs as part of package --> | ||
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/> | ||
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/> | ||
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/> | ||
<!-- Run with local libs --> | ||
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/> | ||
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/> | ||
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/> | ||
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/> | ||
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/> | ||
<!-- Messages maps --> | ||
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/> | ||
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/> | ||
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/> | ||
<!-- Messages maps --> | ||
|
||
<!-- Splash screen --> | ||
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/> | ||
<!-- Splash screen --> | ||
|
||
<!-- Background running --> | ||
<!-- Warning: changing this value to true may cause unexpected crashes if the | ||
application still try to draw after | ||
"applicationStateChanged(Qt::ApplicationSuspended)" | ||
signal is sent! --> | ||
<meta-data android:name="android.app.background_running" android:value="true"/> | ||
<!-- Background running --> | ||
|
||
<!-- auto screen scale factor --> | ||
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="true"/> | ||
<!-- auto screen scale factor --> | ||
|
||
<!-- extract android style --> | ||
<!-- available android:values : | ||
* full - useful QWidget & Quick Controls 1 apps | ||
* minimal - useful for Quick Controls 2 apps, it is much faster than "full" | ||
* none - useful for apps that don't use any of the above Qt modules | ||
--> | ||
<meta-data android:name="android.app.extract_android_style" android:value="minimal"/> | ||
<!-- extract android style --> | ||
</activity> | ||
|
||
<!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices --> | ||
|
||
</application> | ||
|
||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="21"/> | ||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> | ||
|
||
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application. | ||
Remove the comment if you do not require these default permissions. --> | ||
|
||
|
||
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application. | ||
Remove the comment if you do not require these default features. --> | ||
|
||
|
||
|
||
<!-- %%INSERT_PERMISSIONS --> | ||
<uses-permission android:name="android.permission.WAKE_LOCK"/> | ||
</manifest> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="rectangle" > | ||
<solid android:color="#000000"/> | ||
</shape> | ||
</item> | ||
<item> | ||
<bitmap android:src="@drawable/logo" | ||
android:gravity="center" /> | ||
</item> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.orion; | ||
|
||
import org.qtproject.qt5.android.bindings.QtActivity; | ||
import android.os.*; | ||
import android.os.PowerManager; | ||
import android.content.*; | ||
import android.app.*; | ||
import android.util.Log; | ||
|
||
public class MainActivity extends QtActivity | ||
{ | ||
private static MainActivity instance = null; | ||
private static PowerManager.WakeLock wl = null; | ||
|
||
/**Native C++ method calls*/ | ||
|
||
/**Singleton getter*/ | ||
public static MainActivity getInstance() { | ||
if (instance == null) | ||
instance = new MainActivity(); | ||
return instance; | ||
} | ||
|
||
/**Activity callbacks*/ | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
logMsg("Created MainActivity!"); | ||
instance = this; | ||
} | ||
|
||
/**Wakelock methods -- not in use --*/ | ||
public static void acquireWakeLock() { | ||
if (wl == null) { | ||
PowerManager pm = (PowerManager) (getInstance().getSystemService(Context.POWER_SERVICE)); | ||
// assert(pm.isWakeLockLevelSupported(PowerManager.PARTIAL_WAKE_LOCK)); | ||
wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "OrionWakeLock"); | ||
wl.acquire(); | ||
|
||
if (wl.isHeld()) | ||
logMsg("acquired wakelock!"); | ||
else | ||
logMsg("failed to acquire wakelock!"); | ||
} | ||
} | ||
public static void releaseWakeLock() { | ||
if (wl != null) { | ||
wl.release(); | ||
wl = null; | ||
logMsg("released wakelock"); | ||
} | ||
} | ||
|
||
/**Logger*/ | ||
public static void logMsg(String msg) { | ||
Log.w("LOG", msg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters