diff --git a/.gitignore b/.gitignore
index 1756639..2300e17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,33 +1,14 @@
-# Built application files
*.apk
*.ap_
-
-# Files for the Dalvik VM
*.dex
-
-# Java class files
*.class
-
-# Generated files
bin/
gen/
-
-# Gradle files
.gradle/
build/
-
-# Local configuration file (sdk path, etc)
local.properties
-
-# Proguard folder generated by Eclipse
proguard/
-
-# Log Files
*.log
-
-#.idea directory
.idea/
-
-# IntelliJ IDEA Files
*.iml
app/app.iml
diff --git a/MorseConverter.iml b/MorseConverter.iml
index 0bb6048..0735af2 100644
--- a/MorseConverter.iml
+++ b/MorseConverter.iml
@@ -1,9 +1,10 @@
-
+
+
@@ -15,5 +16,4 @@
-
-
+
\ No newline at end of file
diff --git a/app/app.iml b/app/app.iml
index 939c9cf..670212a 100644
--- a/app/app.iml
+++ b/app/app.iml
@@ -1,5 +1,5 @@
-
+
@@ -12,8 +12,9 @@
-
+
+
@@ -84,15 +85,15 @@
-
+
+
-
-
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 85d73ea..9c2c176 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 21
- buildToolsVersion "21.1.2"
+ compileSdkVersion 22
+ buildToolsVersion "22.0.1"
defaultConfig {
applicationId "de.marcelkapfer.morseconverter"
minSdkVersion 11
- targetSdkVersion 21
- versionCode 4
- versionName "2.1"
+ targetSdkVersion 22
+ versionCode 220
+ versionName "2.2 beta"
}
buildTypes {
release {
@@ -26,9 +26,10 @@ repositories {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.android.support:appcompat-v7:21.0.3'
+ compile 'com.android.support:appcompat-v7:22.0.+'
compile 'it.neokree:MaterialNavigationDrawer:1.3.3'
compile 'com.android.support:cardview-v7:21.0.3'
- compile 'com.android.support:support-v4:21.0.3'
+ compile 'com.android.support:support-v4:22.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
+ compile 'com.anjlab.android.iab.v3:library:1.0.+@aar'
}
diff --git a/app/manifest-merger-release-report.txt b/app/manifest-merger-release-report.txt
index 5736929..28c0aa0 100644
--- a/app/manifest-merger-release-report.txt
+++ b/app/manifest-merger-release-report.txt
@@ -1,8 +1,6 @@
-- Merging decision tree log ---
manifest
ADDED from AndroidManifest.xml:23:1
- xmlns:android
- ADDED from AndroidManifest.xml:23:11
package
ADDED from AndroidManifest.xml:24:5
INJECTED from AndroidManifest.xml:0:0
@@ -10,19 +8,24 @@ ADDED from AndroidManifest.xml:23:1
android:versionName
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
+ xmlns:android
+ ADDED from AndroidManifest.xml:23:11
android:versionCode
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
application
ADDED from AndroidManifest.xml:26:5
-MERGED from com.android.support:appcompat-v7:21.0.3:16:5
-MERGED from com.android.support:support-v4:21.0.3:16:5
-MERGED from it.neokree:MaterialNavigationDrawer:1.3:14:5
-MERGED from com.github.markushi:android-ui:1.2:9:5
-MERGED from com.android.support:appcompat-v7:21.0.3:16:5
-MERGED from com.android.support:support-v4:21.0.3:16:5
+MERGED from com.android.support:appcompat-v7:22.0.0:22:5
+MERGED from com.android.support:support-v4:22.0.0:22:5
+MERGED from it.neokree:MaterialNavigationDrawer:1.3.3:14:5
+MERGED from com.android.support:appcompat-v7:22.0.0:22:5
+MERGED from com.android.support:support-v4:22.0.0:22:5
+MERGED from com.balysv:material-ripple:1.0.1:12:5
MERGED from com.android.support:cardview-v7:21.0.3:16:5
-MERGED from com.android.support:support-v4:21.0.3:16:5
+MERGED from com.android.support:support-v4:22.0.0:22:5
+MERGED from com.android.support:recyclerview-v7:21.0.3:17:5
+MERGED from com.android.support:support-v4:22.0.0:22:5
+MERGED from com.anjlab.android.iab.v3:library:1.0.24:13:5
android:label
ADDED from AndroidManifest.xml:29:9
android:allowBackup
@@ -47,21 +50,35 @@ category#android.intent.category.LAUNCHER
ADDED from AndroidManifest.xml:37:17
android:name
ADDED from AndroidManifest.xml:37:27
+uses-permission#com.android.vending.BILLING
+ADDED from AndroidManifest.xml:42:5
+MERGED from com.anjlab.android.iab.v3:library:1.0.24:11:5
+ android:name
+ ADDED from AndroidManifest.xml:42:22
uses-sdk
INJECTED from AndroidManifest.xml:0:0 reason: use-sdk injection requested
-MERGED from com.android.support:appcompat-v7:21.0.3:15:5
-MERGED from com.android.support:support-v4:21.0.3:15:5
-MERGED from it.neokree:MaterialNavigationDrawer:1.3:8:5
-MERGED from com.github.markushi:android-ui:1.2:7:5
-MERGED from com.android.support:appcompat-v7:21.0.3:15:5
-MERGED from com.android.support:support-v4:21.0.3:15:5
+MERGED from com.android.support:appcompat-v7:22.0.0:20:5
+MERGED from com.android.support:support-v4:22.0.0:20:5
+MERGED from it.neokree:MaterialNavigationDrawer:1.3.3:8:5
+MERGED from com.android.support:appcompat-v7:22.0.0:20:5
+MERGED from com.android.support:support-v4:22.0.0:20:5
+MERGED from com.balysv:material-ripple:1.0.1:8:5
MERGED from com.android.support:cardview-v7:21.0.3:15:5
-MERGED from com.android.support:support-v4:21.0.3:15:5
+MERGED from com.android.support:support-v4:22.0.0:20:5
+MERGED from com.android.support:recyclerview-v7:21.0.3:15:5
+MERGED from com.android.support:support-v4:22.0.0:20:5
+MERGED from com.anjlab.android.iab.v3:library:1.0.24:7:5
+ tools:overrideLibrary
+ ADDED from it.neokree:MaterialNavigationDrawer:1.3.3:11:9
android:targetSdkVersion
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
android:minSdkVersion
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
- tools:overrideLibrary
- ADDED from it.neokree:MaterialNavigationDrawer:1.3:11:9
+activity#android.support.v7.widget.TestActivity
+ADDED from com.android.support:recyclerview-v7:21.0.3:18:9
+ android:label
+ ADDED from com.android.support:recyclerview-v7:21.0.3:18:19
+ android:name
+ ADDED from com.android.support:recyclerview-v7:21.0.3:18:60
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 4d7cf08..40e6622 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -39,4 +39,6 @@
+
+
diff --git a/app/src/main/java/de/marcelkapfer/morseconverter/MainActivity.java b/app/src/main/java/de/marcelkapfer/morseconverter/MainActivity.java
index efa2bc4..9560410 100644
--- a/app/src/main/java/de/marcelkapfer/morseconverter/MainActivity.java
+++ b/app/src/main/java/de/marcelkapfer/morseconverter/MainActivity.java
@@ -34,6 +34,9 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;
+import com.anjlab.android.iab.v3.BillingProcessor;
+import com.anjlab.android.iab.v3.TransactionDetails;
+
import de.marcelkapfer.morseconverter.engine.DecodeNormalMorseManager;
import de.marcelkapfer.morseconverter.engine.DecodeWrittenMorseManager;
import de.marcelkapfer.morseconverter.engine.EncodeNormalMorseManager;
@@ -45,29 +48,47 @@ import de.marcelkapfer.morseconverter.fragments.writtenMorseListFragment;
import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer;
import it.neokree.materialnavigationdrawer.elements.MaterialSection;
+import it.neokree.materialnavigationdrawer.elements.listeners.MaterialSectionListener;
import it.neokree.materialnavigationdrawer.util.MaterialActionBarDrawerToggle;
-public class MainActivity extends MaterialNavigationDrawer {
+public class MainActivity extends MaterialNavigationDrawer implements BillingProcessor.IBillingHandler {
//Declaring the Material Sections
- private MaterialSection writtenMorse, normalMorse, writtenMorseList, about;
- MaterialActionBarDrawerToggle mDrawerToggle;
+ private MaterialSection writtenMorse, normalMorse, writtenMorseList, donate, about;
+ private MaterialActionBarDrawerToggle mDrawerToggle;
+
+ BillingProcessor bp;
//The MaterialNavigationDrawer init() methode replaces the normal onCreate() methode
@Override
public void init(Bundle savedInstanceState) {
+
+ bp = new BillingProcessor(this, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkmhshG72hHv9OmduVGxio5jyhC9M4CRGp099vtYHmZGaVCq/hpzUhgu7z/H3ioPSc325W13o3qYGpY4GLwe7MAtnSfTIT2fBu6l3kv9lgyYG0qSnDxZVOikf4Bfj7LE/g1OEr/++MqcD2hg1EBMqIgVyB6qOXgXkrHBSj2pf2Rko1SXNmeZ/MiTFx1VRB0PPRf01hPWU1bxZUizh3hdgWiATuTJCCYR0vpfb4IlQDF5wGS4AGHgIz5Qhh5ZZ+XQDTHv7SDdodSdLc02a/Zy0/9bxTIh8yy/Lg1JbPdh5rvWK/HeEH/wAYmwc8xQoQL264wjTQqKUZ+7iisHwS9ZtowIDAQAB", this);
+
+ // Restore purchases
+ bp.loadOwnedPurchasesFromGoogle();
+
Resources res = getResources();
//Declaring the Material Sections
writtenMorse = this.newSection("writtenMorse", new MainFragment());
normalMorse = this.newSection(res.getString(R.string.normalMorse), new MorseFragment());
- writtenMorseList = this.newSection("writtenMorse Codes", new writtenMorseListFragment()); //TODO rename
+ writtenMorseList = this.newSection("writtenMorse Codes", new writtenMorseListFragment());
about = this.newSection(res.getString(R.string.about), new AboutFragment());
+ donate = this.newSection(res.getString(R.string.donate_title), new MaterialSectionListener() {
+ @Override
+ public void onClick(MaterialSection materialSection) {
+ bp.purchase(MainActivity.this, "donate");
+ donate.unSelect();
+ }
+ }
+ );
//Adding the Sections
this.addSection(writtenMorse);
this.addSection(normalMorse);
this.addDivisor();
this.addSection(writtenMorseList);
+ this.addBottomSection(donate);
this.addBottomSection(about);
//set drawer image
this.setDrawerHeaderImage(this.getResources().getDrawable(R.drawable.feature_graphics));
@@ -105,6 +126,51 @@ public class MainActivity extends MaterialNavigationDrawer {
}
+ // IBillingHandler implementation
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (!bp.handleActivityResult(requestCode, resultCode, data))
+ super.onActivityResult(requestCode, resultCode, data);
+ }
+
+ @Override
+ public void onBillingInitialized() {
+ /*
+ * Called then BillingProcessor was initialized and its ready to purchase
+ */
+ }
+
+ @Override
+ public void onProductPurchased(String productId, TransactionDetails details) {
+ /*
+ * Called then requested PRODUCT ID was successfully purchased
+ */
+ }
+
+ @Override
+ public void onBillingError(int errorCode, Throwable error) {
+ /*
+ * Called then some error occured. See Constants class for more details
+ */
+ }
+
+ @Override
+ public void onPurchaseHistoryRestored() {
+ /*
+ * Called then purchase history was restored and the list of all owned PRODUCT ID's
+ * was loaded from Google Play
+ */
+ }
+
+ @Override
+ public void onDestroy() {
+ if (bp != null)
+ bp.release();
+
+ super.onDestroy();
+ }
+
public void normalMorseEncode(View view){
try{
EditText input = (EditText) findViewById(R.id.editTextNormalMorse);
@@ -286,4 +352,5 @@ public class MainActivity extends MaterialNavigationDrawer {
ClipData clip = ClipData.newPlainText("Message", string);
clipboard.setPrimaryClip(clip);
}
+
}
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index a50789c..e35b6ff 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -36,9 +36,9 @@
Über
Normales Morse
Wenn Du einen Fehler gefunden hast, schreibe mit bitte ein Email an marcelmichaelkapfer@yahoo.co.nz
- Du kannst eine ausführliche Anwendung auf marcel-kapfer.de/projects/morse/index.html#howto_android finden.
+ Du kannst eine ausführliche Anwendung auf marcel-kapfer.de/writtenmorse/index.html#howto_android finden.
Wenn du auf einen fehlenden Code aufmerksam geworden bist, dann schreibe eine Email an marcelmichaelkapfer@yahoo.co.nz.
- 2.1 \n10. März 2015
+ 2.2 beta \n15. Mai 2015
Fehler
Kontakt
Entwickler
@@ -48,4 +48,7 @@
TEILEN
KOPIEREN
+
+
+ Unterstütze den Entwickler
diff --git a/app/src/main/res/values-v19/styles.xml b/app/src/main/res/values-v19/styles.xml
index 0bcdca5..ea541f5 100644
--- a/app/src/main/res/values-v19/styles.xml
+++ b/app/src/main/res/values-v19/styles.xml
@@ -82,4 +82,9 @@
- match_parent
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 800dab5..6acfd34 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -43,13 +43,13 @@
How to
Missing Code
- 2.1\n10th March 2015
+ 2.2 beta\n15 May 2015
Marcel Michael Kapfer
- marcel-kapfer.de/projects/morse/
+ marcel-kapfer.de/writtenmorse
marcelmichaelkapfer@yahoo.co.nz
GNU GPL v3.0
If you found a bug, please write me a mail to marcelmichaelkapfer@yahoo.co.nz with a short description of the problem.
- You can find a detailed guide on marcel-kapfer.de/projects/morse/index.html#howto_android
+ You can find a detailed guide on marcel-kapfer.de/writtenmorse/index.php#howto_android
If you discovered, that code is missing, then write me a mail to marcelmichaelkapfer@yahoo.co.nz and tell me about it.
About
@@ -58,6 +58,7 @@
SHARE
COPY
-
- Hello blank fragment
+
+ Donate the developer
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index e29b1b1..caf2827 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -81,4 +81,9 @@
- match_parent
+
+
\ No newline at end of file