Skip to content
Snippets Groups Projects
Commit 882597c5 authored by SeeLook's avatar SeeLook
Browse files

Trying to add detecting user name of Android - failed so far.

parent d0f77b15
No related branches found
No related tags found
No related merge requests found
/***************************************************************************
* Copyright (C) 2016 by Tomasz Bojczuk *
* seelook@gmail.com *
* Copyright (C) 2016 by Tomasz Bojczuk *
* seelook@gmail.com *
* *
* 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 *
......@@ -12,7 +12,7 @@
* 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 *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
......@@ -28,11 +28,12 @@ import android.net.Uri;
public class TshareExam
{
/** @fn send(String title, String message, String filePath)
/**
* @fn send(String title, String message, String filePath)
* Displays chooser dialog to send/share exam file
* @p title - is head text of that dialog
* @p message - is message content when send by email was chosen.
*/
*/
public static void send(String title, String message, String filePath) {
if (QtNative.activity() == null)
return;
......@@ -49,4 +50,4 @@ public class TshareExam
QtNative.activity().startActivity(Intent.createChooser(shareIntent, title));
}
}
\ No newline at end of file
}
......@@ -116,7 +116,14 @@ void Tandroid::sendExam(const QString& title, const QString &message, const QStr
QString Tandroid::accountName() {
return "fake";
// QAndroidJniObject::callStaticMethod<void>(
// "net/sf/nootka/Tusers", "getUserName",
// "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V",
// jTitle.object<jstring>(), jMessage.object<jstring>(), jFile.object<jstring>());
QAndroidJniObject juser = QtAndroid::androidActivity().callObjectMethod("getUser", "()Ljava/lang/String;");
return juser.toString();
// return "fake";
// return QAndroidJniObject::callStaticObjectMethod<jstring>
// ("net/sf/nootka/account",
// "getName").toString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment