Chrome://inspect without internet connection - android

I have been developing a website for a project targeting mobile phones and tablets, currently focusing on using the chrome browser. Much of this development has been done on one phone using a laptop. I had been using the "chrome://inspect/#devices" quite painlessly until I came to test on a different phone, when clicking "inspect" resulted in a white page. The problem seemed to be that as I happened to have no network connection at the time, chrome couldn't access some repository and so didnt load the page. After chrome visited this page, I no longer needed an internet connection to inspect my phone.
My problem is that now I have to migrate my project onto a computer which sits behind a firewall (which I have no access to) which is stopping navigation to the "chrome-devtools-appspot" link to pull whatever it needs to generate the page when I click on "inspect".
Is there a way to somehow download this repository and make it available locally on the machine so that regardless of what phone / browser version I use, the inspect page does not depend on an internet connection?

Its all about the Cache. When you chrome://inspect and click on "Inspect" the window requests the inspector tools from some google URL (looks something like this: chrome-devtools://devtools/bundled/inspector.html?isSharedWorker=true&remoteBase=https://chrome-devtools-frontend.appspot.com/serve_file/#f87f641eOabefed98578934of1d5ca79651bf82/&dockSide=undocked).
The solution is to do that first fetch on environment with internet connection, then copy the cache files of google chrome and paste them on the standalone environment.
These cache file are located on AppData/Local/Google/Chrome/User Data/Default/Cache.
I did the following and it worked:
On the machine with the internet connection:
Clean Chrome Cache (with 3rd app like CCleaner or just manually delete all files on Cache folder)
Open Emulator and open dummy app or chrome tab
Open Chrome then redirect to chrome://inspect then inspect the device.
Wait for it to load (to downalod the needed files) see new files on Cache folder.
Close Chrome.
At that point you can ZIP the Cache folder.
On the not- connected machine go to the Chrome Cache folder (listed above for windows users) & extract the Zip file there.
That's it you can now use the inspect without it fetching the files.
Again it did work for me, I am not sure if it has anythign to do with the SDK running on the emulator (IE Android 6/7 etc, maybe you need diffrent cache for each).
Hope it helps.
EDIT: It does have to do with Chrome, for each version of the browser the cache files needed are different. After some research the numbers after the # tag is just a commit number from google-chrome-repository. So, to clarify, The chrome tab you open on the device (mentioned above) must be same as the target you are trying to imitate. Meaning that is doesn't meter which android version you are using but which chrome APK you are using. You can just download Chrome APK to the version you need. The version you need is what is written on chrome://inspet.

Related

Android: allow browser to read file:///sdcard

On Android versions higher than v4.4 (since storage framework was introduced) opening the local memory filesystem in a web browser via file:///sdcard does not show all the files and folders.
For example, I can access the file:///sdcard/Download folder by typing the URL but some files and folders are not shown or some folders cannot be navigated to.
Tried with different browsers, including Firefox, Chrome, Chromium, Brave and Opera, and even though I've given all the apps the Files and media permission this is observable for all of them. Files downloaded by a specific browser would be visible from that browser, but not other files that have been placed there by other apps.
The question is how to grant full file access to /sdcard or a specific subfolder from outside the app since not all browsers mentioned above can trigger the on-demand storage permission dialog. Opera is the only which allows doing it from within the app when saving a file to a custom path — then it triggers the on-demand permission dialog and after that the chosen folder becomes fully readable through the file:// protocol.
The preferred solution would be via adb with pm or something similar.
While something like appops might allegedly be used to achieve the desired goal as per this article (didn't work for me), an easier workaround is to use the App Manager (f-droid) and enable in the App Ops tab the following permissions for your browser app:
MANAGE_EXTERNAL_STORAGE
LEGACY_STORAGE
NO_ISOLATED_STORAGE
After applying these actions for Brave, Chrome, and Chromium started displaying all files.
NOTE: Only tried on a rooted device. Since I have no unrooted devices at hand I cannot tell if this would also work on stock Android.

Listing peer (desktop) directory structure on android device on same wifi Network

I am working on concept of sharing file between peer to peer. I have one desktop and Android connected to same wifi network. Using many application we can show file structure of android on desktop (i.e Airdriod without running scripting on desktop). But my issue is just to create opposite. I want to show file structure of Desktop at android side so that user can copy element directly to one's Android phone.
Finally i met with SMB file sharing system and able to browse directory of Peer computer through my android application. This also help in creating peer to peer communication. Thanks goes to tutorial sambha file sharing

Accessing files from genymotion sd card

I have been using genymoton for quite some time now.
Could someone pls. tell me if there is a way by which I can access the files present in the sd card of genymotion emulator?
Currently I have to upload them to google driver and then download on windows.
You can use shared folder for that. It is well explain on this Google+ post.
Here is the brief:
Go to your VirtualBox VM setting / Shared folder tab
Add a shared folder with the folder you want to shared, and check the "auto mount" option
Start your VM as usual from the Genymotion software
Your shared folder is available in the /mnt/shared directory (multiple shared folders are supported)
This is also possible using the Android Device Monitor.
You already have this if you have the Android SDK installed.
This method works for all connected devices, including emulators like genymotion.
In Android Studio, click the icon that says Android Device Monitor in the toolbar.
(This is also available from Eclipse or you can just type monitor in the command line after moving to the tools folder of your installed sdk)
In the Android Device Monitor, go to the File Explorer tab.
Make sure you have a device selected on the left side.
Find the desired file and select it.
For the sdCard you might need to open the storage folder and open the sdcard there.
Click the button on top that says "Pull a file from the device".
Make sure you select Pull, not Push. Unless if you want to put new files on your device ofcourse.
Save the file to your computer...
and voila! The file from your genymotion is now among your other files on your computer. Ready to be used however you like.
Or alternatively you can also use a third party app like airdroid or any advanced file explorer to exchange files between your device and your computer.
(For installing third party apps you either need to find the apk or flash gapps on your genymotion first and go to the play store.)
Another way that I adopted, just install EsFileEx on genymotion.
Grab your files that you want to copy from e.g
/sdcard/WhatsApp/media/dp.jpeg
Swipe to LAN, here you can see your local machine as 10.0.3.2 or any IP. Here you can access your shared folder/drive of local machine/PC, past copied file here and you done!
NOTE! R/W permission should be set on shared folder/drive of local machine/PC
You can use the eclipse with the ADT plugin and browse the file system like any other android virtual emulators. I have been using this for a while, but eclipse crashes at some times.

Porting Phonegap Android asset into Phonegap Windows

I have developed android app using phonegap. Now I want to develop same app for windows phone.
I have downloaded windows sdk in my windows 7 and did the require setup to create cordova app. After that I created sample app. To run my android asset code , just copying its files into www folder is enough...?
Or
What more I need to do for getting this to be worked ...?
Guide me on this to proceed further.
Best thing to do is to try it and see what happens!
But yes, you just need to copy the contents of the www folder of the Android app to the www folder of a new Windows Phone PhoneGap project.
You might find you might have to make minor modifications to things like CSS because of the differences in how the mobile browsers render the web pages (since the Android app will run on a webkit browser frame whilst the Windows app will run on an Internet Explorer browser frame).
You might need to set the 'Build Action' property for any image resources you copy across to the Windows Phone using Visual Studio to get the images to render.
Yes copy the files but be careful not to overwrite existing files. The Cordova.js file is platform specific, as are other .js files that are created in the new project.
You also need to 'include in project' in Visual Studio otherwise the files copied to www are ignored. Do this in the solution browser on the right pane in VS.
Remember the browser is IE as compared with WebKit in Android so some CSS, HTML and Javascript may need to be changed. If you have used a propagation stop to prevent scrolling in WebKit, this may not work in IE and the touch event model is completely different. This MS guide might help:
http://blogs.windows.com/windows_phone/b/wpdev/archive/2012/11/15/adapting-your-webkit-optimized-site-for-internet-explorer-10.aspx

Android - Download and Install apk file in Webview

I am trying to make a simple webview for my mobile website.
There are app link .apk on that website and I need to detect when user click on those link. After clicking file will be downloaded to SD card, then form user to install if want to..
I have read many solutions but did not get working solution yet.
Now all good at step to detect the .apk file, but it seem open default browser for those download link in second then go off, and I don't know how to auto-form install after downloaded.
My Code that I used.
Typically the embedded webview wont have all the features that the normal browser has. Therefore, once you catch the click on the apk then you have to do one of the following
Download the file via the Android DownloadManager (example here http://www.vogella.com/blog/2011/06/14/android-downloadmanager-example/)
Download the file yourself via HttpUrlConnection
Once the download has completed, you can try and kick off the install via an Intent (most likely Intent.ACTION_VIEW) or install directly via PackageManager.
See here install / uninstall APKs programmatically (PackageManager vs Intents)

Categories

Resources