How to install corona apk from another corona apk

Hi,

I am trying to install a App-APK from corona App.

 

The following is the Process i have listed:

 

1-Download the APK file from server

2-save it in directory

3-Install it

 

Now the question is i am unable to install it.

I have tried it from System.openUrl()

but didn’t got success.

 

Even i tried with : os.execute("pm install " … path) 

 

Kindly please specify any Option for it.

 

Thanks

Assif Shaikh

@rob : Can u please help  :rolleyes:

Are you getting errors?

Are you constructing a path to the apk file correctly?

Are apps even allowed to install other apps? On iOS you would only be permitted to take the person to the App Store app and to the page for the app so the user could chose to install the app. Having an app install arbitrary apps without going through other official channels sounds like a suspicious activity to me.

Rob

Hey Rob, for now I am trying for ANDROID & The APK is on SD-card [Already I have created a module which detects the path successfully, so path is not a issue].

I have kept the another apk on sd-card & the following is the code that i am using :

[lua]

   

    – exePath is my Sd-card path of where Exe is kept.

    os.execute("pm install " …exePath) 

[/lua]

It has return me ‘256’, I am not getting what it is & it didn’t launch any apk install pop-up, Even I tried it with “pm uninstall” to un-install the another apk.

kindly please review it , if you want i can submit the code.

thanks,

Assif

I guess you missed my point. Any app that can arbitrarily install another app is a major security risk. I know on iOS you cannot do this. I’m pretty sure Android would not support this unless devices have been rooted, which we don’t support.

This post:  http://stackoverflow.com/questions/4604239/install-application-programmatically-on-android

seems to support the claim. One post talks about needing android.permission.INSTALL_PACKAGES which is a privilege only available to system signed apps unless the device has been rooted.

The main answers suggest using system.openURL() to the marketplace page and let people choose to install the app from a known source. 

Finally I know many Android device/versions have a setting that enables/disables installing apps from 3rd party locations and your users would have to enable that setting (off by default for security) to allow it anyway.

Rob

@rob : Can u please help  :rolleyes:

Are you getting errors?

Are you constructing a path to the apk file correctly?

Are apps even allowed to install other apps? On iOS you would only be permitted to take the person to the App Store app and to the page for the app so the user could chose to install the app. Having an app install arbitrary apps without going through other official channels sounds like a suspicious activity to me.

Rob

Hey Rob, for now I am trying for ANDROID & The APK is on SD-card [Already I have created a module which detects the path successfully, so path is not a issue].

I have kept the another apk on sd-card & the following is the code that i am using :

[lua]

   

    – exePath is my Sd-card path of where Exe is kept.

    os.execute("pm install " …exePath) 

[/lua]

It has return me ‘256’, I am not getting what it is & it didn’t launch any apk install pop-up, Even I tried it with “pm uninstall” to un-install the another apk.

kindly please review it , if you want i can submit the code.

thanks,

Assif

I guess you missed my point. Any app that can arbitrarily install another app is a major security risk. I know on iOS you cannot do this. I’m pretty sure Android would not support this unless devices have been rooted, which we don’t support.

This post:  http://stackoverflow.com/questions/4604239/install-application-programmatically-on-android

seems to support the claim. One post talks about needing android.permission.INSTALL_PACKAGES which is a privilege only available to system signed apps unless the device has been rooted.

The main answers suggest using system.openURL() to the marketplace page and let people choose to install the app from a known source. 

Finally I know many Android device/versions have a setting that enables/disables installing apps from 3rd party locations and your users would have to enable that setting (off by default for security) to allow it anyway.

Rob