Spanish Auto Actualizacion del .apk (App)

xamminf

Member
Nada, sigue sin abrime. Adjunto algunos hitos de mi codigo:

B4X:
Private Sub SendInstallIntent
    'Dim ApkName As String = "2nd_app.apk"
    Dim ApkName As String = "almacen_badname.apk"
    Log("Paso 4")
    'File.copy(File.DirAssets, ApkName, Starter.Provider.SharedFolder, ApkName)
    Log("Paso 5")
    Dim i As Intent
    If phone.SdkVersion >= 24 Then
        Log("Paso 6")
        i.Initialize("android.intent.action.INSTALL_PACKAGE", Starter.Provider.GetFileUri(ApkName))
        i.Flags = Bit.Or(i.Flags, 1) 'FLAG_GRANT_READ_URI_PERMISSION
        Log("Paso 6.1")
    Else
        Log("Paso 7")
        i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(Starter.Provider.SharedFolder, ApkName))
        i.SetType("application/vnd.android.package-archive")
    End If
    Log("Paso 8")
    StartActivity(i)
    Log("Paso 9")
    ExitApplication
    Log("Paso 10")
End Sub

Muestra hasta "Paso 9" lo cual es correcto, porque debe hacer el ExitApplication

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

AddManifestText(<uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    android:maxSdkVersion="28" />
)

AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <files-path name="name" path="shared" />
)
AddPermission(android.permission.REQUEST_INSTALL_PACKAGES)


AddPermission(android.permission.MY_PACKAGE_REPLACED)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…