Android Question Upgrading A Free App To A Paid One - Installation

RichardN

Active Member
Licensed User
Longtime User
I have an app with a free demo version and a full paid version. They must have unique package names on the Play store and so are recognized as unique apps.

When a purchaser tries the free version on his device and clicks the link to download the paid version he ends up with 2 distinct copies of the app.... the first is not replaced by the second. He then has to decide which copy to delete from the device.

What is the best way of managing the user experience ?
 

Kevin

Well-Known Member
Licensed User
Longtime User
Many apps use the "paid" app as an unlocker. When the free app detects the paid app as installed it allows full access in the free app. I haven't gone this route (yet?) because I am not sure how to ensure that it is a legit copy of the paid unlocker app. Is it possible that someone could just create a dummy app with the proper package name and use that as an unlocker? I'm not really sure but it is my concern. Others may have more thoughts on that. I haven't seen much info on using the unlocker approach but I also have not really looked into it either.

Personally what I do is check for the other version when the app starts. If they launched free & pro exists, it asks if they would like to uninstall the free version or launch the pro version. If they launched pro and free exists, it asks if they would like to uninstall the free version. I only do this when FirstTime = True so it doesn't bother them again on orientation changes or when running it several times in a short time span.

I don't have access to my code right now and it's been a while since I did this, but I believe I use an intent to initiate uninstalling the app. As an alternative you could also just open the market page for the other app where the uninstall button would be right there for the user to press.
 
Upvote 0

RichardN

Active Member
Licensed User
Longtime User
Some interesting points Kevin that raise further questions from me....

If you go the 'pro-unlocks-free' route how do you prevent the uninformed user deleting the pro... or even the free when he starts to get pushed for storage space?

How about check & remove the old version... Using the phone library...

B4X:
Sub CheckRemovePackage(SubjectPackage As String)

   Dim pm As PackageManager, packages As List, i As Intent, p As Int
   packages.Initialize
   packages = pm.GetInstalledPackages
  
   For p = 0 To packages.Size -1
     If packages.Get(p) = SubjectPackage Then
    
         Dim i As Intent
         i.Initialize("android.intent.action.DELETE","package:" & SubjectPackage)
         StartActivity(i)
         Return
      
     End If
   Next
  
End Sub

This sub seems to work OK. SubjectPackage is checked for then removed if present. The user has to answer cancel/OK on a dialog to confirm. In keeping with normal Android security I am guessing there is no way to do this silently ?
 
Last edited:
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
I don't think there is a way to uninstall an app silently, at least not on non-rooted phones.

As for keeping people from deleting an unlocker or the original app, I'm not sure other than to mention how it works in your app descriptions and maybe the apps themselves. Over time I have slowly tried to idiot-proof my apps but still I manage to attract them on occasion. :D

Another thought on an unlocker... I suppose you could also have them communicate back and forth, such as with a service in the unlocker. Have the free app get a value from the unlocker or something. I'm sure it can be done in a relatively secure manner as many apps use this approach. I just haven't taken the plunge.
 
Upvote 0
Top