1

I want to write the two applications which satisfy:

  1. The application should be hidden Automatically from launcher after installation.

  2. the second application should have a button, when clicked it should launch & run first program. Indeed it's a launcher for first program that Sets setting then launch.

  3. how install this two program with one apk.

Uma Kanth
  • 5,659
  • 2
  • 20
  • 41
reza3d
  • 11
  • 2
  • 2
    Why do you want two apps in one apk? – nasch May 27 '15 at 17:04
  • because the second program should launch just from first. – reza3d May 29 '15 at 12:32
  • As CommonsWare said, you can't have two apps in one APK. And as far as I know there is no way to make the standard launcher hide your app. There may be a custom launcher out there that would do that but of course your users generally won't be using that. Maybe if you can explain your motivation for doing this we can help find an alternative solution that will work for you. – nasch May 29 '15 at 14:36

2 Answers2

1

In order to install one apk from another you should add one of your apk as asset to another apk. Then in the apk which contains apk in its assets folder you can use intent to install the apk in the assets

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(
    new File(Environment.getExternalStorageDirectory() +  "/Download/yourApkFromAssets.apk")
), "application/vnd.android.package-archive");

Do not forget first to copy your file from assets to Download folder.

Allan Pereira
  • 2,572
  • 4
  • 21
  • 28
Svetlana
  • 26
  • 4
0

how install this two program with one apk

That is not possible. There is one app per APK in Android, at least at the present time.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491