[How To] Include file in exported app, and install on SD Card

759 views
Skip to first unread message

Darryl Zaldin

unread,
Jul 14, 2013, 2:03:11 PM7/14/13
to tas...@googlegroups.com

I found a workaround to pack the sound file into the .apk, which installs it in a folder on the SD card. For this example, refer to the app as “app.apk”, and the sound file as “sound.wav”.

1.       Assign an icon to a Task; but instead of an icon, select sound.wav. It will be packed into the .apk when exported as App, but as a custom .png file in the res/drawable/ folder. In my case it was “cust_animal_bear.png”. You can identify it by file size, as it will be the exact size of the original sound.wav.

2.       Create tasks to do the following, the first time the app runs:

a.       Create a Temporary folder on the SD Card

b.      Copy app.apk from the data/app directory into the Temporary folder, and change the extension to .zip (i.e., app.zip). You cannot browse to the file in the "Copy File" Action, so locate it with a File Browser, then manually enter the file location. E.g. "/data/app/org.domain.appname-1.apk"

c.       Extract app.zip in the Temporary folder

d.      Create a Permanent folder on the SD Card

e.      Copy the file from the Temporary folder to the Permanent folder, renaming it to sound.wav (in my case, the file on my SD Card was “Temporary/res/drawable/cust_animal_bear.png”)

f.        Delete the Temporary folder

Hope this helps!

writer

unread,
Jul 14, 2013, 9:48:29 PM7/14/13
to tas...@googlegroups.com
Great tip. It works well. You found a new world.

2013년 7월 15일 월요일 오전 3시 3분 11초 UTC+9, Darryl Zaldin 님의 말:

writer

unread,
Jul 15, 2013, 7:51:28 AM7/15/13
to tas...@googlegroups.com
And you can copy the file to '/data/data/org.domain.appname' also without root.


2013년 7월 15일 월요일 오전 3시 3분 11초 UTC+9, Darryl Zaldin 님의 말:

I found a workaround to pack the sound file into the .apk, which installs it in a folder on the SD card. For this example, refer to the app as “app.apk”, and the sound file as “sound.wav”.

mlesir

unread,
Feb 1, 2014, 2:27:58 AM2/1/14
to tas...@googlegroups.com
This tip only work on wav files? Have you try another like mp3 or even documents of text?

mlesir

unread,
Feb 1, 2014, 2:27:58 AM2/1/14
to tas...@googlegroups.com

mlesir

unread,
Feb 1, 2014, 2:28:11 AM2/1/14
to tas...@googlegroups.com

mlesir

unread,
Feb 1, 2014, 2:28:12 AM2/1/14
to tas...@googlegroups.com

Jay M

unread,
Feb 1, 2014, 8:39:47 AM2/1/14
to tas...@googlegroups.com

https://play.google.com/store/apps/details?id=com.alogblog.tkf

Try that

Jay M

On 1 Feb 2014 07:28, "mlesir" <luisc...@gmail.com> wrote:
This tip only work on wav files? Have you try another like mp3 or even documents of text?

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/groups/opt_out.

mlesir

unread,
Feb 1, 2014, 11:37:46 AM2/1/14
to tas...@googlegroups.com
I know this plugin,i use it. Lee (the creator) write me: ".. there is no way, for end user of your app made by Tasker, of not installing plugins which your app/project are using. Sorry... But its not my fault but...Tasker... "
What i want its not need it.Its not a problem use plugin to the person who make the apk but for the user in my apk he needs download two plugings and some of them sqlite3.Too much!So:
Its possible with this tip include other files?
And Pent its possible you let the plugin works without need install it? Perhaps its impossible for some reason.
Thanks and sorry i repeat the messages.

Darryl Zaldin

unread,
Feb 1, 2014, 2:21:56 PM2/1/14
to tas...@googlegroups.com
As mentioned above,the workaround works for any type of file, and theoretically has no limit on file size.

As for Kid apps, it makes sense that end users need to install the plugins. It is not fair to developers that end users can leverage the functionality of their app, without paying or agreeing to their Terms and Conditions.

mlesir

unread,
Feb 1, 2014, 3:01:21 PM2/1/14
to tas...@googlegroups.com


El sábado, 1 de febrero de 2014 20:21:56 UTC+1, Darryl Zaldin escribió:
As mentioned above,the workaround works for any type of file, and theoretically has no limit on file size.

Sorry but you talk about only sound file, but sure i dont understand you right,my english its not good.
 

As for Kid apps, it makes sense that end users need to install the plugins. It is not fair to developers that end users can leverage the functionality of their app, without paying or agreeing to their Terms and Conditions.

Yes, of course you take reason but in this case and  if i understand right Lee is willing to do, his plugin is free and without publicity. Anyway  that it would have to speak Pent and Lee, not me.

"1.       Assign an icon to a Task; but instead of an icon, select sound.wav..."

You select for example sound.wav in the Local Media option, isnt it? But after do it,  this the task dont show any icon, I am right?

Last question, can you say me what version of Tasker and App Factory you use for do this?

Thank you very much darry and sorry you have to spend your time responding me. And congratulations for the tip or workaround.

mlesir

unread,
Feb 1, 2014, 4:52:46 PM2/1/14
to tas...@googlegroups.com


El sábado, 1 de febrero de 2014 21:01:21 UTC+1, mlesir escribió:


El sábado, 1 de febrero de 2014 20:21:56 UTC+1, Darryl Zaldin escribió:
As mentioned above,the workaround works for any type of file, and theoretically has no limit on file size.

Sorry but you talk about only sound file, but sure i dont understand you right,my english its not good.
 

Now i read the original post, and its true, above you say it. 

Darryl Zaldin

unread,
Feb 6, 2014, 2:02:13 AM2/6/14
to tas...@googlegroups.com
Correct. If you select a .wav file (or whatever file you want to include in the package), it will not show an icon. (I think it shows the error icon.)

I am using Tasker and App Factory version 4.2u3.

luis carde

unread,
Feb 6, 2014, 3:13:37 AM2/6/14
to tas...@googlegroups.com

First thank you for respond me.
I can not get succes.
I have 4.3 cyanogen rom. The same tasker and app factory version that you have.
I create a project with a context and a entry task. And another task. To the two task i select the icons from media local option. I select a mp3 archive and a text archive with root explorer. There is not any message or advice. Ot seems tasker accept the icon from media file but not show any icon.
Then i select an icon to the project.
Exporte it like app.
When finish i take the apk and with root explorer extract it.
Look for the archives but i dont find anything with similar size in any folder.
What i am doing bad? I try with phone,tablet (android 4.0 and same tasker version), with only a task, installing the apk and then taking the apk from data/app, etc.

El 06/02/2014 08:02, "Darryl Zaldin" <nation...@gmail.com> escribió:
Correct. If you select a .wav file (or whatever file you want to include in the package), it will not show an icon. (I think it shows the error icon.)

I am using Tasker and App Factory version 4.2u3.

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/vsypIfYfuSg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.

luis carde

unread,
Feb 6, 2014, 3:37:20 AM2/6/14
to tas...@googlegroups.com

Finally!
I try but what i do this time (i believe you dont say or mention  it) its rename the file i want include with .png Then when i choose from media local tasker show me the icon that its a traffic signal, indeterminated danger.
With this when i extract the apk in drawable i can see the archive i was included.
Darryl and other menbers of the forum that  was try do it in past, thank you very much.
I will do more test but it seems works right.

Alexander non

unread,
Mar 8, 2014, 5:01:07 AM3/8/14
to tas...@googlegroups.com
this is awesome and genius idea thaaaanx a lot bro 

Cindy

unread,
Apr 15, 2014, 12:19:19 PM4/15/14
to tas...@googlegroups.com
> Copy app.apk from the data/app directory into the Temporary folderCopy app.apk from the data/app directory into the Temporary folder...
 
Is there a way to tell what directory the app.apk is located in? When building on my local phone its located in Tasker/factory/kids and when downloaded its located in Download. I assume when its downloaded from the store its located in data/app.
 
Thanks for any help,
Cindy

writer

unread,
Apr 16, 2014, 8:17:26 AM4/16/14
to tas...@googlegroups.com
> Copy app.apk from the data/app directory into the Temporary folderCopy app.apk from the data/app directory into the Temporary folder...
 
Is there a way to tell what directory the app.apk is located in? When building on my local phone its located in Tasker/factory/kids and when downloaded its located in Download. I assume when its downloaded from the store its located in data/app. 

 The app file is /data/data/org.domain.appname-1.apk or /data/data/org.domain.appname-2.apk when you install the app named 'appname'.

Danielo515

unread,
Jul 22, 2014, 6:25:35 AM7/22/14
to tas...@googlegroups.com
Has somebody tried with zip files? Because I would need to include several files.
Did someone figured how to fix the no-icon issue?

I know this is an off-topic question but... for web views does anyone knows if tasker includes the HTML files?

Jeremy Harris

unread,
Aug 28, 2014, 10:04:06 PM8/28/14
to tas...@googlegroups.com
Many thanks to OP, I can confirm this works for any xml/txt files up to at least 4.76 mb! Great discovery!

writer

unread,
Aug 30, 2014, 8:51:07 AM8/30/14
to tas...@googlegroups.com
Many thanks to OP, I can confirm this works for any xml/txt files up to at least 4.76 mb! Great discovery!

 Actually, it is able to include binary files in kid app from Tasker v4.3 without tricky.

   action Read Binary: load binary data from a file into a variable in base 64 format
   action Write Binary: write base 64 data from a variable to a file in binary format

Darryl Zaldin

unread,
Sep 1, 2014, 9:20:05 AM9/1/14
to tas...@googlegroups.com
Glad this is working for you all. Theoretically, it should work for any file size or type. I tested it on a Rooted device. Can anyone confirm if it works on an un-Rooted device?

Jeremy Harris

unread,
Sep 1, 2014, 10:04:25 AM9/1/14
to tas...@googlegroups.com
I made a zip of 70 files and used your method to include the file and install to sd card, then unzipped my file and all 70 files were installed correctly.

I am rooted, but did not check Use Root for any action, and no superuser permissions were requested. But for some reason, when I run my app on my wife's stock unrooted HTC, I can't get the apk to copy from "/data/..." yet.

Helder Lima

unread,
Feb 23, 2015, 2:18:09 AM2/23/15
to tas...@googlegroups.com
I think this doesnt work anymore.

Jeremy Harris

unread,
Feb 23, 2015, 5:37:36 PM2/23/15
to tas...@googlegroups.com

Still works great for me. Where are you stuck?

Message has been deleted

Jeremy Harris

unread,
Jun 23, 2017, 3:13:56 PM6/23/17
to Tasker
I have used this method successfully many times, in multiple apps. But app factory errors now. :(

alex f

unread,
Jun 24, 2017, 3:18:14 AM6/24/17
to tas...@googlegroups.com
Why don't you get the files from a server like google drive? i did it for my app and works fine, the first time, download and media files you need for your app ;)
(u can also check wireless is connected)
Alex

2017-06-23 21:13 GMT+02:00 Jeremy Harris <jharr...@gmail.com>:
I have used this method successfully many times, in multiple apps.  But app factory errors now.  :(

--

You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

John Loh

unread,
Jul 24, 2017, 12:49:01 AM7/24/17
to Tasker
I have been trying adding Darryl method using the sound.wav as of the task icon.  Before that I must rename the sound.wav to sound.png, only that I can choose from the local media, the task icon shows an exclamation mark.  But with this I can't export to an app, app factory error when processing the sound.wav.  So I can't get Darryl methods to work.

Alex, before this I have been thinking having tasker download the sound.wav the first time the app is running.  Would you share how you get it to work? how to get tasker to download the sound.wav?  In fact, I have tried HTTP GET, Browse HTTP, Send Intent, but all with no success... these command plays the sound.wav from google drive instead downloading it.

Appreciate if you can share how you did that, thanks.


On Saturday, June 24, 2017 at 3:18:14 PM UTC+8, alex f wrote:
Why don't you get the files from a server like google drive? i did it for my app and works fine, the first time, download and media files you need for your app ;)
(u can also check wireless is connected)
Alex
2017-06-23 21:13 GMT+02:00 Jeremy Harris <jharr...@gmail.com>:
I have used this method successfully many times, in multiple apps.  But app factory errors now.  :(

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.

alex f

unread,
Jul 24, 2017, 3:40:22 AM7/24/17
to tas...@googlegroups.com
Surely because your syntax was not correct:

I've created an app with kid app, an app named xxxx, i suppose its data are stored into app folder\xxxx (i check this folder exists or not)
From drive, upload your mp3 files and share them with anyone with the link, access to everyone without connexion (important), copy the link created.

Finally, into tasker:
http get:
server port: https://drive.google.com/uc?export=download&id=yourDriveShareLink
Mime type:audio/*
Output File:xxxx/sound1.mp3
Trust any certificate and label checked

First time the app is launched, download all media files as described, should work with all types of files.

Alex

To unsubscribe from this group and stop receiving emails from it, send an email to tasker+unsubscribe@googlegroups.com.
Message has been deleted

Alexander Graetz

unread,
Apr 9, 2018, 2:08:34 PM4/9/18
to Tasker

So Google just updated their policy with this:

"Malicious Behavior
We don’t allow apps that steal data, secretly monitor or harm users, or are otherwise malicious.

An app distributed via Google Play may not modify, replace, or update itself using any method other than Google Play’s update mechanism. Likewise, an app may not download executable code (e.g. dex, JAR, .so files) from a source other than Google Play. This restriction does not apply to code that runs in a virtual machine and has limited access to Android APIs (such as JavaScript in a webview or browser)"

I don't know, if this was in there before but it's the first time this has come to my attention. In one of my apps I am downloading a JavaScript file from my Google drive. I found no other way and this works pretty well. I need this file in my Kid App.

I figure Google will flag my app eventually and issue another strike. I can't let that happen. I am thinking about unpublishing the app for now.

Will we see a proper way to add files to kid apps in the foreseeable future?

João Dias

unread,
Apr 10, 2018, 7:34:32 AM4/10/18
to tas...@googlegroups.com
Thanks for bringing that up! I think you should be good. The whole premise of Tasker is to allow users to import other user's data (in essence, executable "code"). I hope they never consider that to break their TOS.

Phil Bilton

unread,
Apr 10, 2018, 7:40:17 AM4/10/18
to Tasker
I think tasker will be ok but the kid app that download files by itself will be flagged.

I'm basing this on the wording of their statement, 'modify, replace or update itself'

To import data in tasker the user has to action it, I think they are doing this to stop apps that pass all checks on the play store and then download malicious code.

João Dias

unread,
Apr 10, 2018, 7:49:16 AM4/10/18
to tas...@googlegroups.com
Hmm, maybe you're right... Maybe add a dialog in your kid app asking the user if they want to "import new data"? :)

Alexander Graetz

unread,
Apr 10, 2018, 5:13:47 PM4/10/18
to Tasker
I copied the javascript into a scriptlet and it worked. No idea why I didn't try this initially. So I am off the hook for now.

Still it would be nice to finally be able to bundle files to kid apps. I feel like I am spamming the feature request page with my kid app stuff but... can we haz zum luv? ;-)

João Dias

unread,
Apr 11, 2018, 6:21:28 AM4/11/18
to tas...@googlegroups.com
Maybe add that to the feature request page? :)

On Tue, Apr 10, 2018 at 10:13 PM, 'Alexander Graetz' via Tasker <tas...@googlegroups.com> wrote:
I copied the javascript into a scriptlet and it worked. No idea why I didn't try this initially. So I am off the hook for now.

Still it would be nice to finally be able to bundle files to kid apps. I feel like I am spamming the feature request page with my kid app stuff but... can we haz zum luv? ;-)
Reply all
Reply to author
Forward
0 new messages