Google App Engine, gradle, open port - android

I'm developing an android app with Google app engine endpoint using Android Studio.
Is it possible to make the local app engine server open the port it is running on? I'm trying to debug an android application with a phone that is in the same LAN as my app engine server but I can't do that because the ports doesn't open.
Meaning, while I'm able to reach the server program at localhost:8080 from the server computer, I'm not able to reach it from my phone at {server_ip}:8080.
Now I'm sure I am not having problems with port-forwarding in my router, since
when I take the generated war-file and deploy it to a tomcat server, I'm able to reach the server from my phone. But then I will not be able to do a step-by-step debugging in Android Studio.

Thanks NNJ,
After reading that post (https://stackoverflow.com/a/21776775), I understood that I should include httpAddress = '0.0.0.0' in my build.gradle for the server module and now I'm able to reach the endpoints from outside the server.

Related

Debugging HTTPS local services from my mobile device (web, api, websocket)

Having a hard time debugging from mobile device my local development web app which connects to a GraphQL node server and another service using web sockets. All three services running on HTTPS to the below ports.
Web Reactjs app: https://localhost:3335
Node server: https://localhost:3334
Web socket server: wss://localhost:4443
From my macOS machine, everything works as expected but when trying to access the reactjs from Chrome Android and using the inspect desktop devtools and USB cable navigating to https://localhost:3335 works but I get the error POST https://localhost:3334/dev/graphql net::ERR_CERT_DATE_INVALID.
My iOS device doesn't even connect to localhost:3335 or 192.168.2.3:3335.
I am open to any tips, tricks, services, and ideas to debug using my local development machine and mobile devices.
I was able to make it work by navigating to all addresses in the mobile browser and accept the risk of a self-signed certificate.
https://localhost:3334/dev/grapqhl -> accept
https://localhost:4443 -> accept
Now https://localhost:3335 will work fine.
Struggling with iPhone debugging due to localhost not binding to the machine IP address (Pending solution, might create another SO question for reference).

Implement OpenVPN in Android

I recently bought a VPS to create a VPN app but it looks like there is no tutorial anywhere about it.
I saw the ics-OpenVPN project on Github, but I have no idea how to use it!
All I want is to connect to a Linux server from my phone
First of all, install OpenVPN on your VPS server. Although I do not have experience to install OpenVPN on VPS server but I think you can follow this tutorial it looks easy https://www.skysilk.com/blog/2018/install-openvpn-linux-vps/
After complete your installation you will get the .ovpn configuration file. Now to connect with your VPN server from your android app you need an android client software like the ics-OpenVPN android client.
I have also developed an android VPN app based on OpenVPN library you can use my source code it is open source. The instruction of changing .ovpn file is given on the GitHub repository.
Github: https://github.com/ashraf789/Cake-VPN
Do it has to be VPN? Or does an sshconnection with porttunnel satisfy your needs? That is for example how i connect to services on remote servers. With the tunneled port you are able to map the port on the remote server to your local system and access via localhost:.

How to connect to local host of another machine with android emulator

I am developing an app for android (with react-native) which is running in android studio emulator. This app should connect to a server, but I am in the testing phase and I run the server in a localhost port. but the localhost of another machine (which is in the same network that I am)
let's say the (local) IP of the other machine is 172.17.240.223 and the port which the server is running on is 8080
when I type 172.17.240.223:8080 in my browser (laptop browser), I get the response and there is no problem. Even when I type this in my browser in the emulator I get the response, but this won't happen in app. why is that?
More generally, it's not possible to customize the URL and how the bundle gets loaded. This flexibility is useful to have.
check issue on github here
in this case ,you can use testflight for IOS testing and for android just create apk.

How to access computer's local host on Android phone?

I'm currently using Android Studio to prototype an Android application. I'm trying to use the Google App Engine Servlet Module to write a prototype backend for my app. I can run the dev server and access the page via localhost:8080. However, I cannot access this address on my physical android phone over the same wifi connection.
I understand that I cannot use the term localhost within the Android's web browser because that does not refer to the computer's instance of localhost. I tried looking up my computer's ipv4 address and using the "ipaddress:8080" to access the page on the phone, but that does not seem to work either for the Servlet Module within Android Studio.
I have an older server application running on Apache Tomcat within Eclipse. When I run that, I am able to utilize the "ipaddress:8080" method to access the page on my android device.
Any ideas as to why this works while the Android Studio Google App Engine Servlet Module dev server fails? Any suggestions as how to resolve this issue would be greatly appreciated!
You can access the localhost in the following way : 10.0.2.2:8080
I realized that the server did not bind to my IP address. I changed configuration settings within Android Studio for my server to use http address "0.0.0.0". It now works.
In my case, I was receiving null for list request after deploying backend (running on Android device). For some reason backend received requests and didn't respond. The fix for me was to re-deploy and create new project, syncing with my android project front-end code. Then as a result my front end was connected to the back-end exactly as described here: https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/HelloEndpoints step 2.3, and two additional fields were generated in my JSON: "kind" and "etag"

Running an android app on phone

I have a Cordova project in spring-rest for server side and client side i am using commandline tool for client side building.On client side AVD runs and is able to access my server side code. I want to test the same app on my android phone.
I have enabled USB Debugging on my phone and i am on same network as my computer..i am able to see the app installed but its not accessing the server side code on my eclipse and fetching the results.
please help me out.
Thanks.

Categories

Resources