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,
Related
I am not able to use localhost with xamarin.android application.
I have executed Web project & Service project(not mobile app) on Chrome Browser.
The displayed port number I tried browsing in Android Studio emulators & Genymotion emulators by appending 10.0.2.2: & 10.0.3.2: respectively, I got result Bad Request-Invalid Hostname. Even I have tried Service project port number, both not working.
Web Project: ASP.NET project using Visual Studio 2017 & Having service project in the same solution.
Open your solution folder. You might have several projects inside 1 folder, you don't need project's folder but the root one. Inside you'd have .vs/config/applicationhost.config file, open it.
find <sites> inside you'll have sites that you are running, might have several, if you switch startup projects in one solution. The name will be corresponding to one displayed by IIS in taskbar when you right-click it's icon. The tag could be, for example, <site name="ServerApp" id="2">.
Now you need to add a line to bind external connections to your machine ip, for example
<site name="ServerApp" id="2">
...
<bindings>
...
<binding protocol="http" bindingInformation="*:60424:127.0.0.1" />
</bindings>
</site>
Set appropriate port number and protocol, what matters here is just map them to 127.0.0.1, not "localhost" then they will be available for android emulator via 10.0.2.2:60424 (the port number 60424 is just from the example above, use yours)
You can use our free extension Conveyor https://marketplace.visualstudio.com/items?itemName=vs-publisher-1448185.ConveyorbyKeyoti
If the IP that Conveyor gives you doesn't work, just substitute it with 10.0.2.2. Using Conveyor solves the problem of needing to make IIS Express bind to other hostnames. It also has some other features too.
I have solved this issue from third party software ngrock
Check this Android emulator not connecting to localhost api
A shoutout to the Top answer for putting me on the right track. In my configuration I certainly needed to change the binding to 127.0.0.1 instead of localhost in the solution config file.
Since I'm using Rider, the config file was in a different location. Check it out:
Under run/debug configurations, click the link open in editor next to (a checked by default) Generate applicationhost.config. This opens up the config file for editing.
In addition to the above, I also had to update the applicationUrl property in that same project's launchsettings.json file to use the loopback IP instead of localhost:
Restarting the service (and afterward the client) should go without saying, but one can never be too careful.
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.
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,mediumitalic,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!
I need to work on android gingerbread sourcecode. I have linux (ubuntu) but no internet connection. My friend is already having the sourcecode downloaded to his system(ubuntu) from internet. Is it possible to copy and paste the code from his sytem to mine with out any issues running it? If it is possible, please specify the file paths if you know.
There should be no problems when copying source code from one machine to the other. No paths should be specified, it should work fine as is.
Both getting code from remote location via network or copying it form another machine are conceptually equivalent. After all both are just "copying" data to you computer.
I am trying to load local HTML (that exists in the project's folder structure) in an instance of webStageView. While this works fine in windows and ipad/iphone - it fails to locate the files in Android (only tried it in 2.2)
File.applicationDirectory.url returns "app:"
File.applicationStorageDirectory.url returns "app-storage:"
File.applicationDirectory.nativePath returns an empty string, as specified in Adobe's documentation.
The problem is that the webview gives a "Web page not available, app:/test/index.html not found" error. Is there a way to get the full path, or to "force" the browser to understand that app: refers to a specific folder?
Thanks!
As Adobe help states:
The app: and app-storage: schemes are not supported.
On iOS your code works perfectly, but on Android, you have to achieve it with some hacky implementation like yours, because security issues related to StateWebView loading urls from those directories. Another solution is to copy your app: or app-storage: file into a temporary one and load that temp file url into StageWebView:
var htmlFile:File = File.applicationDirectory.resolvePath(url);
var workingFile:File = File.createTempFile();
htmlFile.copyTo(workingFile, true);
stageWebView.loadURL(workingFile.url);
Edit: Another solution could be to have your html content coded into an .as file and use StageWebView.loadString() method. Having in mind that you have to encode that string for Android devices.
I fix this problem a couple of days a go. The file: URL scheme refers to a file on the client machine. There is no hostname in the file: scheme; you just provide the path of the file. So, the file on your local machine would be file:///~User/2ndFile.html. Notice the three slashes; the hostname part of the URL is empty, so the slash at the beginning of the path immediately follows the double slash at the beginning of the URL. You will also need to expand the user's path; ~ does no expand in a file: URL. So you would need file:///home/User/2ndFile.html (on most Unixes), file:///Users/User/2ndFile.html (on Mac OS X), or file:///C:/Users/User/2ndFile.html (on Windows).
This solution work perfectly in my app.