Skip to content

Commit

Permalink
Merge branch 'release/v2.0.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
codinguser committed Oct 5, 2015
2 parents 6715010 + 179165a commit 392f3e6
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'io.fabric'
def versionMajor = 2
def versionMinor = 0
def versionPatch = 0
def versionBuild = 1
def versionBuild = 2

def buildTime() {
def df = new SimpleDateFormat("yyyyMMdd HH:mm 'UTC'")
Expand Down
14 changes: 5 additions & 9 deletions app/src/main/java/org/gnucash/android/db/MigrationHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.gnucash.android.export.Exporter;
import org.gnucash.android.importer.CommoditiesXmlHandler;
import org.gnucash.android.model.AccountType;
import org.gnucash.android.model.BaseModel;
import org.gnucash.android.model.Commodity;
import org.gnucash.android.model.Money;
import org.gnucash.android.model.Transaction;
Expand Down Expand Up @@ -209,11 +210,6 @@ public void run() {
}
};

public static String generateUUID()
{
return UUID.randomUUID().toString().replaceAll("-", "");
}


/**
* Imports commodities into the database from XML resource file
Expand Down Expand Up @@ -665,7 +661,7 @@ static int upgradeDbToVersion8(SQLiteDatabase db) {
}
else
{
rootAccountUID = generateUUID();
rootAccountUID = BaseModel.generateUID();
contentValues.clear();
contentValues.put(CommonColumns.COLUMN_UID, rootAccountUID);
contentValues.put(CommonColumns.COLUMN_CREATED_AT, timestamp);
Expand Down Expand Up @@ -707,7 +703,7 @@ static int upgradeDbToVersion8(SQLiteDatabase db) {
//scheduledAction.setLastRun(System.currentTimeMillis()); //prevent this from being executed at the end of migration

contentValues.clear();
contentValues.put(CommonColumns.COLUMN_UID, generateUUID());
contentValues.put(CommonColumns.COLUMN_UID, BaseModel.generateUID());
contentValues.put(CommonColumns.COLUMN_CREATED_AT, timestamp);
contentValues.put(ScheduledActionEntry.COLUMN_ACTION_UID, cursor.getString(cursor.getColumnIndexOrThrow(TransactionEntry.COLUMN_UID)));
contentValues.put(ScheduledActionEntry.COLUMN_PERIOD, cursor.getLong(cursor.getColumnIndexOrThrow("recurrence_period")));
Expand Down Expand Up @@ -774,7 +770,7 @@ static int upgradeDbToVersion8(SQLiteDatabase db) {
imbalanceAccountUID = c.getString(c.getColumnIndexOrThrow(AccountEntry.COLUMN_UID));
}
else {
imbalanceAccountUID = generateUUID();
imbalanceAccountUID = BaseModel.generateUID();
contentValues.clear();
contentValues.put(CommonColumns.COLUMN_UID, imbalanceAccountUID);
contentValues.put(CommonColumns.COLUMN_CREATED_AT, timestamp);
Expand All @@ -795,7 +791,7 @@ static int upgradeDbToVersion8(SQLiteDatabase db) {
}
String TransactionUID = cursor.getString(cursor.getColumnIndexOrThrow("trans_uid"));
contentValues.clear();
contentValues.put(CommonColumns.COLUMN_UID, generateUUID());
contentValues.put(CommonColumns.COLUMN_UID, BaseModel.generateUID());
contentValues.put(CommonColumns.COLUMN_CREATED_AT, timestamp);
contentValues.put("amount", decimalImbalance.abs().toPlainString());
contentValues.put(SplitEntry.COLUMN_TYPE, decimalImbalance.compareTo(BigDecimal.ZERO) < 0 ? "DEBIT" : "CREDIT");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.gnucash.android.export.Exporter;
import org.gnucash.android.model.Account;
import org.gnucash.android.model.AccountType;
import org.gnucash.android.model.BaseModel;
import org.gnucash.android.model.Money;
import org.gnucash.android.model.PeriodType;
import org.gnucash.android.model.ScheduledAction;
Expand Down Expand Up @@ -290,7 +291,7 @@ private void exportTransactions(XmlSerializer xmlSerializer, boolean exportTempl
mRootTemplateAccount.setAccountType(AccountType.ROOT);
mTransactionToTemplateAccountMap.put(" ", mRootTemplateAccount);
while (cursor.moveToNext()) {
Account account = new Account(UUID.randomUUID().toString().replaceAll("-", ""));
Account account = new Account(BaseModel.generateUID());
account.setAccountType(AccountType.BANK);
String trnUID = cursor.getString(cursor.getColumnIndexOrThrow("trans_uid"));
mTransactionToTemplateAccountMap.put(trnUID, account);
Expand Down Expand Up @@ -714,7 +715,7 @@ public void generateExport(Writer writer) throws ExporterException{
// book_id
xmlSerializer.startTag(null, GncXmlHelper.TAG_BOOK_ID);
xmlSerializer.attribute(null, GncXmlHelper.ATTR_KEY_TYPE, GncXmlHelper.ATTR_VALUE_GUID);
xmlSerializer.text(UUID.randomUUID().toString().replaceAll("-", ""));
xmlSerializer.text(BaseModel.generateUID());
xmlSerializer.endTag(null, GncXmlHelper.TAG_BOOK_ID);
//commodity count
List<Currency> currencies = mAccountsDbAdapter.getCurrenciesInUse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.gnucash.android.export.xml.GncXmlHelper;
import org.gnucash.android.model.Account;
import org.gnucash.android.model.AccountType;
import org.gnucash.android.model.BaseModel;
import org.gnucash.android.model.Money;
import org.gnucash.android.model.PeriodType;
import org.gnucash.android.model.Price;
Expand Down Expand Up @@ -671,7 +672,7 @@ public void endElement(String uri, String localName, String qualifiedName) throw
if (mScheduledAction.getActionType() == ScheduledAction.ActionType.TRANSACTION) {
mScheduledAction.setActionUID(mTemplateAccountToTransactionMap.get(characterString));
} else {
mScheduledAction.setActionUID(UUID.randomUUID().toString().replaceAll("-",""));
mScheduledAction.setActionUID(BaseModel.generateUID());
}
break;
case GncXmlHelper.TAG_SCHEDULED_ACTION:
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/java/org/gnucash/android/model/BaseModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ public BaseModel(){
}

/**
* Method for generating the Global Unique ID for the object and sets the internal variable which can be retrieved with {@link #getUID()}.
* Subclasses can override this method to provide a different implementation
* Method for generating the Global Unique ID for the model object
* @return Random GUID for the model object
*/
protected String generateUID(){
return mUID = UUID.randomUUID().toString().replaceAll("-", "");
public static String generateUID(){
return UUID.randomUUID().toString().replaceAll("-", "");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.gnucash.android.export.ExportAsyncTask;
import org.gnucash.android.export.ExportFormat;
import org.gnucash.android.export.ExportParams;
import org.gnucash.android.model.BaseModel;
import org.gnucash.android.model.ScheduledAction;
import org.gnucash.android.ui.account.AccountsActivity;
import org.gnucash.android.ui.common.UxArgument;
Expand Down Expand Up @@ -239,7 +240,7 @@ private void startExport(){
ScheduledAction.ActionType.BACKUP);
for (ScheduledAction scheduledAction : scheduledActions) {
scheduledAction.setTag(exportParameters.toCsv());
scheduledAction.setActionUID(UUID.randomUUID().toString().replaceAll("-", ""));
scheduledAction.setActionUID(BaseModel.generateUID());
ScheduledActionDbAdapter.getInstance().addRecord(scheduledAction);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.gnucash.android.db.AccountsDbAdapter;
import org.gnucash.android.db.DatabaseSchema;
import org.gnucash.android.model.AccountType;
import org.gnucash.android.model.BaseModel;
import org.gnucash.android.model.Money;
import org.gnucash.android.model.Split;
import org.gnucash.android.model.Transaction;
Expand Down Expand Up @@ -261,7 +262,7 @@ public void onClick(View view) {
splitCurrencyTextView.setText(accountCurrency.getSymbol());
splitTypeButton.setAmountFormattingListener(splitAmountEditText, splitCurrencyTextView);
splitTypeButton.setChecked(mBaseAmount.signum() > 0);
splitUidTextView.setText(UUID.randomUUID().toString().replaceAll("-", ""));
splitUidTextView.setText(BaseModel.generateUID());

if (split != null) {
splitAmountEditText.setCurrency(split.getValue().getCurrency());
Expand Down
36 changes: 36 additions & 0 deletions play_store_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
GnuCash is a mobile finance expense tracker application for Android.

It is a companion application for GnuCash for the desktop and enables flexible tracking of expenses on-the-go which can be exported to QIF or OFX formats.

Some of feature highligts include:

<b>&bull; An easy-to-use interface.</b>

<b>&bull; Chart of Accounts</b>: A master account can have a hierarchy of detail accounts underneath it.
This allows similar account types (e.g. Cash, Bank, Stock) to be grouped into one master account (e.g. Assets).
You can also import an existing account hierarchy from GnuCash desktop.

<b>&bull; Split Transactions</b>: A single transaction can be split into several pieces to record taxes, fees, and other compound entries.

<b>&bull; Double Entry</b>: Every transaction must debit one account and credit another by an equal amount. This ensures that the "books balance": that the difference between income and outflow exactly equals the sum of all assets, be they bank, cash, stock or other.

<b>&bull; Income/Expense Account Types (Categories)</b>: These serve not only to categorize your cash flow, but when used properly with the double-entry feature, these can provide an accurate Profit&Loss statement.

<b>&bull; Scheduled Transactions</b>: GnuCash has the ability to automatically create and enter transactions.

<b>&bull; Export to GnuCash XML, QIF or OFX</b>: GnuCash can export your accounts/transactions in different formats for use in other programs. Also, scheduled exports to 3rd-party sync services like DropBox and Google Drive can be enabled.

<b>&bull; Reports</b>: View summary of transactions (income and expenses) as pie/bar/line charts

<b>&bull; Homescreen widget</b> for quick access to your accounts and recording of transactions

<br/><b><u>NOTE</u></b>: that the app does not offer full compatibility with GnuCash for the desktop. You cannot synchronize between the desktop app and this one. But you can import your accounts and transactions from GnuCash XML files.

<br/><small>
<i><u>What does the app use the requested permissions for? </u></i>
&bull; READ_EXTERNAL_STORAGE: Used to export transactions/accounts to the SD card
&bull; RECEIVE_BOOT_COMPLETED: Used to restart service for scheduled transactions or exports after device is rebooted
&bull; VIBRATE: Used to provide haptic feedback when entering some inputs
&bull; WAKE_LOCK: Used for keeping device active when exporting scheduled transactions in the background service
&bull; INTERNET/ACCESS_NETWORK_STATE: Used when exporting accounts/transactions to 3rd-party service like Google Drive or DropBox
</small>

0 comments on commit 392f3e6

Please sign in to comment.