Auto start after app update

joneden

Active Member
Licensed User
Longtime User
Hi All,

I've got my app to check for an update from my website and if necessary download it then install it. Installation occurs using the following and it all works.

B4X:
            Dim i As Intent
            i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "temp.apk"))
            i.SetType("application/vnd.android.package-archive")
            StartActivity(i)

This is great BUT it doesn't auto launch the app once installed. Is there a way to do that?

Regards,

Jon
 

joneden

Active Member
Licensed User
Longtime User
Hi Erel,

Yeah that's what I thought should happen. When I install the APK it works but I never get the Done/Open message. it just reverts to the Android homescreen.... The app does install though.

Any suggestions why I'm not seeing that message. I did think at the time it was odd that a message didn't appear!

Regards,

Jon
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
Hi Erel,

Yes that's the weird thing - normal installations work just fine... It's just when I've downloaded that I get this.

Regards,

Jon
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
No I was wrong, the app doesn't finish getting installed... I see the install, click on and then it bombs out...
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
To make this clear, my app starts the installer just fine - I see the Replace app message to which I press OK. Then the Do you want to install this application? ... message with a list of elements that can be accessed appears. I press Install... The normal screen that shows that stuff is being installed then briefly appears before bombing out.

I've looked at the logs but can't yet find anything obvious....
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
Hi Erel,

Any thoughts on this - or advice on what to look for in the logs?

I take it that the apk name doesn't matter as it's whats inside that counts :)

Also I take it that plenty of other people have got theirs to update themselves.

Given both of the above holding true I'm at a loss to figure it. The good news is that on my S2 and Nexus 7 the update behaviour is the same so it doesn't sem to be some hardware quirk.

Regards,

Jon
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
Hi Erel,

It just disappears - no error message or anything. I see it flash up for an instant and then nothing. The android desktop / homescreen appears at that stage.

I've looked in the logs but with so much going on and not knowing what to look for nothing stood out.

Regards,

Jon
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
It should be - I take the main.apk from the object folder after it's compiled. same version...

The log file shows the existing app being shut down and then several messages about not granting permission to the package.

What is the best type of log to be reading - I'm using the CatLog software, is that appropriate?

Regards,

Jon
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
Hi Erel,

Sorry do you mean the logs in the Basic4Android application? If so I'm running Jelly bean and can't get them to work.

If you mean in android where are they?

Regards,

Jon
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
Hi Erel,

Ah yes I can now. OK so that's a lot of data - I've reverted to my Nexus for this as it has a minimal installation on it so has less messages.

I'm getting a lot of data like that shown below. What is the stage that the install button triggers? Obvipously the log runs from before then till way after so isolating the line is tricky...

Regards,

Jon


Start proc amonet.mobile for broadcast amonet.mobile/.amonetmobilewidget$amonetmobilewidget_BR: pid=2868 uid=10065 gids={3003, 1015, 1006, 3002, 3001, 1028}
START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=amonet.mobile/.main bnds=[35,1094][128,1187] u=0} from pid 598
Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@41ace4e8 (uid=10038 pid=598)
START {flg=0x20000 cmp=amonet.mobile/.activitydashboard u=0} from pid 2868
START {flg=0x20000 cmp=amonet.mobile/.activitysettings u=0} from pid 2868
unable to find stats for iface rmnet0
START {act=android.intent.action.VIEW dat=file:///storage/sdcard0/temp.apk typ=application/vnd.android.package-archive flg=0x20000 cmp=com.android.packageinstaller/.PackageInstallerActivity u=0} from pid 2868
START {dat=file:///storage/sdcard0/temp.apk cmp=com.android.packageinstaller/.InstallAppProgress (has extras) u=0} from pid 1483
No content provider found for permission revoke: file:///storage/sdcard0/temp.apk
No content provider found for permission revoke: file:///storage/sdcard0/temp.apk
Force stopping package amonet.mobile uid=10065
Killing proc 2868:amonet.mobile/u0a65: force stop
Force finishing activity ActivityRecord{4202db20 amonet.mobile/.main}
Force finishing activity ActivityRecord{41aa7aa0 amonet.mobile/.activitydashboard}
Force finishing activity ActivityRecord{41ab7c70 amonet.mobile/.activitysettings}
Force finishing activity ActivityRecord{41c88358 com.android.packageinstaller/.InstallAppProgress}
WIN DEATH: Window{41dbf918 amonet.mobile/amonet.mobile.activitydashboard paused=true}
WIN DEATH: Window{41ee62f8 amonet.mobile/amonet.mobile.activitysettings paused=true}
WIN DEATH: Window{41b65c90 amonet.mobile/amonet.mobile.main paused=true}
Package amonet.mobile codePath changed from /data/app/amonet.mobile-2.apk to /data/app/amonet.mobile-1.apk; Retaining data and using new
Force stopping package amonet.mobile uid=10065


Code path for pkg : amonet.mobile changing from /data/app/amonet.mobile-2.apk to /data/app/amonet.mobile-1.apk
Resource path for pkg : amonet.mobile changing from /data/app/amonet.mobile-2.apk to /data/app/amonet.mobile-1.apk
Not granting permission android.permission.REBOOT to package amonet.mobile (protectionLevel=18 flags=0x8be44)
Not granting permission android.permission.DUMP to package amonet.mobile (protectionLevel=50 flags=0x8be44)
Unknown permission android.permission.RECORD_VIDEO in package amonet.mobile
Not granting permission android.permission.WRITE_SECURE_SETTINGS to package amonet.mobile (protectionLevel=50 flags=0x8be44)
Force stopping package amonet.mobile uid=10065
Received broadcast Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:amonet.mobile flg=0x8000010 (has extras) }
Received broadcast Intent { act=android.intent.action.PACKAGE_ADDED dat=package:amonet.mobile flg=0x8000010 (has extras) }
removePackageParticipantsLocked: uid=10065 #1
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
Hi Erel,

What I hadn't appreciated was that the log file shown in that window starts way earlier than when you press the connect button - I was seeing it like others that i've used.


B4X:
START {act=android.intent.action.VIEW dat=file:///storage/sdcard0/temp.apk typ=application/vnd.android.package-archive flg=0x20000 cmp=com.android.packageinstaller/.PackageInstallerActivity u=0} from pid 13724


** Activity (activitysettings) Pause, UserClosed = false **


Start proc com.android.packageinstaller for activity com.android.packageinstaller/.PackageInstallerActivity: pid=14216 uid=10027 gids={1028}


loaded /system/lib/egl/libEGL_tegra.so


loaded /system/lib/egl/libGLESv1_CM_tegra.so


loaded /system/lib/egl/libGLESv2_tegra.so
Enabling debug mode 0


Displayed com.android.packageinstaller/.PackageInstallerActivity: +309ms


Ignoring unknown permission:android.permission.RECORD_VIDEO


START {dat=file:///storage/sdcard0/temp.apk cmp=com.android.packageinstaller/.InstallAppProgress (has extras) u=0} from pid 14216


Replacing package:amonet.mobile


No content provider found for permission revoke: file:///storage/sdcard0/temp.apk


Displayed com.android.packageinstaller/.InstallAppProgress: +88ms


No content provider found for permission revoke: file:///storage/sdcard0/temp.apk


GC_CONCURRENT freed 1950K, 42% free 11429K/19523K, paused 3ms+26ms, total 119ms


Removing non-system package:amonet.mobile


Force stopping package amonet.mobile uid=10065
Killing proc 13724:amonet.mobile/u0a65: force stop
  Force finishing activity ActivityRecord{420434b8 amonet.mobile/.main}
  Force finishing activity ActivityRecord{41bb6150 amonet.mobile/.activitydashboard}
  Force finishing activity ActivityRecord{4232c5d8 amonet.mobile/.activitysettings}
  Force finishing activity ActivityRecord{41aa7aa0 com.android.packageinstaller/.InstallAppProgress}
WIN DEATH: Window{42523860 amonet.mobile/amonet.mobile.activitysettings paused=true}


WIN DEATH: Window{42038c10 amonet.mobile/amonet.mobile.activitydashboard paused=true}


WIN DEATH: Window{41aba8a0 amonet.mobile/amonet.mobile.main paused=true}
Running dexopt on: amonet.mobile


Package amonet.mobile codePath changed from /data/app/amonet.mobile-2.apk to /data/app/amonet.mobile-1.apk; Retaining data and using new
DexOpt: load 63ms, verify+opt 332ms, 1296692 bytes


Force stopping package amonet.mobile uid=10065


Code path for pkg : amonet.mobile changing from /data/app/amonet.mobile-2.apk to /data/app/amonet.mobile-1.apk


Resource path for pkg : amonet.mobile changing from /data/app/amonet.mobile-2.apk to /data/app/amonet.mobile-1.apk
New package installed in /data/app/amonet.mobile-1.apk


Not granting permission android.permission.REBOOT to package amonet.mobile (protectionLevel=18 flags=0x8be44)
Not granting permission android.permission.DUMP to package amonet.mobile (protectionLevel=50 flags=0x8be44)
Unknown permission android.permission.RECORD_VIDEO in package amonet.mobile
Not granting permission android.permission.WRITE_SECURE_SETTINGS to package amonet.mobile (protectionLevel=50 flags=0x8be44)
Force stopping package amonet.mobile uid=10065


ComponentInfo: ResolveInfo{41e26248 com.android.apps.tag.TagViewer p=0 o=0 m=0x108000}, techs: android.nfc.tech.Ndef, 


Reconfiguring input devices.  changes=0x00000010


GC_EXPLICIT freed 1721K, 44% free 11057K/19523K, paused 19ms+9ms, total 94ms


generateServicesMap(android.accounts.AccountAuthenticator): 3 services unchanged


ComponentInfo: ResolveInfo{41e45860 com.android.apps.tag.TagViewer p=0 o=0 m=0x108000}, techs: android.nfc.tech.Ndef, 


Reconfiguring input devices.  changes=0x00000010


Handling replaced theme package: amonet.mobile


generateServicesMap(android.content.SyncAdapter): 12 services unchanged


Received broadcast Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:amonet.mobile flg=0x8000010 (has extras) }
generateServicesMap(android.accounts.AccountAuthenticator): 3 services unchanged
generateServicesMap(android.content.SyncAdapter): 12 services unchanged


Received broadcast Intent { act=android.intent.action.PACKAGE_ADDED dat=package:amonet.mobile flg=0x8000010 (has extras) }
removePackageParticipantsLocked: uid=10065 #1
addPackageParticipantsLocked: #1
Start proc com.android.gallery3d for broadcast com.android.gallery3d/.app.PackagesMonitor: pid=14253 uid=10019 gids={1006, 3003, 1015, 1028}


Pub com.android.gallery3d.provider: com.android.gallery3d.provider.GalleryProvider


Start proc com.android.keychain for broadcast com.android.keychain/.KeyChainBroadcastReceiver: pid=14272 uid=1000 gids={1015, 3002, 3001, 3003, 1028, 3007}


GC_EXPLICIT freed 858K, 45% free 10835K/19523K, paused 17ms+9ms, total 131ms


Start proc com.android.voicedialer for broadcast com.android.voicedialer/.VoiceDialerReceiver: pid=14291 uid=10041 gids={3002, 1028}


No longer want com.google.android.partnersetup (pid 13514): hidden #16
Start proc com.google.android.gms for broadcast com.google.android.gms/.plus.receiver.ClearAppSettingsReceiver: pid=14305 uid=10030 gids={3003, 1015, 1028, 1007, 2001, 3006}


No longer want com.bel.android.dspmanager (pid 13563): hidden #16


Scheduling restart of crashed service com.bel.android.dspmanager/.service.HeadsetService in 5000ms
Pub com.google.android.gms.plus;com.google.android.gms.plus.action: com.google.android.gms.plus.provider.PlusProvider


No longer want com.google.android.inputmethod.latin.dictionarypack (pid 13739): hidden #16
Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=14320 uid=10029 gids={1015, 1028}


Pub com.svox.pico.providers.SettingsProvider: com.svox.pico.providers.SettingsProvider


Start proc com.google.android.partnersetup for broadcast com.google.android.partnersetup/.RlzPingBroadcastReceiver: pid=14333 uid=10049 gids={3003, 1028}
No longer want com.cyanogenmod.updater (pid 13639): hidden #16


Pub com.google.android.partnersetup.rlzprovider: com.google.android.partnersetup.RlzProvider


Pub com.google.android.partnersetup.rlzappprovider: com.google.android.partnersetup.RlzAppProvider
No longer want com.android.settings (pid 13653): hidden #16


Start proc com.bel.android.dspmanager for service com.bel.android.dspmanager/.service.HeadsetService: pid=14353 uid=10011 gids={3002, 1028}


Starting service.
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
Didn't mean to submit that as is but reviewing on the screen is easier than in notpad. Doesn't look to be anything there that would explain the crash.. Re the permissions issues any suggestions why they'd be coming up?

regards,

Jon
 
Upvote 0
Top