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.
This commit is contained in:
codestation
2013-12-29 11:05:04 -04:30
parent 9c7c2bc3d7
commit ce9353e4f3
10 changed files with 161 additions and 0 deletions

45
src/androidmessage.cpp Normal file
View File

@@ -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>());
}

36
src/androidmessage.h Normal file
View File

@@ -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

View File

@@ -28,7 +28,13 @@
#ifdef Q_OS_WIN32
#include <windows.h>
#else
#ifndef __ANDROID__
#include <sys/statvfs.h>
#else
#include <sys/vfs.h>
#define statvfs statfs
#define fstatvfs fstatfs
#endif
#endif
bool getDiskSpace(const QString &dir, quint64 *free, quint64 *total)