I realized that many people are having the same problem with not being able to upload projects with lots of images in the assets folder. I am wondering if it's possible to create my main app in AppInventor2, then create a pseudo app in Eclipse or Android Studio that contains the images and sound files, then merge these two into one .apk file.
I am working on a picture dictionary that tells the user the pronunciation and let them record their own pronunciation for comparison. That is why I need a lot of images and sounds. Please let me know if you can think of any other solution.
--
No... There's no way to merge Eclipse projects into AI apks.
Here are some solutions for getting around the 5MB limit for images from Hossein & Taifun on Taifun's pages: http://puravidaapps.com/filebyfile.php
--
Here are some solutions for getting around the 5MB limit for images from Hossein & Taifun on Taifun's pages: http://puravidaapps.com/filebyfile.php
--
Thanks Enis. I used the Hossein's solution and I was able to package it. However I was not able to install it on my Android tablet because the final size ended up being 76MB while Android has a 50MB limit on .apk files. I will need to go the expansion file route described here: Android Apps Break the 50MB Barrier
--
you can't use expansion files with an App Inventor app
can you reduce the size of your images to be in the limit?
alternatively download the files on first run of the app
--
Webprefetch did the trick. I have all my files downloaded on first run. However, my app is still not working. It gives me an Error701 message: "Unable to load *.mp3. Error during download, please restart app." I am not sure why that is because I know the files are on the device. I am attaching a screenshot of the blocks that is supposed to pick an image and a sound from a list that looks like this:
abacus.mp3
abacus.png
accordion.mp3
accordion.png
etc.
--
it seems to be, the path to your files is not correct
you probably want to fix that error and adjust the error message in the Screen.ErrorOccurred event
--
When you say the path to my files is not correct, do you mean to download them or to read them? If it's to download, that part is solved because all the files are downloaded to the tablet. If it is to read them, I am not sure how to tell the app to look in a specific location (I thought it would find them automatically as long as they are in memory). It is my first time really having media files outside of the assets folder.
--
If it is to read them, I am not sure how to tell the app to look in a specific location
see also the Top 5 Tips: How to learn App Inventor
here is the description: Accessing Images and Sounds
try something like this:
set Player.Source = file:///mnt/sdcard/myDirectory/myFile.mp3
how do you access the mp3 files currently to play them?
a screenshot of the relevant block could help incl. Do it result to see the path you are using currently
--
I searched some more and tried playing with the code. I'm still not getting it to work. Here is a screenshot of the blocks with
set Player.Source = file:///mnt/sdcard/myDirectory/myFile.mp3
The other screenshot is of my tablet for the Do it result.
I read on the forum that this worked for someone else. I'm not sure why it's not working in my case. Saving Images on your Device
--
1. as already said, adjust the error message in the Screen.ErrorOccurred event, because the error message is misleading... the download worked fine, correct?
2. did you realize, that this is error 703 now? last time you had error 701...
3. how large are these mp3 files? probably you should use the Player component insetead of the Sound component?
--
Regarding the error message
: "Unable to load *.mp3. Error during download, please restart app."
Did you really ask for a wild card (*.mp3) ?
I'm not sure that will work.
--
: "Unable to load *.mp3. Error during download, please restart app."
I'm not sure that will work.
--
Sorry for the late follow up. I was out of town last week.
-I adjusted the error message.
- For the different error numbers, I realized that it is because ai2 is not able to load files that have spaces in the file name (Not a problem, I can fix that)
- the mp3 files are fairly short. The sound component handle those that are in the assets folder very well. (So sound or player is not the problem).
The problem still is in accessing files saved to the sd card. I played with the address path and tried to write it in different ways. It is still not working. I found that when I set the sources as simply "pick item from a list" (see screenshot below), when I am using the ai companion, the sounds play, no more error message for sound but the images still don't show. However, when I build the apk, it does not even play the sound anymore, I get the error message again. It's like I get different results when I am using the companion or the installed app.
The wild card was just to say "whatever the name of my audio file". Sorry for the confusion.
--
The problem still is in accessing files saved to the sd card. I played with the address path and tried to write it in different ways. It is still not working
unfortunately you did not say, what you tried...
as already said, try something like this:
set Player.Source = file:///mnt/sdcard/myDirectory/myFile.mp3
a screenshot of the relevant block could help incl. Do it result to see the path you are using currently
--
These are are the paths I tried. Everything joined by the name of the file as "myFile.mp3" format. None of them worked.
Do it result is the same Error 701. I searched the forum, read what you asked other users to do and everything. I think that's it for me and app inventor.
file:///mnt/sdcard0/data/do-not-delete/webprefetch/
Do it result is the same Error 701. I searched the forum, read what you asked other users to do and everything. I think that's it for me and app inventor.
file:///mnt/sdcard0/data/do-not-delete/webprefetch/
storage/sdcard0/data/do-not-delete/webprefetch/
sdcard0/data/do-not-delete/webprefetch/
sdcard/data/do-not-delete/webprefetch/
/data/do-not-delete/webprefetch/
data/do-not-delete/webprefetch/
--
it seems to be, you are not familiar with Do it? see also tip 4 here
--
it seems to be, you are not familiar with Do it? see also tip 4 here
this would help you to find out, which path you are actually using
did it work to display the image? if yes, you know, that the path is correct...
and: see also the answer to question 2 here https://puravidaapps.com/filebyfile.php#q how to put together the path to an image to display, and this works similar for sound files
btw. you first had error 701, then error 703 and now error 701 again?
--
It did not work to display the image.
which means, your path is wrong, why do you do that manually?
how does your strPath variable look like?
see again the answer to question 2 here https://puravidaapps.com/filebyfile.php#q how to put together the path to an image to display, and this works similar for sound files
--
댓글 없음:
댓글 쓰기