diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fa55ad30..af07ac57c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ Change Log =============================================================================== +Version 2.1.7 *(2017-04-18)* +---------------------------- +* Properly handle crashes during migration of backup/export files to new location +* Update README and CONTRIBUTORS + Version 2.1.6 *(2017-04-15)* ---------------------------- * Fixed #664: Rotating device in transaction view causes crash diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index b57d1bc49..fe12546fb 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -7,35 +7,59 @@ project through the early phases (as Google Summer of Code project 2012) and pro * Ngewi Fet - Project maintainer * Yongxin Wang * Oleksandr Tyshkovets -* Àlex Magaz Graça +* Àlex Magaz Graça ### Other Contributors -The following (incomplete list of) people (in no particular order) contributed (patches and translations) to GnuCash Android: -* Christian Stimming -* Cristian Marchi -* Menelaos Maglis -* Kjell Thomas Pedersen -* Alexander Galanin -* Jorge Martínez López -* Israel Buitron -* Geert Janssens -* Nicolas Barranger -* Sigurd Gartmann -* Pedro Abel -* windwarrior -* Alex Lei -* Matthew Hague -* Spanti Nicola -* Jesse Shieh -* Terry Chung -* Caesar Wirth -* Alceu Rodrigues Neto -* Carlo Zancanaro -* Eric Daly -* Weslly Oliveira -* Felipe Morato -* Alceu Rodrigues Neto -* Salama AB -* Juan Villa +The following people (in alphabetical order) contributed (commits on GitHub) to GnuCash Android: +* aerkefiende +* Alceu Rodrigues Neto +* Aleksey Ivanovski +* Àlex Magaz Graça +* Alexander Galanin +* Alexandr Makaric +* Caesar Wirth +* Carlo Zancanaro +* choni wani@dri-h.net +* Christian Stimming +* Cristian Marchi +* David Landry +* Eric Daly +* Falk Brockmann +* Felipe Morato +* Geert Janssens +* Jörg Möller +* Israel Buitron +* Jesse Shieh +* Jorge Martínez López +* Juan Villa +* Kjell Thomas Pedersen +* Lian Kai +* lxb leixb@agilean.cn +* Alex Lei +* Mark Haanen +* Matthew Hague +* Menelaos Maglis +* moshe.w@invest.com +* Ngewi Fet +* Nicolas Barranger +* Oleg Kosmakov +* Oleksandr Tyshkovets +* PBNeves bastosdasneves@gmail.com +* Pedro Abel +* Salama AB +* Sandro Santilli +* Sigurd Gartmann +* smisger sameer.misger@prospectasoftware.com +* Spanti Nicola +* Stephan Windmüller +* Terry Chung +* thesebas thesebas@thesebas.net +* Vladimir Rutsky +* Weslly Oliveira +* windwarrior lennartbuit@gmail.com +* yapiti wicowyn@gmail.com +* Yongxin Wang -Please visit https://crowdin.com/project/gnucash-android for a more complete list of translation contributions \ No newline at end of file + +### Translators +Please visit https://crowdin.com/project/gnucash-android for a more complete list of translation contributions diff --git a/README.md b/README.md index 13e89dc12..5f19c01cc 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ GnuCash Android is a companion expense-tracker application for GnuCash (desktop) designed for Android. It allows you to record transactions on-the-go and later import the data into GnuCash for the desktop. +Accounts | Transactions | Reports +:-------------------------:|:-------------------------:|:-------------------------: +![Accounts List](docs/images/v2.0.0_home.png) | ![Transactions List](docs/images/v2.0.0_transactions_list.png) | ![Reports](docs/images/v2.0.0_reports.png) + The application supports Android 2.3.3 Gingerbread (API level 10) and above. Features include: @@ -66,7 +70,7 @@ The app is configured to allow you to install a development and production versi ### With Android Studio The easiest way to build is to install [Android Studio](https://developer.android.com/sdk/index.html) v2.+ -with [Gradle](https://www.gradle.org/) v2.10 +with [Gradle](https://www.gradle.org/) v3.4.1 Once installed, then you can import the project into Android Studio: 1. Open `File` @@ -89,7 +93,7 @@ Please visit [CrowdIn](https://crowdin.com/project/gnucash-android) in order to * You could as well contribute code, fixing bugs, new features or automated tests. Pull requests are always welcome. Take a look at the [bug tracker](https://github.com/codinguser/gnucash-android/issues?state=open) -for ideas where to start. +for ideas where to start. Also take a look at the [contribution guidlines](https://github.com/codinguser/gnucash-android/blob/master/.github/CONTRIBUTING.md) For development, it is recommended to use the Android Studio for development which is available for free. Import the project into the IDE using the build.gradle file. The IDE will resolve dependencies automatically. diff --git a/app/build.gradle b/app/build.gradle index 42cc4b543..ed424bf23 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,7 +6,7 @@ apply plugin: 'android-apt' def versionMajor = 2 def versionMinor = 1 -def versionPatch = 6 +def versionPatch = 7 def versionBuild = 0 def buildTime() { diff --git a/app/src/main/java/org/gnucash/android/db/MigrationHelper.java b/app/src/main/java/org/gnucash/android/db/MigrationHelper.java index 059634bb1..f386fbdba 100644 --- a/app/src/main/java/org/gnucash/android/db/MigrationHelper.java +++ b/app/src/main/java/org/gnucash/android/db/MigrationHelper.java @@ -1488,10 +1488,25 @@ static int upgradeDbToVersion13(SQLiteDatabase db){ * @param srcDir Source directory which should already exist * @param dstDir Destination directory which should already exist * @see #moveFile(File, File) + * @throws IOException if the {@code srcDir} does not exist or {@code dstDir} could not be created + * @throws IllegalArgumentException if {@code srcDir} is not a directory */ - private static void moveDirectory(File srcDir, File dstDir){ - if (!srcDir.exists() || !srcDir.isDirectory() || !dstDir.isDirectory() || !dstDir.exists()){ - throw new IllegalArgumentException("Source is not a directory, use MigrationHelper.moveFile(...)"); + private static void moveDirectory(File srcDir, File dstDir) throws IOException { + if (!srcDir.isDirectory()){ + throw new IllegalArgumentException("Source is not a directory: " + srcDir.getPath()); + } + + if (!srcDir.exists()){ + String msg = String.format(Locale.US, "Source directory %s does not exist", srcDir.getPath()); + Log.e(LOG_TAG, msg); + throw new IOException(msg); + } + + if (!dstDir.exists() || !dstDir.isDirectory()){ + Log.w(LOG_TAG, "Target directory does not exist. Attempting to create..." + dstDir.getPath()); + if (!dstDir.mkdirs()){ + throw new IOException(String.format("Target directory %s does not exist and could not be created", dstDir.getPath())); + } } for (File src : srcDir.listFiles()){ @@ -1521,7 +1536,7 @@ private static void moveDirectory(File srcDir, File dstDir){ * It moves the backup files to a new backup location which does not require SD CARD write permission *

* @param db SQLite database to be upgraded - * @return + * @return New database version */ public static int upgradeDbToVersion14(SQLiteDatabase db){ Log.i(DatabaseHelper.LOG_TAG, "Upgrading database to version 14"); @@ -1534,17 +1549,20 @@ public static int upgradeDbToVersion14(SQLiteDatabase db){ public void run() { File srcDir = new File(Exporter.LEGACY_BASE_FOLDER_PATH); File dstDir = new File(Exporter.BASE_FOLDER_PATH); - moveDirectory(srcDir, dstDir); - File readmeFile = new File(Exporter.LEGACY_BASE_FOLDER_PATH, "README.txt"); - FileWriter writer = null; try { + moveDirectory(srcDir, dstDir); + File readmeFile = new File(Exporter.LEGACY_BASE_FOLDER_PATH, "README.txt"); + FileWriter writer = null; writer = new FileWriter(readmeFile); writer.write("Backup files have been moved to " + dstDir.getPath() + "\nYou can now delete this folder"); writer.flush(); - } catch (IOException e) { - e.printStackTrace(); - Log.e(LOG_TAG, "Error creating README file"); + } catch (IOException | IllegalArgumentException ex) { + ex.printStackTrace(); + String msg = String.format("Error moving files from %s to %s", srcDir.getPath(), dstDir.getPath()); + Log.e(LOG_TAG, msg); + Crashlytics.log(msg); + Crashlytics.logException(ex); } } diff --git a/docs/images/v2.0.0_home.png b/docs/images/v2.0.0_home.png new file mode 100644 index 000000000..4068a0e3c Binary files /dev/null and b/docs/images/v2.0.0_home.png differ diff --git a/docs/images/v2.0.0_reports.png b/docs/images/v2.0.0_reports.png new file mode 100644 index 000000000..c197f0543 Binary files /dev/null and b/docs/images/v2.0.0_reports.png differ diff --git a/docs/images/v2.0.0_transactions_list.png b/docs/images/v2.0.0_transactions_list.png new file mode 100644 index 000000000..093ca1cf0 Binary files /dev/null and b/docs/images/v2.0.0_transactions_list.png differ