Paypal discount and coupon in android - android

Is there any way or alternative in implementing discounts and coupons in android?
There's no problem when using discount per item because i deducted the item total before adding to PaypalItem but i got a great problem when adding discount per subtotal or transaction.
Best Regards!

Related

Google Play Billing 5 - How to get the base price for subscriptions when you have multiple offers?

With the Billing 5 library, Google introduces Base plans, offers, and pricing phases. Many new things to digest...
I want to display only the base plan price for all the subscriptions.
From what I can see, the only way to get the offers, respectively prices, is by calling getSubscriptionOfferDetails()
List<SubscriptionOfferDetails> subscriptionOfferDetailsList = productDetails.getSubscriptionOfferDetails();
It's not clear to me how to identify if an offer is a 'base plan'. I don't see a productDetails.getBasePlans() nor a subscriptionOfferDetails.isBasePlan()
I just want to get the price of the subscription from the base plan. What am I missing?
I found an answer, but I'm not sure it's the best approach. The code below iterates through all the offers and returns the first base plan by checking if offerId is null.
for(int j=0;j<subscriptionOfferDetailsList.size();j++){
ProductDetails.SubscriptionOfferDetails subscriptionOfferDetails = subscriptionOfferDetailsList.get(j);
if(subscriptionOfferDetails.getOfferId() == null){
return subscriptionOfferDetails;
}
}

Set a subscription default price in Play console one time

I need to add subscription price one time for all countries. like inapp product you can set the price for default currency and it's reflected automatically for all other countries.
I found "Add base plan" in google play console, inside it I can edit price for each country alone.
as in this picture:
Checked this answer but can't be applied , my be it's changed by google play.
Otherwise, I 've to change price for each country, which will take too long time to convert then fill in.
Any idea?
Found it as below:
1- click on set price ( it's dimm, but ok click it).
as highlighted
2-check below highlighted box (all country / region):
3-click on set price again ( below the page).
4-fill in price and hit update as below:

Ordered list from html in android TextView

My intention is to load HTML data into a textView as an ordered (1,2,3,4,.....n) list.But the UI shows always in bullet points rather than an ordered list. I have searched and tried to follow some solutions but nothing works. Your help would be amazing and much appreciated.
The procedure I followed is given underneath.
dataBinding.tvBody.text = HtmlCompat.fromHtml(
text,
HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_DIV,
)
Here the value of text is,
<div><b>Test Data Added Here For EN</b></div><ol><li>15% on discount on video consultation and tele consultation with family medicine doctor, nutritionist, gynecologist, physiotherapist, & dental surgeon.</li><li>15% discount on home sample collections on any pathological test & imaging test.</li><li>15% discount on the 1st visit with family medicine doctor’s fee.</li><li>5% discount on annual health checkups.</li></ol>

Handling integers bigger than Long with Firebase and android

I am developing an app with Firebase, it is a game in which certain scores are shared between players and can grow without a limit. I tried storing them as a String, but then I could not order them with orderByChild for the leaderboard. How can I handle this problem?
You could store the number as a linked list, with each node in the list representing each digit. Be careful with the order; putting the last number (the ones digit) in the list first, makes math with the linked list easier, while the other direction makes it easier to return the nodes in the list to a number on the screen.
To store integers which are big in size java provides a BigInteger Class to handle those numbers. I will suggeat you to use that first read the concept and then try to findout what you exactly want!
Check this one BigInteger

Android in app billing set product quantity

Is there any way I can create one product in android market and depending on different buttons clicked by user to set different quantity of the product?
As I know there isn't an option to send via android in app-billing quantity of one product, instead of this you can create for example three type of products, which will be something like that :
First Product : Quantity - 1
Second Product: Quantity - 3
Third Product : Quantity - 5
where all products are the same, just different quantities.

Categories

Resources