aspose file tools*
The moose likes Android and the fly likes Stop package installation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Stop package installation" Watch "Stop package installation" New topic
Author

Stop package installation

rashmi swamy
Greenhorn

Joined: Oct 05, 2010
Posts: 14
Hi,
I want to stop the installation of package under process. I am going through PackageManagerService.java which is responsible for installation. Can you please tell me how does the installation path flows and how can I stop the installation. Is there any observer for installation status?

Thanks,
Rashmi
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369

There are broadcasts that flag successful installation of a new package but I am not sure if there are public APIs for flagging "installation-in-progress status".


[List of FAQs] | [Android FAQ] | [Samuh Varta]
rashmi swamy
Greenhorn

Joined: Oct 05, 2010
Posts: 14
Thanks for fast reply. Yes I have checked the broadcast intent for Successful Package installation. But I want stop it if its in progress. This I am trying to stop the market applications installation. Or can you please tell How can I stop the download from market app.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
What would this achieve that removing the package after the installation has completed -manually or programmatically- wouldn't achieve? What kind of code is this that would block -in effect countermand- a presumably user-initiated action?


Ping & DNS - updated with new look and Ping home screen widget
rashmi swamy
Greenhorn

Joined: Oct 05, 2010
Posts: 14
I am doing some research on android market and, I want to manage(block/unblock) Android market app programatically.
That means if I say block android market then , from the android market app downloading/installation must not happen.
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369

rashmi swamy wrote:I am doing some research on android market and, I want to manage(block/unblock) Android market app programatically.
That means if I say block android market then , from the android market app downloading/installation must not happen.

Meaning user should be able to start Android Market(client app on every phone). But not install/download any app?

If so, isn't that like controlling the way other app(Android market) behaves from within your app?
Wouldn't the safe way to do this would be to ask the user to not use Android market or uninstall it?
rashmi swamy
Greenhorn

Joined: Oct 05, 2010
Posts: 14
Let me explain this with more details.
As part of my research, I am writing a device administrator kind of thing, similar on lines of active sync provisioning we have in windows mobiles. Where there will be certain policies sent by the administrator. The use case goes as follows.
Device administrator sends the policies to wipe the phone memory on theft of the phone. So that unauthorized user cant access my data on the phone. Similarly I want to have a control on the usage of Android Market App.

1. If the device administrator blocks the usage of market app, the user should not be able to launch the android market.

2. In case the market app is launched and app is being downloaded/installing and during this process of downloading/installing the app, the Device administrator blocks the usage of market app, then it should stop downloading/installation immediately.

what we tried :
1. We tried clearing the data of market app while download is ongoing by using the clearApplicationUserData API in ActivityManager Class
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
boolean res = am.clearApplicationUserData("com.android.vending", new ClearUserDataObserver());


Result : It shows the Download is in progress , but once the download completes . it will not install the package.i have checked that in the file system the apk is not present.so in this case user may be charged for the downloading the app which cant be installed. this will be unfair to the user.so how can i stop the download itself.similarly how do i handle the case of installation in progress of the market app and then try to stop it ?

your inputs to this will very helpful

Rashmi.



Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
rashmi swamy wrote:2. In case the market app is launched and app is being downloaded/installing and during this process of downloading/installing the app, the Device administrator blocks the usage of market app, then it should stop downloading/installation immediately.

Again: Why? What does this achieve that removing the package after installation does not achieve?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stop package installation
 
Similar Threads
oracle.jdbc.pool.*
product with jre installation included, but invisible?
Netbeans 6.7 with TomCat 6.0
Confusion with type 1 driver
simple web browser in java