I am developing an ionic app using mongodb as database. The problem is when I test my app in a browser I can see the data, but when I run it on a physical device the data doesn't display. I tried to inspect it so I found this error message:
Here is the mongod.cfg file:
Can you help me?
From a mobile device you cant access localhost because it refers the current machine.
You can use ngrok for exposing your local web server. After that you just need to replace the http://localhost:3001/ with the ngrok url for testing on you mobile device.
Related
I'm thinking to pass to a web app IDE like cloud9 to host my apps currently in development.
The problem with this is that i don't know how to test my code in the way I normally do with a simulator, locally.
I'm trying to develop on a remote server, and building on that remote server, an i want to test the app with my real device, with live reloading absolutely. If it's not possible to use my real device i could use an emulator and it's ok, but I'd prefer to use my phone.
I see you are using metro-bundler, you can achieve this by using the Tunnel option in connection:
This will create a global link to communicate with any of your devices. Then you can easily use the QR code or just the generated link in your own mobile device using expo app.
Now you can debug and test with your actual physical phone or emulator without publish it.
I am developing a web app, that needs to run on android mobile device's browser and, communicate with a mobile app which is installed on that device.
The web app need to communicate through ajax calls to localhost (to the android mobile device) to retrieve data from the mobile app.
So far I tried fetching from: http://localhost, http://127.0.0.1, http://10.0.2.2 and none of them worked.
I succeeded only by getting the device IP using webRTC and fetching from this IP.
Is there another way to do this?
If I understand correctly you are trying to inspect development on your android device, you need to use Google Chrome, just open localhost on your mobile device and connect via usb to your computer, then use the remote device tool.
Follow the tool link: https://developers.google.com/web/tools/chrome-devtools/remote-debugging
If you're on the same network you can use your internal IP address. If you're using windows you can use ipconfig and if you're a MAC user you can use ifconfig.
After you found your internal IP address append the port number that your server is running on internalipaddress:port and start making requests there.
I have build my first web application following the code labs example "Your First Progressive Web App"
https://developers.google.com/web/fundamentals/codelabs/your-first-pwapp/
Everything works well, but when I try to access the web server from my mobile device through the local network, I can not see the web app open in my android device.
I have checked the web server IP(192.168.0.161:8887) and my android device IP(192.168.0.231) are in the same local network; also I have selected "accessible on local network" in chrome web server.
Could you please tell what are the possible reasons cause this issue?
Thanks
This is a firewall issue. When I turn off the firewall, I can access the web server from my android phone.
Thanks!
I have written the mobile app in cordova + angularjs + sqlite. I need to distribute it directly from my server to devices not through the google play.
Now I need to update javascript files stored in www directory on android device. I tried file transfer from app directory (/data/data/my.application.directory/) to some public device directory or server and vice versa - no problem. But problem is the www directory is part of file:///android_asset/ that is read only so I am not able to store any data in there.
Any idea? Thanks.
This is the way I'm using for updating my app and I'm not using Google Play or other stores:
I'm using this cordova plugin : https://github.com/whiteoctober/cordova-plugin-app-version to check my actual app version
cordova.getAppVersion.getVersionNumber().then(function (version)
{
if(version)
// Check the server reference version
});
After, I'm sending the app version number to the server
The server checks the difference between the version sent and the reference version
If the device app version is older, I'm returning the new version to my app client
You provide little information about your application, your code and what you are trying to do, but let me try to help you either way.
If what you want to do is modifying files in the www directory in android clients already shipped/downloaded, forget about it, you would need direct access to the device, and this code is bundled when you ship it.
If you are looking for a hot code push solution, there might be a way of doing so installing additional cordova plugins
When you publish your application on the store - you pack in it all your web content: html files, JavaScript code, images and so on. There are two ways how you can update it:
Publish new version of the app on the store. But it takes time,
especially with the App Store.
Sacrifice the offline feature and load all the pages online. But as
soon as Internet connection goes down - application won't work.
Solution: install cordova-hot-code-push
I am using PhantomJS and Selenium WebDriver to download the page source from a website with the following code:
var driverService = PhantomJSDriverService.CreateDefaultService();
//error occurs here
var driver = new PhantomJSDriver(driverService);
driver.Navigate().GoToUrl(url);
htmlCode = driver.PageSource;
driver.Quit();
Everything works fine in my local environment but gives the following error in an Azure Web Job or Azure Website:
Unable to connect to the remote server --->
System.Net.Sockets.SocketException: An attempt was made to access a
socket in a way forbidden by its access permissions 127.0.0.1:50388
I get an equal error message when running Selenium with Firefox as an Azure Web Job or Azure Website. I already activated "Web Sockets" in Azure Web App configuration dashboard. But the error still occurs.
My goal is to get the rendered (javascript and ajax) page source of a website inside a Azure Web Job.
I was getting a similar error on my task and it was because I was hitting the cpu limit for the azure plan for my instance. I upgraded from 'free' to 'shared' and it still did not work. It worked after upgrading to 'basic'. Maybe that will help...
This was the link that helped me: https://social.msdn.microsoft.com/Forums/vstudio/en-US/1eb5e0fb-79b9-4f55-8345-7f50053c13c1/webjobs-no-consistnet-behavior?forum=windowsazurewebsitespreview