How to Open a .apk with defautl Android installer?

2,131 views
Skip to first unread message

Nuno Mendes

unread,
Nov 13, 2012, 2:15:23 PM11/13/12
to tas...@googlegroups.com
As the topic says, anyway to do it? If we use action Open File, I have to manual select the android installer...I need it to be automatic, since its to export as a kid app so the end-user can install it automaticly(another app)... thanks for the help!

Pent

unread,
Nov 13, 2012, 2:23:36 PM11/13/12
to Tasker
It's an intent, you'll need to Google it then use Send Intent.

Pent

Nuno Mendes

unread,
Nov 13, 2012, 2:39:50 PM11/13/12
to tas...@googlegroups.com
what keywords should i use? "install .apk using itent"?

Nuno Mendes

unread,
Nov 13, 2012, 2:43:47 PM11/13/12
to tas...@googlegroups.com
I googled it and people saying it doesn't works. Though I can't test it since i have no idea of what is this:

Uri installUri = Uri.fromParts("package", "xxx", null); 
Intent intent = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);
startActivity
(intent);

Nuno Mendes

unread,
Nov 13, 2012, 4:38:49 PM11/13/12
to tas...@googlegroups.com
Can't seem to figure this out...

Nuno Mendes

unread,
Nov 13, 2012, 6:48:47 PM11/13/12
to tas...@googlegroups.com
Any1 faced similiar situation and can give me an example?

Nuno Mendes

unread,
Nov 13, 2012, 7:15:03 PM11/13/12
to tas...@googlegroups.com
I made it to show the program slection menu, but now it force closes...

Nuno Mendes

unread,
Nov 14, 2012, 7:18:25 AM11/14/12
to tas...@googlegroups.com
Anyone please? I need this to release my next version:)

Pent

unread,
Nov 14, 2012, 7:31:08 AM11/14/12
to Tasker

action android.intent.action.VIEW
data file:///path/to/file
type application/vnd.android.package-archive
target activity
category: none or default, try both


Nuno Mendes

unread,
Nov 14, 2012, 7:49:28 AM11/14/12
to tas...@googlegroups.com
I have tried what you said except in data i had SGS2Call/SGS2Call.apk and in type(mime) i had application/* ... i'll t4ry like that though
Message has been deleted

Nuno Mendes

unread,
Nov 14, 2012, 8:09:24 AM11/14/12
to tas...@googlegroups.com
Re-tested:

Action: Send Intent
Cat: Default (also tried none)
Mime Type: application/vnd.android.
package-archive
Data: file:///SGS2Call/SGS2CallPT.apk (tried SGS2Call/SGS2CallPT.apk)
Target : Activity

Nothing of the above worked :) As you said to do it doesn't even popups nothing, just runs the task(Send Intent) and ends..

Also, when i change to mimi type: application/* it popups the program slection(and if i slect DRM thing to install it force closes) but another problem is that I don't want this to appear either, I want it to appear the already ready to install part :)

Thanks, and sorry to bother you, maybe its buged or something?


Pent

unread,
Nov 14, 2012, 8:28:17 AM11/14/12
to Tasker
> Data: file:///SGS2Call/SGS2CallPT.apk (tried SGS2Call/SGS2CallPT.apk)

Is the directory SGS2Call really in the root of the file system ?

Pent

Nuno Mendes

unread,
Nov 14, 2012, 8:54:13 AM11/14/12
to tas...@googlegroups.com
No, on sdcard, but i also tried file:///mnt/sdcard/SGS2Call/SGS2CallPT.apk and file:///sdcard/SGS2Call/SGS2CallPT.apk and njothing

Pent

unread,
Nov 14, 2012, 9:06:23 AM11/14/12
to Tasker
I don't have any other answers it works with App Factory and there's
no permission involved.

Pent

Nuno Mendes

unread,
Nov 14, 2012, 9:30:37 AM11/14/12
to tas...@googlegroups.com
Works? You tested it? Putting a file on your sd card and run the task? I'm not even talking about app factory lol:D I didn't exported it yet... I'm just trying to work it on tasker still...

Pent

unread,
Nov 14, 2012, 10:12:39 AM11/14/12
to Tasker
> Works? You tested it? Putting a file on your sd card and run the task?

No, I'm saying that's the intent that App Factory uses to install
newly-created apps.

Pent

Nuno Mendes

unread,
Nov 14, 2012, 10:21:51 AM11/14/12
to tas...@googlegroups.com
So why isn't this working :/ Can you test it please? putting a file on your sd card and testing the itent with tasker? :)

Pent

unread,
Nov 14, 2012, 10:27:28 AM11/14/12
to Tasker
I have things to do.

Pent

Pent

unread,
Nov 14, 2012, 10:27:59 AM11/14/12
to Tasker
> I have things to do.

And this isn't a Tasker issue.

Pent

Nuno Mendes

unread,
Nov 14, 2012, 11:16:04 AM11/14/12
to tas...@googlegroups.com
Okie, thx anyway :-)

Alysson Andrade

unread,
May 28, 2014, 3:21:55 PM5/28/14
to tas...@googlegroups.com
Thank you!

For those with the same problem:

    Intent intent = new Intent();
    intent.setAction(android.content.Intent.ACTION_VIEW);
    File file = new File(""+Environment.getExternalStorageDirectory().getPath()+"/download/yourapk.apk");
    intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
    startActivity(intent);

Alfon Play

unread,
May 28, 2014, 4:41:50 PM5/28/14
to tas...@googlegroups.com
I can't get it to work =(

action android.content.Intent.ACTION_VIEW
cat Default
Mime application/vnd.android.package-archive
data %filepath
target activity

I have to change something somewhere.. 

Alfon Play

unread,
May 28, 2014, 5:05:29 PM5/28/14
to tas...@googlegroups.com
Pent always has the answer...

action android.intent.action.VIEW
cat default
mime application/vnd.android.package-archive
data file://%file
target activity

Like a charm

%file comes from for %file items %lfiles()
%lfiles comes from list files on a dir
Reply all
Reply to author
Forward
0 new messages