I am creating an Android application and I need a button to send my application to another phone.
I tried putting apk and sending to another, but I can not do this. I am using this code:
Intent sharei=new Intent(Intent.ACTION_SEND);
sharei.putExtra(Intent.EXTRA_STREAM,Uri.parse("android.resource://com.packa.ge/raw/hafez.apk"));
sharei.setType("application/vnd.android.package-archive");
startActivity(Intent.createChooser(sharei, "share"));
but it does not work.
I saw a Persian application: in the context menu, one of the elements was: “Send via Bluetooth”, and when I touched this, he sent the apk file to another phone.
I packed my application and put it in the Raw folder for sending, but this does not work correctly for the second or third phone.
he said: "I am creating an Android application, I have to put a button to send my application to another phone," I think he is talking about sending the same application in which it works.
Andrea Bellitto
Yes. I need to send the current application.
source
share