Wednesday, February 12, 2014

android monitor their application covering installation


            
According to custom PackageReceiver said online classes inherit BroadcastReceiver, rewritten onReceive method.
 / / install 
if (intent.getAction (). equals ("android.intent.action.PACKAGE_ADDED")) {
String packageName = intent.getDataString ();
System.out.println ("android.intent.action.PACKAGE_ADDED---------------" + packageName);
}
/ / Cover installation
if (intent.getAction (). equals ("android.intent.action.PACKAGE_REPLACED")) {
String packageName = intent.getDataString ();
System.out.println ("android.intent.action.PACKAGE_REPLACED---------------" + packageName);
}
/ / Remove
if (intent.getAction (). equals ("android.intent.action.PACKAGE_REMOVED")) {
String packageName = intent.getDataString ();
System.out.println ("android.intent.action.PACKAGE_REMOVED---------------" + packageName);
}

Then AndroidManifest.xml inside:
  










Why bluestack simulator can listen to cover to install their own applications, and in less than a real machine, it was listening.
Reply:
Not sink ah! ! !
Reply:
Your application has activity it? Receive boot complete broadcast it?
Reply:
reference to the second floor tantahe reply:
your application has activity it? Receive boot complete broadcast it?

There is activity, but did not use the boot complete broadcast can talk about specific ideas?
Reply:
reference to the third floor HuiTaiLang_1988 reply:
Quote: references to the second floor tantahe reply:

Your application has activity it? Receive boot complete broadcast it?

There is activity, but did not use the boot complete broadcast can talk about specific ideas?

You test the machine on which?
Reply:
references, 4th Floor tantahe reply:
Quote: references to the third floor HuiTaiLang_1988 reply:

Quote: references to the second floor tantahe reply:

Your application has activity it? Receive boot complete broadcast it?

There is activity, but did not use the boot complete broadcast can talk about specific ideas?

You test the machine on which?

Millet 2
Reply:
Then I found yesterday in the simulator installed another client, the client also has code that listens applications covering installation. So install additional applications will once again listen to cover the installation events. That is not applied on the simulator itself listen to their cover installation.
Reply:
Replace the monitor itself can not upgrade because after you perform an operation after installing the application itself has been killed
Reply:
reference to the 7th floor tanwei4199 reply:
replace the monitor itself can not upgrade because after you perform an operation after installing the application itself has been killed < / blockquote>

If I install the application A, then B applications covering installation, how can obtain B application configuration file and the application configuration file A A applications together to use it?
Reply:
Can you write a global broadcast monitor applications covering installation is to uninstall the application and not with the demise?
Reply:
Quxianjiuguo it, save the version number up to get the application version when you start the application, to keep up with the last saved version, and if large, then it shows just installed the new version.
int versionCode = context.getPackageManager (). getPackageInfo (context.getPackageName (),
. 0) versionCode;
int version = PrefUtil.getLastVersion (context) ;/ / get last restore version
if (version PrefUtil.setLastVersion (context, versionCode) ;/ / restore new version
/ / Do something.
}
Reply:
reference to the 8th floor HuiTaiLang_1988 reply:
Quote: references to the 7th floor tanwei4199 reply:

Replace the monitor itself can not upgrade because after you perform an operation after installing the application itself has been killed

If I install the application A, then B applications covering installation, how can obtain B application configuration file and the application configuration file A A applications together to use it?

What are you referring to the configuration file is? There you are with a b a a cover not start
Reply:
reference to the 9th floor HuiTaiLang_1988 reply:
can write a global broadcast monitoring applications covering installation is to uninstall the application and not with the demise?
unacceptable. Applications cover the installation process is to first stop the currently running application and then re-install the file cover, after the installation is complete, then send android.intent.action.PACKAGE_REPLACED broadcasts.
Reply:
reference to the 10th floor chrisechou reply:
Quxianjiuguo it, save the version number up to get the application version when you start the application, to keep up with the last saved version to compare if large, it shows just installed the new version.
int versionCode = context.getPackageManager (). getPackageInfo (context.getPackageName (),
. 0) versionCode;
int version = PrefUtil.getLastVersion (context) ;/ / get last restore version
if (version PrefUtil.setLastVersion (context, versionCode) ;/ / restore new version
/ / Do something.
}

Save the version number does not work, because most likely the same version of the cover is installed.
Reply:
reference to the 11th floor tanwei4199 reply:
Quote: references to the 8th floor HuiTaiLang_1988 reply:

Quote: references to the 7th floor tanwei4199 reply:

Replace the monitor itself can not upgrade because after you perform an operation after installing the application itself has been killed

If I install the application A, then B applications covering installation, how can obtain B application configuration file and the application configuration file A A applications together to use it?

What are you referring to the configuration file is? There you are with a b a a cover not start

Is a file stored locally in the assets directory, recording some of the configuration information of the installation package. B covered with a, a is started.
Reply:
reference to the 12th floor chrisechou reply:
Quote: references to the 9th floor HuiTaiLang_1988 reply:

Can you write a global broadcast monitor applications covering installation is to uninstall the application and not with the demise?
unacceptable. Applications cover the installation process is to first stop the currently running application and then re-install the file cover, after the installation is complete, then send android.intent.action.PACKAGE_REPLACED broadcasts.

It seems that listens to install radio coverage is not feasible, and did not know any other way?
Reply:
reference to the 14th floor HuiTaiLang_1988 reply:
Quote: references to the 11th floor tanwei4199 reply:

Quote: references to the 8th floor HuiTaiLang_1988 reply:

Quote: references to the 7th floor tanwei4199 reply:

Replace the monitor itself can not upgrade because after you perform an operation after installing the application itself has been killed

If I install the application A, then B applications covering installation, how can obtain B application configuration file and the application configuration file A A applications together to use it?

What are you referring to the configuration file is? There you are with a b a a cover not start

Is a file stored locally in the assets directory, recording some of the configuration information of the installation package. B covered with a, a is started.

After you determine a b cover can also start a? The same package name?
Reply:
reference to the 16th floor tanwei4199 reply:
Quote: references to the 14th floor HuiTaiLang_1988 reply:

Quote: references to the 11th floor tanwei4199 reply:

Quote: references to the 8th floor HuiTaiLang_1988 reply:

Quote: references to the 7th floor tanwei4199 reply:

Replace the monitor itself can not upgrade because after you perform an operation after installing the application itself has been killed

If I install the application A, then B applications covering installation, how can obtain B application configuration file and the application configuration file A A applications together to use it?

What are you referring to the configuration file is? There you are with a b a a cover not start

Is a file stored locally in the assets directory, recording some of the configuration information of the installation package. B covered with a, a is started.

After you determine a b cover can also start a? The same package name?

Ah after starting the application after installation coverage, a configuration has been saved to the database. Then restart the application a configuration information is not lost. So instead of reminding me, can I regarded each installation b b configuration file stored in the database, just add a conditional judgment, this will get to the a and b of the configuration information.
Reply:
Overinstall this road leads nowhere, but they think of another idea:
Database files are deleted when the cover is installed can not afford it, after installing a, a configuration file stored in the database. Then install b, b configuration files are also stored in the database, in order to prevent each time you start the application reads the configuration file, check the configuration file to determine when to add a condition to meet the conditions, then you get the display, does not meet the conditions will not be displayed.
Reply:
Problem solving, and finally to the aid of the database for each installation package configuration information is stored about, so installing a second covering first check whether there is a direct application of the latter configuration information from the database according to the configuration file assets under no storage, the next step operation, there is a direct show. Get.
Reply:
Overinstall this road leads nowhere, but they think of another idea:
Database files are deleted when the cover is installed can not afford it, after installing a, a configuration file stored in the database. Then install b, b configuration files are also stored in the database, in order to prevent each time you start the application reads the configuration file, check the configuration file to determine when to add a condition to meet the conditions, then you get the display, does not meet the conditions will not be displayed.
        

No comments:

Post a Comment