Android Question AppUpdating and B4XPages

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Does this (https://www.b4x.com/android/forum/threads/version-safe-apk-installation.87667/#content) work with B4XPages

my test app downloads, then starts the install (I get the install screen) and then after a while the screen goes away and I am left with an Icon for the app on the screen but when I click on the icon it says App Not Found

Before I get crazy (just one step to the right) wanted to make sure that a B4XPages App could update itself using this code or required some other action.

I have tried copying the new version of the app to my device and clicking on that and it installs properly

Thanks

And Happy Holidays to ALL

BobVal
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
A little more information.

It turns out the App is being installed but the following problems happen.
1) After install it just goes away (in a normal B4A app you get the option to open after install - this doesn't happen)
2) The icon that was on the screen says Not found
But if I do Menu click and select Close All then click on the icon the app starts.

So it appears to be that something isn't completing that Close All seems to fix.

UPDATE:

AS for number 2 - turns out my device must just be real slow. If I wait longer that problem solves it self (meaning clicking on icon will work)

But I still never get the dialog box to open the app after installing.

Any ideas welcome.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Hadn't tried restarting.

B4X app : But just did, and same thing. Installs and just ends (program installs fine, just never get the open afterwards)
B4A app : Installs fined and gives open dialog.

Going to table this until I can make two lightweight examples

As long as it is installing fine, I can live with not getting the open dialog (but just seems liked something is wrong).
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Well after doing the
B4X:
                Dim in As Intent
            
                in.Initialize(in.ACTION_VIEW,"" )
            
                mDownloadFileProvider.SetFileUriAsIntentData(in, mUpdateFile)
                
                If  xPhone.SdkVersion >= 24 Then
                    in.Initialize("android.intent.action.INSTALL_PACKAGE", mDownloadFileProvider.GetFileUri(mUpdateFile))
                    in.Flags = Bit.Or(in.Flags, 1) 'FLAG_GRANT_READ_URI_PERMISSION
                Else
                    in.Initialize(in.ACTION_VIEW, "file://" & File.Combine(mDownloadFileProvider.gSharedFolder, mUpdateFile))
                    in.SetType("application/vnd.android.package-archive")
                End If
                                
                StartActivity(in)
                
                ExitApplication                    '  Added this line

Adding the ExitApplication caused the OPEN dialog to display.

But selecting OPEN does nothing the App doesn't start.
But at least clicking on the ICON does now launch the app

Sure that my 70 old brain is just having more farts that thoughts this time of year.

LOL - Happy Holidays to all


Holiday Lights - Happy Holidays.jpg
 
Upvote 0
Top