embedded HTML/JavaScript does not work on all devices???

1,268 views
Skip to first unread message

Taifun

unread,
Sep 7, 2012, 6:08:05 PM9/7/12
to ai...@googlegroups.com

in the meantime I received 2 mails with people having problems with the embedded HTML/JavaScript

the example used was in both cases the dynamic table layout http://puravidaapps.com/table.php,
the error is "Web page not available: file:///android_asset/table.html?FirstName%2CLastName%2C..."

It works on HTC Desire with Android 2.2!

I now tested on Samsung Galaxy Tab 10.1N with Android 3.2 and I can confirm that it also does not work there.
After some more testing it seems to be, that all the examples with input parameters do not work on some devices, the examples without input parameter work.

It does not work on
1) HTC One S with Android 4.0.3
2) Motorola Droid ?
3) Samsung Galaxy Tab 10.1N with Android 3.2

Any ideas? Attached the table layout example as apk file
table.apk
DroidAppErr.JPG

Howard Richoux

unread,
Sep 7, 2012, 8:20:33 PM9/7/12
to ai...@googlegroups.com
Hi Taifun - I was going to email you directly, but this seems like a better spot.  I have spent a lot of time making variations on the dynamic tables app and testing them a variety of ways.  Things I THINK I know:

1. The "development address ("file:///mnt/sdcard/AppInventor/assets/table.html") works with the SDK emuator and with my Droid Razr hooked up via the block editor (I solved the Droid problem by turning on the USB developer debug option like I should have long ago). If this development address is used when building an apk, the error while the app runs is the "file not found" one - perfectly reasonable - and it displays the whole URL "file:///mnt/sdcard/AppInventor/assets/table.html?xxx%2Cyyy%@c..." rather than just the filename portion.

2. I can create an "absolute" file address on the sdcard - the one I used is "file:///mnt/sdcard/aaMyStuff/mytable.html", and I created the folder and placed the file there with Windows Explorer.  Using several app install methods, I was able to install the appropriate table.apk, and it worked just fine.  Trying that address in the emulator environment gets the appropriate file not found displaying the entire URL, not just the filename.  This test file did display the rest of the URL as a table like the demo intended.

3. Trying to use the "production" address of "file:///android_asset/table.html" has not worked for me.  I've tried three different install techniques - the file manager you suggested, and 2 App Install type apps.  All give the same "file not found" error when the button is clicked.  From a NON-expert-android perspective, it would appear to me that when the apk is installed on my Droid (Android v4.0.something), the media files are not being placed in an "android_asset" subfolder of whatever the default folder is.  I had fits this morning trying to install a file manager that would look at the hidden files where all this is supposed to be going on, so I really can't draw any conclusions. 

I think I recall a very early asset test where I loaded a "media file" photo into a viewer and it displayed correctly from an installed apk.  This suggests that maybe "official" media files like jpgs are treated differently from things like an html file that is loaded as media.  I also think I tried a non fancy-URL version of the test just trying to load an html file media file into the WebViewer - that would get rid of a number of questionable areas - but my recollection is that the test failed.  It is not the fanciness of the URL that is the problem, but the install location of the media file that is the problem.

I'm in the process of trying to get my Galaxy 7 working so I can test with it, but that might (or might not) be different from the Galaxy 10.  I also own an ASUS transformer which I will try as well.  Oh well...  I'm getting to learn setup/installation....

Howard

Howard Richoux

unread,
Sep 8, 2012, 12:27:06 PM9/8/12
to ai...@googlegroups.com
I've done a LOT more testing.

1. If I use either the "barcode" or the "download to phone" methods of preparing and downloading, both work fine with the production address.  At this point, I'm 98% sure that the problem I had in getting the table.apk  to run correctly was due to not installing it correctly (I'm still not sure precisely what was going wrong, but everything points to that).  I'm using Astro to perform the install and tests go well.

2. I'm 98% sure that the "file not found" error is precisely that - the WebViewer is correctly parsing the URL, but it can't find the named file.  That the error message shows the whole URL rather than just the file portion is probably not significant.  It can't find the file named because my faulty install must have placed the app in either the "development" or "production" location, so the media file is just not where it is looking.

3. I am doing related tests with the html file having a bunch of "<img src=..." with a variety of places to load the jpg from and the results are quite consistent with development/production addresses. 

Glitch - App Inventor testing leaves the media files from a "development" test still on the phone, so the image file can still be found later in a production run.

Glitch - App Inventor does not reliably replace uploaded media files with newer uploaded versions (deleting first then uploading,but old file still used in test).  It seems to be necessary to close out the browser session and restart the AI and block editor to have the replaced media files fully operational.

4. I have not completed all permutations of SDK emulator, USB connection to phone and apk install, but I am confident that Taifun's fancy URL technique in the table demo is completely functional on my Droid Razr, whereas I had been getting the file not found error yesterday

Howard.

Taifun

unread,
Sep 8, 2012, 2:14:30 PM9/8/12
to ai...@googlegroups.com
to open a webviewer without input parameters works, e.g. this one: http://puravidaapps.com/snippets.php#html

the problem are the input parameters!
currently I used the location.search property http://www.w3schools.com/jsref/prop_loc_search.asp
I now also tested the location.hash property http://www.w3schools.com/jsref/prop_loc_hash.asp which returns the anchor portion of a URL, including the hash sign (#), but unfortunately same error...

Taifun

Howard Richoux

unread,
Sep 8, 2012, 4:27:23 PM9/8/12
to ai...@googlegroups.com

Hi Taifun - as usual, you are correct.  I can NOT successfully execute (my compilation) of your table.apk configured with the production address on my Droid Razr phone.  I had made so many different tests, I needed to test that again specifically.

BUT - I CAN successfully install and execute a very similarly constructed dynamic table app in apk form by using a manually downloaded "table.html" into a location that I choose on the phone (I placed it at "file:///mnt/sdcard/aaMyStuff/mytable.html").  All I needed to do was construct the URL using the exact address of where I downloaded the file and then append the "?" and the URI-encoded table.

What this means to me is that the problem is not with the WebViewer or the handling of the URL, HTML and JavaScript, but "just" that it can't find the file in the specific location "file:///android_asset/table.html".  Since I know very little about the internals of Android, I have no idea if the App installation code is unique to each manufacturer or if it is part of the general version release.  The fact that the apk does install on some or many other phones suggests that there is something different about my phone, and I guess, some others. 

The Astro file manager (free version) does not show me any "android_asset" folder that I can locate (hidden?).  I'm not completely sure I understand that address syntax anyway - web searches did not clarify the syntax for me.  Where should that file:/// address take me and what tool should I use to try to locate the file?

Howard

Taifun

unread,
Sep 8, 2012, 4:50:50 PM9/8/12
to ai...@googlegroups.com
BUT - I CAN successfully install and execute a very similarly constructed dynamic table app in apk form by using a manually downloaded "table.html" into a location that I choose on the phone (I placed it at "file:///mnt/sdcard/aaMyStuff/mytable.html").  All I needed to do was construct the URL using the exact address of where I downloaded the file and then append the "?" and the URI-encoded table.
yes that works, in that case you would have to provide the html file outside of your app
 
What this means to me is that the problem is not with the WebViewer or the handling of the URL, HTML and JavaScript, but "just" that it can't find the file in the specific location "file:///android_asset/table.html". 
the simple examples without input parameters should work on your device, e.g. try this one: http://puravidaapps.com/snippets.php#html and let me know if it works on your device!


The Astro file manager (free version) does not show me any "android_asset" folder that I can locate (hidden?).  I'm not completely sure I understand that address syntax anyway - web searches did not clarify the syntax for me.  Where should that file:/// address take me and what tool should I use to try to locate the file?
Gary found that out and he looked into the App Inventor sources, see also here: https://groups.google.com/d/msg/ai4a/zn88WY5bH_4/zi90UDu96-AJ
he might shed some light onto this soon...
Taifun

Scott Ferguson

unread,
Sep 8, 2012, 6:04:21 PM9/8/12
to ai...@googlegroups.com
I found that file://localhost/mnt/sdcard/AppInventor/assets/mydoc.html also works in the WebViewer's url Source block. (note: two // rather than three ///)
Perhaps that will work for more devices with 'file://localhost/android_asset/mydoc.html'   ?
---

Howard Richoux

unread,
Sep 8, 2012, 6:41:17 PM9/8/12
to ai...@googlegroups.com


On Saturday, September 8, 2012 1:50:50 PM UTC-7, Taifun wrote:
BUT - I CAN successfully install and execute a very similarly constructed dynamic table app in apk form by using a manually downloaded "table.html" into a location that I choose on the phone (I placed it at "file:///mnt/sdcard/aaMyStuff/mytable.html").  All I needed to do was construct the URL using the exact address of where I downloaded the file and then append the "?" and the URI-encoded table.
yes that works, in that case you would have to provide the html file outside of your app
The point is not the absolute address which would be silly to try to distribute with, but that there is some URL construction with arguments that DOES work on my Droid Razr (Android 4.0.4). )
 
What this means to me is that the problem is not with the WebViewer or the handling of the URL, HTML and JavaScript, but "just" that it can't find the file in the specific location "file:///android_asset/table.html". 
the simple examples without input parameters should work on your device, e.g. try this one: http://puravidaapps.com/snippets.php#html and let me know if it works on your device!
Yes, the "html" app is fully functional when installed on my phone.  But, if I modify the address by adding "?argument" to it, it fails. 

The Astro file manager (free version) does not show me any "android_asset" folder that I can locate (hidden?).  I'm not completely sure I understand that address syntax anyway - web searches did not clarify the syntax for me.  Where should that file:/// address take me and what tool should I use to try to locate the file?
Gary found that out and he looked into the App Inventor sources, see also here: https://groups.google.com/d/msg/ai4a/zn88WY5bH_4/zi90UDu96-AJ
he might shed some light onto this soon...
The implication of the other thread is that this "android_asset" usage problem might be Android release dependent, but since I can use a fully qualified address and args together in an Android 4 device, it must be more subtle than that.
Howard
 

Gary

unread,
Sep 9, 2012, 8:12:25 AM9/9/12
to ai...@googlegroups.com
WOW, you guys are digging DEEP!!!

I am still doing some other stuff and not spending the time I want here but:

The file:///android_asset Uri is part of android. I could not find good documentation about it, but it is a way to point to the files in the assets folder in all android apps. App Inventor puts the files you add there. Look at assets in http://developer.android.com/tools/projects/index.html#ApplicationProjects 


But that would not get in the way of reading parameters... hmmm

Install Firefox or some other browser and see if that works.

-----
Very good work all!!!


Howard Richoux

unread,
Sep 9, 2012, 12:00:35 PM9/9/12
to ai...@googlegroups.com
A lot of tests this morning. I think there are six significant URLs to examine - development address, production address and a manually loaded files address, each with and without something attached to the end of the filename - I'm using "?argument" - this is the equivalent of Taifun's table construction

The six URLs each need to be examined three ways on my system (more if I can get some other devices connected).



Development - connected to SDK Emulator
file:///mnt/sdcard/AppInventor/assets/hello.html - OK - expected, development address
file:///mnt/sdcard/AppInventor/assets/hello.html?argument - OK - expected, development address

file:///android_asset/hello.html - FAIL - expected, production address
file:///android_asset/hello.html?argument - FAIL - expected, production address

file:///mnt/sdcard/aaMyStuff/hello.html - FAIL - expected, file not actually there
file:///mnt/sdcard/aaMyStuff/hello.html?argument - FAIL - expected, file not actually there

--------------------------------------------------------------------------------------------------
Development - connected to Droid Razr (Android 4.0) in USB debug mode

file:///mnt/sdcard/AppInventor/assets/hello.html - OK - expected, development address
file:///mnt/sdcard/AppInventor/assets/hello.html?argument - OK - expected, development address

file:///android_asset/hello.html - FAIL - expected, production address
file:///android_asset/hello.html?argument - FAIL - expected, production address

file:///mnt/sdcard/aaMyStuff/hello.html - OK - expected, file manually downloaded to this location
file:///mnt/sdcard/aaMyStuff/hello.html?argument - OK - SOMEWHAT UNEXPECTED - theory was that something in higher level Android was causing problem

--------------------------------------------------------------------------------------------------
Production - APK built, downloaded to Droid Razr via barcode and installed with Astro file manager.  I'm not sure I know how to do the equivalent with the SDK emulator

file:///android_asset/hello.html - OK - expected, production address, nothing fancy
file:///android_asset/hello.html?argument - FAIL - UNEXPECTED - code worked when connected to the Droid in debug mode, previous test show file is physically present at that location - problem seems to be that URL is not parsed correctly in this mode.

file:///mnt/sdcard/AppInventor/assets/hello.html - OK - UNEXPECTED - development address - I think this means that the development files are still present after the app testing was finished

**********************
file:///mnt/sdcard/AppInventor/assets/hello.html?argument - OK!! - VERY UNEXPECTED - I had already written up why this would not work while waiting for the download. Previous test says file is actually there (somewhat accidentally), but failure would be the URL parsing problem.  I rebuilt/reloaded just to make sure.  Really need to think about this one.....  In one sense, it is not surprising that it worked - it worked un USB debug mode, but this is not consistant with URL parsing theory of failure.
**********************

file:///mnt/sdcard/aaMyStuff/hello.html - skipped this test, I'm about out of time for the day, next test should be sufficient

file:///mnt/sdcard/aaMyStuff/hello.html?argument - OK - formerly somewhat unexpected if the problem was that later versions of Android couldn't parse URLs correctly for arguments, but this is starting to seem less likely.


--- I know this is somewhat hard to read in the Forum format, but I think this covers a set of permutations, and is definitely food for thought.  Out of time for the day - will get back later - Howard

Taifun

unread,
Sep 9, 2012, 12:28:02 PM9/9/12
to ai...@googlegroups.com
@Howard, thanks very much for your tests!

as we have seen, to call a html document stored as asset in App Inventor with input parameters is only possible with devices running Android 2.x, but not with devices runninng Android 3.x/4.x. Therefore the html document needs to be downloaded to the device on first run of the app to be able to access it with all Android versions. The good news is that we do not have the hassle with development / production path anymore, this works in development and production with the same path.
see version 2 of the dynamic table example here http://puravidaapps.com/table2.php

Taifun
puravidaapps.com

Taifun

unread,
Sep 9, 2012, 1:22:20 PM9/9/12
to ai...@googlegroups.com
@Howard I just read your test again more carefully, you said
file:///mnt/sdcard/AppInventor/assets/hello.html?argument - OK!! - VERY UNEXPECTED

before testing an apk file you have to make sure to delete or rename that directory file:///mnt/sdcard/AppInventor/assets
else you think, that it works because you are accessing the development files from the packaged app in this case which are still there on your development device!
Taifun

Howard Richoux

unread,
Sep 9, 2012, 1:30:10 PM9/9/12
to ai...@googlegroups.com
Hi Taifun - the one that really puzzles me is the one I have flagged with "*****"s.   It is in an apk installed on a phone running Android 4.0 with input parameters.  By all rights, it should not work.  First part of the theory of why it works is that the actual assets being referenced are the ones left over from a USB connected test.  I surmise that when the test is over, the asset files are not erased.  Second part of the theory says that "with input parameters" works if the file actually exists where the "file:///xxx" part of the URL points to.

More than one of the tests involved a URL with input parameters being executed on an Android 4 device, so it is not strictly the Android version that distinguishes success from failure.  I suspect you are right about a 2 vs 3/4 factor, but that might be a symptom, rather than a cause.

I think one of the the next things I need to learn/investigate is the "manifest" part of the apk, which I think declares assets and where they are to be found/placed.  Theoretically, AI could be constructing the apk with some declarations that were OK in 2.0, but not in higher versions, and the assets are not being placed correctly to be referenced later.

Howard

Taifun

unread,
Sep 9, 2012, 1:36:28 PM9/9/12
to ai...@googlegroups.com
First part of the theory of why it works is that the actual assets being referenced are the ones left over from a USB connected test. 
exactly that I was trying to say:

Howard Richoux

unread,
Sep 9, 2012, 1:40:15 PM9/9/12
to ai...@googlegroups.com
Hi Taifun - you were writing while I was composing the other message.  I'm going to be traveling this ween and at the moment, my laptop is not set up for AI.  If I can get all that working, I will follow up with more testing.  I am definitely suspicious of things left over from previous tests.  I will need to do the cleanup steps. 

I am pretty unclear on exactly whose "assets" are being stored where.  I think I understand that "AppInventor" is an app, and "Hello" is an app also.  It is not clear to me how "Hello" can reference assets owned by another app (AppInventor).  The reason I'm pressing so hard on this problem is that it "feels" solvable - or at least that is solvable by the MIT people in AppInventor code in some future release.  The complex URL is a very significant technique, and I would hate to not have it available higher than Android 2.

]Howard

Howard Richoux

unread,
Sep 9, 2012, 1:45:26 PM9/9/12
to ai...@googlegroups.com
Yes.....  but how precisely are we able to reference them?

Never mind...  I see - this is just a variation on my test where I download the files to a manually created location.  In this case, we are using a hard-coded absolute address of where AppInventor places its stuff during USB-connected tests. 

Actually - I had not looked at that folder before - skipped right over it a hundred times while moving stuff in and out of 'aaMyStuff'

Once again, I need to ponder for a while.  It still feels solvable.

Howard

Taifun

unread,
Sep 9, 2012, 1:52:05 PM9/9/12
to ai...@googlegroups.com
I am pretty unclear on exactly whose "assets" are being stored where.
The app has an two assets: hello.html and icon.png
and during development all the assets are stored in this directory: file:///mnt/sdcard/AppInventor/assets
Taifun

Gary

unread,
Sep 10, 2012, 6:43:25 AM9/10/12
to ai...@googlegroups.com

On Sunday, September 9, 2012 11:00:35 AM UTC-5, Howard Richoux wrote:
...

--------------------------------------------------------------------------------------------------
Production - APK built, downloaded to Droid Razr via barcode and installed with Astro file manager.  I'm not sure I know how to do the equivalent with the SDK emulator

Howard Richoux

unread,
Sep 10, 2012, 9:51:59 AM9/10/12
to ai...@googlegroups.com
Hi Taifun - Yes, those are the assets of the Hello app, but during development, the "app" (if that is what it is), being run is AppInventor, which is downloading and running the Hello app code.  Pretty clearly, it is storing Hello's assets in a place it has created for itself "file:///mnt/sdcard/
AppInventor/assets".  It must then also adjust the Hello code to get the files from these.  When I look at that AppInventor assets folder, I see assets from multiple projects, not just Hello. 

My gut says that the App Inventor web code needs a command "clear assets" to clean out leftover stuff.  I have also detected glitchy situations where I uploaded a new version of an asset file, but that the app ws still finding the older version.  Completely stopping and restarting AI fixed this, but it was somewhat of a surprise.

Since my "Aha!" moment yesterday, I think that there are only 4 URL cases to examine because my "aaMyStuff" folder is simply a variation on the technique that AppInventor is using during development - storing the html file in a fully qualified absolute disk location.  The URL with parameters appears to work correctly on all versions of Android if the file name portion is that absolute type of address.

What we call our "production" address appears to be some sort of relative addressing technique, possibly unique to Android, where "file:///android_asset/" is a location on the sdcard that designates "an area reserved for this particular app" rather than an exact file location on the card.  I am guessing that this is comparable to the location "desktop" in Windows (although this can be computed to a fully qualified file name down the "c:\Users..." path). It is possible that we can figure out a "real" address for app assets, but I suspect that it is hidden for security purposes and may require more privileges than an app normally gets.

My current theory for the URL problem is that whatever code is that parses the URL changed between Android 2 and Android 3 in its handling of mapping "android_asset" to a real file location.  I have no opinion on whether the change was accidental or intentional, but I have certainly seen other situations in the past where the specifications for parsing arguments changed between releases of a piece of software, and it is possible that the "with parameters" was just accidentally being parsed usefully and was "fixed".

It is also possible (I have no evidence or knowledge) that this is something that the App Inventor software can fix, if they choose to.  It all depends on exactly which portions of the WebViewer code they control and which belongs to Android.

Howard
To me personally, that little URL "trick" is very valuable - it is the difference between doing everything in the AI app, or having to write a server somewhere to build some html dynamically from an http get.  I can make some good arguments that I should just go write a server, but I have enough new learning on my plate as it is. 

Taifun

unread,
Sep 10, 2012, 5:23:12 PM9/10/12
to ai...@googlegroups.com
all the assets of your projects are stored in this directory: file:///mnt/sdcard/
AppInventor/assets
what do you think about my new version 2 of the example? http://puravidaapps.com/table2.php would that work for you?
Taifun

Howard Richoux

unread,
Sep 10, 2012, 7:21:30 PM9/10/12
to ai...@googlegroups.com
Hi Taifun - I will need to study it further, but it appears to be a valid approach.  It correctly runs when installed on my phone. 

I think I see the "trick" - grab a copy of the table.html file from a website and store it on the phone in an absolute address location where we can pick it up later and join with the table parameter string to create the dynamic table as we did before.  The website fetch is necessary because it is the (only?) way we have to write a file to an absolute location on the phone, from an AI app.

 I need to study it further because I am not familiar with the notifier component and I'm not sure how the tinydb is needed/used.  I need to figure out where to place my http data retrieval and what things I do not need any more  Placing my table html on a website is no problem.

Once again, My hat's off to you.  I think you have an answer.

Howard

Taifun

unread,
Sep 10, 2012, 8:09:04 PM9/10/12
to ai...@googlegroups.com
 I need to study it further because I am not familiar with the notifier component and I'm not sure how the tinydb is needed/used. 
the notifier is used to display a success message after downloading the html file
TinyDB is used to store the path to the downloaded html file and to be able to download the file only on first run of the app
Taifun

Howard Richoux

unread,
Sep 10, 2012, 10:26:46 PM9/10/12
to ai...@googlegroups.com
Hi Taifun - I guess I'm starting to wonder if a lot of this is necessary for my purposes.  My app needs internet access to do anything sensible,so there is no good reason (I think) that I can't just leave the table html file on my website, do the http get to fetch the stock data, then construct the fancy URL with the data pointing to the table file on my website.  Unless I'm missing something obvious, I think it should work as well as anything.

I'm probably going to want a tinydb to store the stock symbols to fetch, so I might as well learn how that works anyway

Fun, fun, fun...  Howard

Taifun

unread,
Sep 11, 2012, 8:06:35 AM9/11/12
to ai...@googlegroups.com
if you have a fast internet connection you do not need to download the html file
Taifun

phantomfoot

unread,
Oct 16, 2012, 6:58:44 AM10/16/12
to ai...@googlegroups.com

This is a known issue for Android 3.0 up, webview does not accept parameters in the URL:

 

http://code.google.com/p/android/issues/detail?id=17535 

 

Star it! They say they've fixed it but will only come out on a future release of Android. They discuss several workarounds, but none I believe are suitable for the limitations of Appinventor.

 

S

Taifun

unread,
Oct 16, 2012, 9:57:01 AM10/16/12
to ai...@googlegroups.com
@phantomfoot: Thank you for the info, I will investigate...
Taifun

Gary

unread,
Oct 16, 2012, 2:25:47 PM10/16/12
to ai...@googlegroups.com
Thanks. I added my star :-)

I am fighting with App Inventor and App Engine and uploading files. It would be nice if the components were all working well.

mit...@juno.com

unread,
Mar 23, 2013, 11:19:13 PM3/23/13
to ai...@googlegroups.com

Hello All,

I know this is a bit old thread, but I am having exactly the same issues as described in this thread. My question is: while using the emulator what location on my Windows directory do I save the HTML file? How does file:///mnt/sdcard/AppInventor/assets map to C:\... etc?

I am sorry if it is a simple question, but I just could not figure out.

Thanks.

On Monday, September 10, 2012 2:23:12 PM UTC-7, Taifun wrote:
all the assets of your projects are stored in this directory: file:///mnt/sdcard/AppInventor/assets what do you think about my new version 2 of the example? http://puravidaapps.com/table2.php would that work for you?
Taifun

Gary

unread,
Mar 24, 2013, 7:20:13 AM3/24/13
to ai...@googlegroups.com
The directory file:///mnt/sdcard/AppInventor/assets is on the device. You kind sorta do not want to know where it is on Windows.

You use adb to move the html file to the emulator. My accurate but a bit terse response
points to which adb command.

I'll poke a bit and see if I can elaborate.

Gary

unread,
Mar 24, 2013, 7:54:47 AM3/24/13
to ai...@googlegroups.com

On Monday, September 10, 2012 5:43:25 AM UTC-5, Gary wrote:

To move a file from you Windows machine to the emulator:

Read 'Copying Files to or from an Emulator/Device Instance'
  http://developer.android.com/tools/help/adb.html#copyfiles

Find adb.exe. Mine is here "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe"

Open a shell and enter

Gary@DEV ~/Downloads
$ ls index.html
index.html

Gary@DEV ~/Downloads
$ "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" shell ls sdcard/AppInventor/assets
icon.png
base64Simple.html

Gary@DEV ~/Downloads
$ "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" push index.html sdcard/AppInventor/assets
11 KB/s (904 bytes in 0.078s)

Gary@DEV ~/Downloads
$ "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" shell ls sdcard/AppInventor/assets
icon.png
base64Simple.html
index.html


You check that the file you want to move is there
That the directory you want to move the file to is there
Push the file to the folder
and check that it worked

-----
now for the simple answer

To get the file into file:///mnt/sdcard/AppInventor/assets
Use App Inventor, put the file into the assets in the designer and App Inventor will make sure it is in the assets folder on the emulator

---
and to continue being thorough
be sure to change the location in your block when you generate an apk.

Claudio Aguilera

unread,
Apr 1, 2018, 7:41:30 AM4/1/18
to App Inventor for All
Hola Taifun. Él bajó tu aplicación de muestra y no funciona. Tira el errorERR_FILE_NOT_FOUND. SI primero las ejecutas como aia desde el MIT si funciona, dado que a modo prueba los archivos se suben a un  archivo: /// mnt / sdcard / AppInventor / assets / <NOMBRE DE SU ARCHIVO HTML> .html

Por cierto. Un pasado bastante tiempo y la dirección  http://puravidaapps.com/  table2.php  ya no existe. Ingrese por https://puravidaapps.com/snippets.php#2htmlread.

Muy buenos tus aportes en la red.


El domingo, 9 de septiembre de 2012, 13:28:02 (UTC-3), Taifun escribió:
@Howard, ¡muchas gracias por tus pruebas!

como hemos visto, llamar a un documento html almacenado como activo en App Inventor con parámetros de entrada solo es posible con dispositivos que ejecutan Android 2.x, pero no con dispositivos que ejecutan Android 3.x / 4.x. Por lo tanto, el documento html debe descargarse al dispositivo en la primera ejecución de la aplicación para poder acceder a él con todas las versiones de Android. La buena noticia es que ya no tenemos problemas con la ruta de desarrollo / producción, esto funciona en el desarrollo y la producción con el mismo camino.
vea la versión 2 del ejemplo de la tabla dinámica aquí http://puravidaapps.com/ table2.php

Taifun
puravidaapps.com

Taifun

unread,
Apr 1, 2018, 12:55:55 PM4/1/18
to App Inventor for All
Reply all
Reply to author
Forward
0 new messages