diff --git a/changes b/changes index 957ca93fbdbe6357ce8744e13ffb52b8f7f737ed..6e189f7b09b1f8b2a6401b600d6370822a1e2a94 100644 --- a/changes +++ b/changes @@ -2,7 +2,6 @@ ANDROID - handle pinch gesture to zoom score in/out - touching screen suspends pitch detection - - application can restart itself to restore initial settings - updated Qt version to 5.6.1 BUGS FIXES - prevent stopping input sound randomly @@ -11,14 +10,14 @@ 1.2.7 Nootka says: I speak Spanish - translated to Spanish language - - better handling input audio data, increased buffer size - - less fragmented pitch detection, if any + - better method of handling input audio data, increased buffer size - forwarding input to output works with every sound system now BUGS FIXES - fixed reason of random crashes when audio input started - repaired starting exam with melodies from single note mode view + - file descriptions are translated under Mac Os Finder - fixed deb package compatibility with Ubuntu 16.04 - - minor fixes + - other minor fixes 1.2A.6 rc2 Google Play(s) with Nootka diff --git a/src/android/src/net/sf/nootka/TexternalStorage.java b/src/android/src/net/sf/nootka/TexternalStorage.java new file mode 100644 index 0000000000000000000000000000000000000000..d9eb375d425e60688b6f0d40b427d7c4cfe38da6 --- /dev/null +++ b/src/android/src/net/sf/nootka/TexternalStorage.java @@ -0,0 +1,43 @@ +/*************************************************************************** + * 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 * + * 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/>. * + ***************************************************************************/ + +package net.sf.nootka; + +import java.lang.Object; +import java.io.File; +import android.os.Environment; + + +public class TexternalStorage +{ + + public static boolean isWritable() { + String state = Environment.getExternalStorageState(); + if (Environment.MEDIA_MOUNTED.equals(state)) { + return true; + } + return false; + } + + public static String get() { + File docDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS); + docDir.mkdirs(); + return docDir.getPath(); + } + +} diff --git a/src/android/src/net/sf/nootka/Tusers.java b/src/android/src/net/sf/nootka/Tusers.java new file mode 100644 index 0000000000000000000000000000000000000000..b34a3b4adc6a5b8c7d54baa3f30869f669f0dfad --- /dev/null +++ b/src/android/src/net/sf/nootka/Tusers.java @@ -0,0 +1,72 @@ +/*************************************************************************** + * 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 * + * 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/>. * + ***************************************************************************/ + +package net.sf.nootka; + +import android.accounts.Account; +import android.accounts.AccountManager; +import android.content.Context; + + +public class Tusers { + + public static String getEmail(Context context) { + AccountManager accountManager = AccountManager.get(context); + Account account = getAccount(accountManager); + + if (account == null) { + return null; + } else { + return account.name; + } + } + + + public static String getUserName(Context context) { + AccountManager manager = AccountManager.get(context); + Account account = getAccount(manager); + if (account == null) { + return ""; + } else { + String email = account.name; + String[] parts = email.split("@"); + if (parts.length > 0 && parts[0] != null) + return parts[0]; + else + return ""; + } + } + +//################################################################################################# +//################### PRIVATE ############################################ +//################################################################################################# + + private static Account getAccount(AccountManager accountManager) { + Account[] accounts = accountManager.getAccountsByType("com.google"); + Account account; + if (accounts.length > 0) { + account = accounts[0]; + } else { + account = null; + } + return account; + } + +} + +