Skip to content

Commit

Permalink
- First stable version!
Browse files Browse the repository at this point in the history
- Channel assignment is now faster
- Changes to the SSL certificate of server
- Loading times at server edit screen have been reduced a lot
- Server creation for demo users can also be done offline now
- Minor UI changes
- Contact Info now opens http://www.qrptt.com webpage
- Changed some typos

Merge branch 'master' of https://github.com/Theofilos-Chamalis/QR-PTT-PushToTalk

Conflicts:
	app/src/main/java/com/terracom/qrpttbeta/servers/ServerEditFragment.java
  • Loading branch information
Theofilos-Chamalis committed Mar 9, 2015
2 parents db3bbe8 + 427bdd3 commit 65cfb18
Show file tree
Hide file tree
Showing 374 changed files with 1,363 additions and 8,517 deletions.
Empty file modified LICENSE
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ QR-PTT PushToTalk
=======

QR-PTT PushToTalk is an easy to use ptt over IP Android client for voice and text communication that uses the [Jumble] (https://github.com/Morlunk/Jumble) protocol implementation and has a GPLv3 license. It can be used by companies that need to be in constant communication with their employees (Lone Workers), to give instructions, make comments, report incidents in real time by voice communication or by sending a text message within the app.
<br/>To try it for free enter "demo" as Guard ID and leave Guard PIN field empty.*
<br/>To try it for free enter "demo" as User ID and leave User PIN field empty.*

Its main features are:
- Easy to use
Expand Down
32 changes: 2 additions & 30 deletions app/build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
/*
* Copyright (C) 2014 Andrew Comminos
*
* 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/>.
*/









buildscript {
repositories {
mavenCentral()
Expand Down Expand Up @@ -51,8 +26,6 @@ dependencies {
compile files('/home/theo/git/QRPushToTalk/libraries/gson-2.3.1.jar')
}


// Keep my credentials private :^)
def signingFile = file 'signing.gradle';
if (signingFile.exists()) apply from: 'signing.gradle'

Expand All @@ -64,8 +37,8 @@ android {
minSdkVersion 14
targetSdkVersion 21
applicationId "com.terracom.qrpttbeta"
versionCode 80
versionName "0.9.0"
versionCode 82
versionName "1.0.0"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
buildConfigField "boolean", "DONATE_NAG", "false"
}
Expand All @@ -82,7 +55,6 @@ android {
}

jenkins {
// Abuse Jenkins environment variables. Neat.
def env = System.getenv()
if (env.containsKey("BUILD_NUMBER") && env.containsKey("BUILD_DISPLAY_NAME")) {
versionCode Integer.parseInt(env.get("BUILD_NUMBER"))
Expand Down
9 changes: 1 addition & 8 deletions app/src/androidTest/java/com/terracom/qrpttbeta/test/QRPushToTalkSQLTestCase.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@

import java.util.UUID;

/**
* Test case designed to test operations of QRPushToTalk's database.
* A new DB is created and destroyed with each test call.
* Created by andrew on 19/08/14.
*/
public class QRPushToTalkSQLTestCase extends AndroidTestCase {
/** Database name used in the active test. */

private String mDatabaseName;
/** Database for the active test. */
private QRPushToTalkSQLiteDatabase mDatabase;

@Override
Expand All @@ -57,7 +51,6 @@ public void testLocalMuteIgnore() {
long server = 5;
int userId = 1;

// Test ignore duplicate constraint
for (int i = 0; i < 2; i++) {
mDatabase.addLocalMutedUser(server, userId);
mDatabase.addLocalIgnoredUser(server, userId);
Expand Down
18 changes: 0 additions & 18 deletions app/src/free/AndroidManifest.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright (C) 2014 Andrew Comminos
~
~ 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/>.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
Expand Down
Empty file modified app/src/free/ic_launcher-web.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/free/res/drawable-hdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/free/res/drawable-mdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/free/res/drawable-xhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/free/res/drawable-xxhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/free/res/drawable-xxxhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 1 addition & 18 deletions app/src/free/res/values/strings.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Andrew Comminos
~
~ 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/>.
-->

<resources>
<string name="app_name">QR PushToTalk BETA</string>
<string name="app_name">QR-PTT PushToTalk</string>
</resources>
17 changes: 0 additions & 17 deletions app/src/free/res/xml/searchable.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Andrew Comminos
~
~ 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/>.
-->

<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/app_name"
android:hint="@string/searchHint"
Expand Down
22 changes: 0 additions & 22 deletions app/src/main/AndroidManifest.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Andrew Comminos
~
~ 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/>.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.terracom.qrpttbeta" >

Expand Down Expand Up @@ -74,12 +58,6 @@
android:name="com.terracom.qrpttbeta.service.QRPushToTalkService"
android:enabled="true" />

<!--
USE THEM IN THE ACTIVITY BELOW TO REMOVE FROM RECENTS
android:excludeFromRecents="true"
android:noHistory="true"
android:taskAffinity=""
-->
<activity
android:name="com.terracom.qrpttbeta.app.QRPushToTalkActivity"
android:label="@string/app_name"
Expand Down
17 changes: 0 additions & 17 deletions app/src/main/java/com/terracom/qrpttbeta/Constants.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/*
* Copyright (C) 2014 Andrew Comminos
*
* 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 com.terracom.qrpttbeta;

public class Constants {
Expand Down
81 changes: 9 additions & 72 deletions app/src/main/java/com/terracom/qrpttbeta/Settings.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/*
* Copyright (C) 2014 Andrew Comminos
*
* 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 com.terracom.qrpttbeta;

import android.content.Context;
Expand All @@ -31,18 +14,11 @@
import java.util.HashSet;
import java.util.Set;

/**
* Singleton settings class for universal access to the app's preferences.
* @author terracom
*/
public class Settings {
public static final String PREF_INPUT_METHOD = "audioInputMethod";
public static final Set<String> ARRAY_INPUT_METHODS;
/** Voice activity transmits depending on the amplitude of user input. */
public static final String ARRAY_INPUT_METHOD_VOICE = "voiceActivity";
/** Push to talk transmits on command. */
public static final String ARRAY_INPUT_METHOD_PTT = "ptt";
/** Continuous transmits always. */
public static final String ARRAY_INPUT_METHOD_CONTINUOUS = "continuous";

public static final String PREF_THRESHOLD = "vadThreshold";
Expand Down Expand Up @@ -84,10 +60,6 @@ public class Settings {
public static final Boolean DEFAULT_AUTO_RECONNECT = true;

public static final String PREF_THEME = "theme";
public static final String ARRAY_THEME_LIGHT = "lightDark";
public static final String ARRAY_THEME_DARK = "dark";
public static final String ARRAY_THEME_SOLARIZED_LIGHT = "solarizedLight";
public static final String ARRAY_THEME_SOLARIZED_DARK = "solarizedDark";

public static final String PREF_CERT = "certificatePath";
public static final String PREF_CERT_PASSWORD = "certificatePassword";
Expand Down Expand Up @@ -152,20 +124,13 @@ private Settings(Context ctx) {
}

public String getInputMethod() {
//String method = preferences.getString(PREF_INPUT_METHOD, ARRAY_INPUT_METHOD_VOICE);
String method = preferences.getString(PREF_INPUT_METHOD,ARRAY_INPUT_METHOD_PTT);
if(!ARRAY_INPUT_METHODS.contains(method)) {
// Set default method for users who used to use handset mode before removal.
//method = ARRAY_INPUT_METHOD_VOICE;
String method = preferences.getString(PREF_INPUT_METHOD, ARRAY_INPUT_METHOD_PTT);
if (!ARRAY_INPUT_METHODS.contains(method)) {
method = ARRAY_INPUT_METHOD_PTT;
}
return method;
}

/**
* Converts the preference input method value to the one used to connect to a server via Jumble.
* @return An input method value used to instantiate a Jumble service.
*/
public int getJumbleInputMethod() {
String inputMethod = getInputMethod();
if (ARRAY_INPUT_METHOD_VOICE.equals(inputMethod)) {
Expand All @@ -179,7 +144,7 @@ public int getJumbleInputMethod() {
}

public void setInputMethod(String inputMethod) {
if(ARRAY_INPUT_METHOD_VOICE.equals(inputMethod) ||
if (ARRAY_INPUT_METHOD_VOICE.equals(inputMethod) ||
ARRAY_INPUT_METHOD_PTT.equals(inputMethod) ||
ARRAY_INPUT_METHOD_CONTINUOUS.equals(inputMethod)) {
preferences.edit().putString(PREF_INPUT_METHOD, "ptt").apply();
Expand All @@ -197,11 +162,11 @@ public int getInputQuality() {
}

public float getAmplitudeBoostMultiplier() {
return (float)preferences.getInt(Settings.PREF_AMPLITUDE_BOOST, DEFAULT_AMPLITUDE_BOOST)/100;
return (float) preferences.getInt(Settings.PREF_AMPLITUDE_BOOST, DEFAULT_AMPLITUDE_BOOST) / 100;
}

public float getDetectionThreshold() {
return (float)preferences.getInt(PREF_THRESHOLD, DEFAULT_THRESHOLD)/100;
return (float) preferences.getInt(PREF_THRESHOLD, DEFAULT_THRESHOLD) / 100;
}

public int getPushToTalkKey() {
Expand All @@ -212,58 +177,30 @@ public String getHotCorner() {
return preferences.getString(PREF_HOT_CORNER_KEY, DEFAULT_HOT_CORNER);
}

/**
* Returns whether or not the hot corner is enabled.
* @return true if a hot corner should be shown.
*/
public boolean isHotCornerEnabled() {
return !ARRAY_HOT_CORNER_NONE.equals(preferences.getString(PREF_HOT_CORNER_KEY, DEFAULT_HOT_CORNER));
}

/**
* Returns the view gravity of the hot corner, or 0 if hot corner is disabled.
* @return A {@link android.view.Gravity} value, or 0 if disabled.
*/
public int getHotCornerGravity() {
String hc = getHotCorner();
if(ARRAY_HOT_CORNER_BOTTOM_LEFT.equals(hc)) {
if (ARRAY_HOT_CORNER_BOTTOM_LEFT.equals(hc)) {
return Gravity.LEFT | Gravity.BOTTOM;
} else if(ARRAY_HOT_CORNER_BOTTOM_RIGHT.equals(hc)) {
} else if (ARRAY_HOT_CORNER_BOTTOM_RIGHT.equals(hc)) {
return Gravity.RIGHT | Gravity.BOTTOM;
} else if(ARRAY_HOT_CORNER_TOP_LEFT.equals(hc)) {
} else if (ARRAY_HOT_CORNER_TOP_LEFT.equals(hc)) {
return Gravity.LEFT | Gravity.TOP;
} else if(ARRAY_HOT_CORNER_TOP_RIGHT.equals(hc)) {
} else if (ARRAY_HOT_CORNER_TOP_RIGHT.equals(hc)) {
return Gravity.RIGHT | Gravity.TOP;
}
return 0;
}

/**
* @return the resource ID of the user-defined theme.
*/
/*public int getTheme() {
String theme = preferences.getString(PREF_THEME, ARRAY_THEME_LIGHT);
if(ARRAY_THEME_LIGHT.equals(theme))
return R.style.Theme_QRPushToTalk;
else if(ARRAY_THEME_DARK.equals(theme))
return R.style.Theme_QRPushToTalk_Dark;
else if(ARRAY_THEME_SOLARIZED_LIGHT.equals(theme))
return R.style.Theme_QRPushToTalk_Solarized_Light;
else if(ARRAY_THEME_SOLARIZED_DARK.equals(theme))
return R.style.Theme_QRPushToTalk_Solarized_Dark;
return -1;
}*/

public int getTheme() {

return R.style.Theme_QRPushToTalk_Solarized_Light;

}

/**
* Attempts to read the certificate from the path specified in settings.
* @return The parsed bytes of the certificate, or null otherwise.
*/
public byte[] getCertificate() {
try {
FileInputStream inputStream = new FileInputStream(preferences.getString(PREF_CERT, ""));
Expand Down
Loading

0 comments on commit 65cfb18

Please sign in to comment.