Android docs is very slow in ADT r20 - android

I updated my ADT to r20. It becomes very slow to open the docs when I have internet connection. But it works well in offline mode.
It is very slow to open xxx.html in the docs directory by clicking them directly.
why? And how to fix it?
I found the problem. The url is something wrong when the html file accesses internet to download some resource files. I get these information when I access the docs' html file.
GET file://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumi‌​talic,bold
GET file://www.google.com/jsapi/
The two are to download js files from internet, but fail to get them due to the wrong url.
How to prevent the two url accessing the internet? There are so many html files in docs, it is impossible to edit them all.
Help!

Related

How to set Proxy Auto Config (PAC) file in sdcard of Android

Excuse me?
I pushed the file 'proxy.pac' to sdcard using this command:
adb push C:\Users\zuokang.li\Documents\proxy.pac /sdcard/
I try to set proxy auto config in android. So I set pac url "file:///sdcard/proxy.pac".But it cannot work.
I don't know whether it is set right. Can you help me ? Thanks!
Apparently Android doesn’t accept setting a local PAC file (127.0.0.1 doesn't seem to work either) and may even cause browser crashes for an invalid proxy port (-1). Therefore either
Use http://some_host/proxy.pac and store the file on some host, or
Use Firefox for Android and the exact same settings you used above (verified) - see https://www.topbug.net/blog/2015/03/02/configure-proxy-using-pac-files-on-firefox-for-android/ for info.
I experienced the same issue with my android phone, and searching for a solution I noted that the only one is to access to a web server for getting the .pac file (as Roy explains). But I wanted the solution (all about this) locally in my phone.
I installed a thin web server in my phone called SimpleHttpServer from Google Play and proceed as you do to set the .pac file using the URL provided by the web server (previously, I created a directory, located the .pac file inside it and pointed the web server root folder to that directory).
Additionally, I installed Simple Text Editor for .pac file edition and everything works as expected.
For use a PAC file in Android you can use Drony, looks ugly, but works! Even if you need authentication.
https://play.google.com/store/apps/details?id=org.sandroproxy.drony
Since file:/// is disabled on Android, you can convert the pac file to base64 and use this format:
data:application/x-ns-proxy-autoconfig;base64,

Getting 492 value in DownloadManager.COLUMN_STATUS (download failed)

I am using DownloadManager to download files. I am getting 492 status when download fails. However I can download the same file from any browser. The error is frequently coming for some files. After searching about the status I got that this error comes when the device does not have enough memory to store download file, but on my device I left with 2 GB of storage. Can some one please help me to work around this problem.
Hi think I found the solution. The downloading was getting failed because of special character in title. I removed the special character and then download was working fine.
Another possible source of the problem, which I think is more general, is that destination folder is not exists (and DownloadManager not always creating it for you - it is platform dependent for some reason).

HTML 5 app Download a file to the same directory as the app

I am using Phonegap to create a html 5 app and I would like to be able to download a file from the internet, and store it in the same directory as the app is in.
So, my app will open index.html, and in that folder the file needs to be saved.
After that, it needs to check if it has internet connection, and if not, it needs to open the file I just downloaded.
How can I do this?
I believe that if you just download it, it will go in the default download map.
Also Will there be a difference when downloading/saving this file on an android or iOs device?
I would like to be able to download a file from the internet, and store it in the same directory as the app is in.
The install location of the application is unavailable for writing in most of the platforms due to security.
However, you can write to a persistent location using the File API.
it needs to check if it has internet connection, and if not, it needs to open the file I just downloaded. How can I do this?
There are two parts to this, first is the check for internet connection, which can be accomplished using the Connection object. The latter part can again be done using the File API.

how to use android_asset

I try to make Webview from to display application/x-shockwave-flash embed element in my app, but i have blank gray screen on emulator and white on device. There are many topics about this problem but any1 really solved.
I explore log of simillar app and see: file//android_asset/index.html. So question... this static file or i can get it from web or modify it.
I trying get my data video.loadDataWithBaseURL() from web, but can i have that data from local storage?
Maybe I said something wron but it's look for me like 'convert web data to local'?? Can some one help my in my problem or explain in this question.
Thank you.
file://android_asset/ is a way that allows android apps access assets by a network-based URI. But assets represent neither local nor online files, they are packed into your apk. Put any files in assets folder in a android project and they will be packed into the apk file by the builder.

HTML5 Offline app on Android devices

This is regarding HTML5 offline apps on Android devices.
We are running into an issue where bookmarking an offline capable HTML5 app (with a complete cache manifest file) fails to load on the Android browser under the following conditions:
Bookmark the app on the browser
Switch off all wireless connectivity
Close the browser completely
Attempt to launch the bookmark from the homescreen
We end up with an "Unable to connect to the internet" message. The app works perfectly fine on iOS devices when saved to homescreen and on airplane mode.
Is there a specific way the app should be saved, or is this an Android specific quirk?
I'd check and see that:
MIME type really is text/cache-manifest.
Your cache-manifest starts with CACHE MANIFEST, your urls thereafter are either relative to the manifest or absolute URLs.
You don't have any broken links in your manifest, or a forced NETWORK: tag.
So, I had faced similar issues with chrome and android on multiple instances. Apparently there is no issue with the implementation because I tried it on FF and it worked just fine, and the same was true about safari. The only thing I presume this is caused by is, the data is getting cache for the web page on the RAM when chrome is running. If you close the browser, and android ends the process a fresh instance of chrome is initialized and your existing app data is gone. I cannot confirm this, but it seems very likely that it might be the issue.
Also check your server is configured to send the mime type correctly: How to set up your server to send the correct MIME types
What's the file name of your cache manifest? I have heard that the extension could affect android's behavior. Make sure your file ends with .manifest
In addition, make sure your server is correctly serving the MIME type for manifest files, which is text/cache-manifest
In addition to Ben Max Rubinstein's and Compid's answer, if your app url is something like this: example.com/myapp you need to add a following forward slash, like this: example.com/myapp/.
When you are online the server will redirect you automatically, but if your are offline obviously that cannot happen.
What I encountered was that the .manifest files in Apache's mime.types configuration was correctly set to text/cache-manifest and then several lines below was overwritten as application/x-ms-application (for compatibility with MS' ClickOnce thing). To resolve this I've taken different file name ending, namely .cachemanifest, configured correctly its mime type, restarted Apache, renamed manifest file as cache.cachemanifest, changed my <html> manifest attribute to point to this file, and then I was finally able to cache my web app on Android (there wasn't any problem in desktop browsers which apparently don't care about the mime type of cache manifest file). Hope this helps.

Categories

Resources