This repository has been archived by the owner on Jul 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added android manifest and launcher icons.
Do not use pkg-config when cross-compiling to Android. Added a helper class to send toasts and dialogs to the user. Added android compatibility on some headers.
- Loading branch information
1 parent
9c7c2bc
commit ce9353e
Showing
10 changed files
with
161 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.2.5" android:installLocation="auto" package="com.github.codestation.qcma" android:versionCode="1"> | ||
<application android:label="qcma" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:icon="@drawable/icon"> | ||
<activity android:screenOrientation="unspecified" android:label="@string/app_name" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
<meta-data android:value="qcma" android:name="android.app.lib_name"/> | ||
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/> | ||
<meta-data android:value="default" android:name="android.app.repository"/> | ||
<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:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --" android:name="android.app.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:value="-- %%USE_LOCAL_QT_LIBS%% --" android:name="android.app.use_local_qt_libs"/> | ||
<meta-data android:value="/data/local/tmp/qt/" android:name="android.app.libs_prefix"/> | ||
<meta-data android:value="-- %%INSERT_LOCAL_LIBS%% --" android:name="android.app.load_local_libs"/> | ||
<meta-data android:value="-- %%INSERT_LOCAL_JARS%% --" android:name="android.app.load_local_jars"/> | ||
<meta-data android:value="-- %%INSERT_INIT_CLASSES%% --" android:name="android.app.static_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" android:resource="@layout/splash"/> | ||
<!-- Splash screen --> | ||
</activity> | ||
</application> | ||
<uses-sdk android:targetSdkVersion="19" android:minSdkVersion="10"/> | ||
<supports-screens android:normalScreens="true" android:smallScreens="true" android:largeScreens="true" android:anyDensity="true"/> | ||
<!-- %%INSERT_PERMISSIONS --> | ||
<!-- %%INSERT_FEATURES --> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
</manifest> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions
34
android/src/com/github/codestation/qcma/QcmaNotification.java
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,34 @@ | ||
package com.github.codestation.qcma; | ||
|
||
import android.content.Context; | ||
import android.content.DialogInterface; | ||
import android.widget.Toast; | ||
import android.app.AlertDialog; | ||
|
||
public class QcmaNotification extends org.qtproject.qt5.android.bindings.QtActivity | ||
{ | ||
private static QcmaNotification m_instance; | ||
|
||
public QcmaNotification() | ||
{ | ||
m_instance = this; | ||
} | ||
|
||
public static void showToast(String message) | ||
{ | ||
Context context = m_instance.getApplicationContext(); | ||
Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT); | ||
toast.show(); | ||
} | ||
|
||
public static void showDialog(String message) | ||
{ | ||
AlertDialog.Builder builder = new AlertDialog.Builder(m_instance); | ||
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { | ||
public void onClick(DialogInterface dialog, int id) { | ||
} | ||
}); | ||
builder.setMessage(message).setTitle("QCMA message"); | ||
AlertDialog dialog = builder.create(); | ||
} | ||
} |
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,45 @@ | ||
/* | ||
* QCMA: Cross-platform content manager assistant for the PS Vita | ||
* | ||
* Copyright (C) 2013 Codestation | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "androidmessage.h" | ||
|
||
#include <QtAndroidExtras/QAndroidJniObject> | ||
|
||
AndroidMessage::AndroidMessage(QObject *parent) : | ||
QObject(parent) | ||
{ | ||
} | ||
|
||
void AndroidMessage::showToast(const QString &message) | ||
{ | ||
QAndroidJniObject javaMessage = QAndroidJniObject::fromString(message); | ||
QAndroidJniObject::callStaticMethod<void>("com/github/codestation/qcma/QcmaNotification", | ||
"showToast", | ||
"(Ljava/lang/String;)V", | ||
javaMessage.object<jstring>()); | ||
} | ||
|
||
void AndroidMessage::showDialog(const QString &message) | ||
{ | ||
QAndroidJniObject javaMessage = QAndroidJniObject::fromString(message); | ||
QAndroidJniObject::callStaticMethod<void>("com/github/codestation/qcma/QcmaNotification", | ||
"showDialog", | ||
"(Ljava/lang/String;)V", | ||
javaMessage.object<jstring>()); | ||
} |
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,36 @@ | ||
/* | ||
* QCMA: Cross-platform content manager assistant for the PS Vita | ||
* | ||
* Copyright (C) 2013 Codestation | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef ANDROIDMESSAGE_H | ||
#define ANDROIDMESSAGE_H | ||
|
||
#include <QObject> | ||
|
||
class AndroidMessage : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit AndroidMessage(QObject *parent = 0); | ||
|
||
public slots: | ||
void showToast(const QString &message); | ||
void showDialog(const QString &message); | ||
}; | ||
|
||
#endif // ANDROIDMESSAGE_H |
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