-1

How can I use packageinstaller to install apps programmatically in Android? If I try to use

import com.android.packageinstaller;

I get "The import com.android.packageinstaller cannot be resolved" error.

When I try directly use PackageManager I cannot use installPackage function:

The method installPackage() is undefined for the type PackageManager

How could I install 1.app obtained my web server by the other? Is it possible at all?

VladRia
  • 1,475
  • 3
  • 20
  • 32
  • 1
    I think if the apk is present in the SD card you can call an intent to install the apk file, if that is what you are trying to achieve – George Thomas Oct 13 '14 at 12:04
  • 2
    Maybe this question helps you solve your problem: http://stackoverflow.com/questions/4967669/android-install-apk-programmatically – Corbella Oct 13 '14 at 12:10
  • It's possible through intents; see the linked duplicate. However, it's *not* possible without the user approving it first. That is a **Good Thing**. – 323go Oct 13 '14 at 12:49

1 Answers1

0

This is because it is not part of Android SDK. It is internal package. installPackage() also not open either.

You can use this packages, methods if you are OEM & compiling against android source code.

Akhil
  • 6,667
  • 4
  • 31
  • 61