Android Intent API¶
If you want to integrate with another Android app, the easiest ways is to call our Intent API. You don't have to handle any authentication/backends, our app handles that. Intent API is mostly used to open new transaction screen with some data.
Actions¶
Create a system Android intent with following action:
SHORTCUT_ADD_EXPENSE- opens new expense screenSHORTCUT_EXPENSE_FROM_BILL- opens new expense from bill screenSHORTCUT_ADD_TRANSFER- opens new transfer screenSHORTCUT_ADD_INCOME- opens new income screen
Extras¶
New transaction screen supports following intent extras:
AMOUNT(Double): prefilled amount, default is 0CURRENCY_CODE(String): 3-letter currency code, default is current group currencyPURPOSE(String): prefilled purpose, default emptyGROUP_ID(String): which group to add transaction to, default is currently selected groupDATE_TIME(Long): timestamp in millis, default is now
Create Intent¶
Here is a sample code how to call our Intent from another app:
val packageName = "cz.destil.settleup"
val launchIntent = packageManager.getLaunchIntentForPackage(packageName)
if (launchIntent != null) {
launchIntent.apply {
action = "SHORTCUT_ADD_EXPENSE"
putExtra("AMOUNT", 25.50)
putExtra("CURRENCY_CODE", "USD")
putExtra("PURPOSE", "Dinner with friends")
putExtra("GROUP_ID", "your_group_id_here")
putExtra("DATE_TIME", System.currentTimeMillis())
}
startActivity(launchIntent)
} else {
// Settle Up app is not installed, handle accordingly (e.g., open Play Store)
}
It's also needed to add this query to your manifest:
<queries>
<package android:name="cz.destil.settleup" />
</queries>