• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Will A Consumed IAP Still Appear in Purchases?

I am in Android Studio. When I get my purchases it still shows a purchase I thought I had consumed.

Here is my handlePurchases:

Code:
void handlePurchases(List<Purchase>  purchases) {
       String str;
       int numberOfPurchases = 0;

       for(Purchase purchase:purchases) {
           switch(purchase.getPurchaseState()) {
               case Purchase.PurchaseState.PURCHASED:
                   if (!verifyValidSignature(purchase.getOriginalJson(), purchase.getSignature())) {
                       // Invalid purchase
                       // show error to user
                       Toast.makeText(getApplicationContext(), "Error : Invalid Purchase", Toast.LENGTH_SHORT).show();
                       return;
                   }
                   // else purchase is valid
                   //if item is purchased and not acknowledged
                   if (!purchase.isAcknowledged()) {
                       AcknowledgePurchaseParams acknowledgePurchaseParams =
                               AcknowledgePurchaseParams.newBuilder()
                                       .setPurchaseToken(purchase.getPurchaseToken())
                                       .build();
                       mBillingClient.acknowledgePurchase(acknowledgePurchaseParams, ackPurchase);
                   }
                   //else item is purchased and also acknowledged
                   else {
                       numberOfPurchases++;

                       // HOW DOES IT KNOW IF IT IS CONSUMED???

                       // DONT DELETE - if you want to keep on consuming
                       // ConsumeParams consumeParams = ConsumeParams.newBuilder()
                       //        .setPurchaseToken(purchase.getPurchaseToken())
                       //        .build();
                       //
                       //ConsumeResponseListener consumeResponseListener = new ConsumeResponseListener() {
                       //    @Override
                       //    public void onConsumeResponse(BillingResult billingResult, String purchaseToken) {
                       //
                       //        Toast.makeText(DiamondsActivity.this, "Purchase successful", Toast.LENGTH_SHORT).show();
                       //
                       //        if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
                       //
                       //            if (purchase.getSku().equalsIgnoreCase(ITEM_SKU_diamond_500)) {
                       //                Toast.makeText(DiamondsActivity.this, "Thank you for purchasing!", Toast.LENGTH_SHORT).show();
                       //            }
                       //        }
                       //    }
                       //};
                       //billingClient.consumeAsync(consumeParams, consumeResponseListener);
                   }
                   break;
               case Purchase.PurchaseState.PENDING:
                   Toast.makeText(getApplicationContext(), "Purchase is Pending. Please complete Transaction", Toast.LENGTH_SHORT).show();
                   break;
               case Purchase.PurchaseState.UNSPECIFIED_STATE:
                   Toast.makeText(getApplicationContext(), "Purchase Status Unknown", Toast.LENGTH_SHORT).show();
                   break;
           }
       }
   }

The critical bit is where it say // HOW DOES IT KNOW IF IT IS CONSUMED???.

How do I tell if a purchase has been consumed?

Should the consumed purchase still be in the purchases array?

Is there something I should be doing in my Google Play Programmer Account for the IAP, ie a flag of some sort to say it is consumable?

Unlock All Fingerprints

@kendallkanderson I'm afraid we're not going to be able to offer you much help here. That appears to be an issue with the app so you'd need to contact the app's developer to get it sorted out.

I'd normally advise you to use the app's listing in the Play Store to find the developer's contact details but (surprise!) it doesn't look like that app is available on the Play Store. I agree with @mikedt here; it sounds like a scam to me.

OK thank you so much for your honesty. It goes along way with me. Makes total sense. Thanks again for your assistance.

Android keeps switching USB mode to charging after I selected data transfer

Ok, so I stumbled onto this thread last night.
I know that it is an old thread, but I still ran it by an old friend of mine that just so happens to be an expert with drones, both technically and legally.

Here is his unedited answer:

Parrot drones suck. Those three words are basically the answer to the concern. The best advice there is to sell the Parrot and buy a DJI or Autel. They'll hate taking the loss on the sale, but they will see a world of difference in going for a terribly designed and built toy to a quality machine that just outright works. But foregoing that they may want to borrow a friend's iPad Mini 2 or better or give a try with a more recent upgrade on an Android. The P10 is on the low end for drone control - in fact, the newest drones require 64 bit architecture or their app won't even load.

Help cant get notifications

For some time now (i beleive its over a year) i dont get notifications from some of my apps. (mostly on Facebook and youtube).
Only when I go into the app itself i see the notification inside it.
I want to see the notification as push on my top task bar , or as a number icon on the app icon.
I am not using battery saver mode.
all apps have permissions for notifications.
On the other hand for example the mail and whatsapp apps show notifications.
i also tried all the options in this video (although its for Note10 the menus are similar):

(Galaxy S8 , Android 9)

Android Studio TextView Not showing when running app

Good day to all.
I am reading a tutorial book on how to build android apps.
I am now on the section: Building a Menu with LinearLayout.
It told me to make a new project With the empty activity templet.
With the name main_menu Root element LinearLayout Source set Main.
Then i had to add to the main_menu.xml In design mode A TextView to the UI.
Now when i run the app in the instant it should already show me the title and the text menu under it.
But it only shows me the blue title and no text field.
I wend on with the book hoping it will be sol-ft.
I had to add Menu and 50sp and center horizontal to it.
Then i had to add a multi-line TextView to the UI.
Added text to it, And run the app again.
No menu ore text view.
I also had copy and paset the code from main_menu.xml to activity_main.xml in the hope that that would help.
main_menu.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:id="@+id/textView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:text="Menu"
        android:textSize="50sp" />

    <EditText
        android:id="@+id/editTextTextMultiLine"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:gravity="start|top"
        android:inputType="textMultiLine"
        android:text="Select a layout type to view an example. The onClick atribute of each button will call a method which executes setContentView to load the new layout." />
</LinearLayout>
activity_main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

I am using android studio 4.0.1

Hope you can help me with this.

Can You Use Secure Folder Without the Password Reset/Unlock Features?

I want to use Secure Folder, but it requires a Samsung account to be added to the phone. Which then allows your secure folder pin to be reset, the whole phone to be remotely unlocked, reset the lockscreen, etc...

That defeats the purpose of secure folder to me. I dont want any of that ability. I want only me knowing the code and having the ability to unlock it.

Is there a way to use secure folder or add a samsung account without all that?

Filter

Back
Top Bottom