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

MSL to unlock "unlocked" phone

Any suggestions on how to get my MSL to unlock my S9 would be much appreciated.

I'm ending service with sprint, but lost the sim card I had with them. They have unlocked my phone, but unfortunately the phone doesn't seem to know that (the sim card wasn't in when it was unlocked by Sprint). When I turn it on it tells me to contact Sprint to unlock the phone. When I contact Sprint with the IMEI number, they say the phone is already unlocked.

Will inputting an MSL unlock the phone so that I can use my new sim card? And if so, how do I get that code?

t

Notification log that actually works for Honor 8A

I want a notification log for my Huawei Honor 8A. I've tried several. None work completely. Does anyone know one that does?
I've tried:
--- NotificationLog - logged a few things, then stopped working.
--- Notification History Log - logs a lot, but constantly beeps to tell me it can't log any more
--- Notification History - also logs a lot, but misses key bank notifications that the previous one gets.

Anyone know a log that works for the 8A (or even 8 / 8X)

Many thanks

android studio and kotlin , how to get kotlin serialization working

I am working on creating a app using android studio ( version 4.0.1) using kotline(version 1.4.10) , I am not able to get kotlin serialization working , here is my build.gradle file entry

apply plugin: 'kotlinx-serialization'

here is error message which I get

Plugin with id 'kotlinx-serialization' not found.

I am new to android studio and kotline

what I need to do so that I can get kotlin serialization working

-Thanks

Async Function Needs Context

[Edit: I think I am asking, how do you access the calling Context in an Async callback function that has just got the Sku details?]

I have an async callback function within another function (onSkuDetailsResponse)

Code:
public void querySkuDetailsAsync(@BillingClient.SkuType final String itemType, final List<String> skuList){
    // Query the purchase async
    SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder();
    params.setSkusList(skuList).setType(itemType);
    mBillingClient.querySkuDetailsAsync(params.build(),
                                                                       new SkuDetailsResponseListener() {
               @Override
               public void onSkuDetailsResponse(BillingResult response,  List<SkuDetails> skuDetailsList) {

Note 'public void onSkuDetailsResponse' is the async function in question.

Within it I cycle through the Skus:

Code:
for (SkuDetails skuDetails : skuDetailsList) {
    String Sku, Title, Description, Price;
    Sku = skuDetails.getSku();
    Title = skuDetails.getTitle();
    Description = skuDetails.getDescription();
    Price = skuDetails.getPrice();
    MyIAPProduct.setSkuDetails(productsDetailsARR, getApplicationContext(), Sku, Title, Description, Price);
}

NOTE: The function `MyIAPProduct.setSkuDetails` saves the Sku's detail to preferences.

If I put 'this' where getApplicationContext() is, it turns red as 'this' at that point in time is the SkuDetailsReponseListener and not the Context within which this function is written.

So I put 'getApplicationContext()' as shown in the code, because I thought that would be the right thing to do.

However, when 'MyIAPProduct.setSkuDetails' runs (see code)

Code:
public static void setSkuDetails(ArrayList<MyIAPProduct> arr, Context cnt,
                                 String Sku, String Title, String Description, String Price)
{
    for(MyIAPProduct prod: arr){
        if(Sku.equals(prod.m_Sku)) {
            prod.setSkuDetails(cnt, Title, Description, Price);
        }
    }
}

and 'setSkuDetails' for the individual object is run:

Code:
public void setSkuDetails(Context cnt, String Title, String Description, String Price)
{
    m_Title = Title;
    m_Description = Description;
    m_Price = Price;
    saveToPreferences(cnt);
}

Then when it runs the function 'saveToPreferences' for the individual object:

Code:
public void saveToPreferences(Context cnt){
    SharedPreferences sharedPref = ((Activity) cnt).getPreferences(Context.MODE_PRIVATE);
    SharedPreferences.Editor editor = sharedPref.edit();
    editor.putBoolean(m_Sku + "Purchased", m_Purchased);
    editor.putString(m_Sku + "Title", m_Title);
    editor.putString(m_Sku + "Description", m_Description);
    editor.putString(m_Sku + "Price", m_Price);
    editor.commit();
}

the program crashed on the line

Code:
    SharedPreferences sharedPref = ((Activity) cnt).getPreferences(Context.MODE_PRIVATE);

where the Context is first used.

Can anyone explain why?

Can anyone explain what I need to do to get it working as I hope?

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.

Filter

Back
Top Bottom