I have created a web application using the Google Web Toolkit that is able to receive some data by a mobile client via Http Post. The transmission of the data works well and also the server / client communication using GWT RPC is no problem at all.
However, I need to debug the webserver when receiving data from the mobile device. As I am using Hibernate and MySQL within the web application I do not use the Google App Engine. So if I deploy the web application in local host mode it is only accessible on the localhost:8888.
Now, if I send data from the mobile phone, I have to send it to the locally assign IP address as the localhost of the mobile phone emulator is not the localhost of the computer, where the web application is running. To ensure that everything works, I tried to do some posts outside the emulator (on the machine the emulator is running on). This works, but how can I post from the emulator to my web application?
How can I get access to debug my system? I've already tried to deploy the final application to a tomcat server and use remote debugging, but that fails too.
Best regards,
Florian
Well if I understand your question correctly, the real problem isn't debugging the app on the servlet, the real problem that you're looking at is debugging from a mobile phone. When the mobile phone hits your local network (I'm guessing you're pointing at 192.168..?) you are accessing the compiled GWT code that does not communicate with the debugger.
Put another way, when you debug locally using a browser, you are actually not running compiled GWT code, but instrumented code that is executed with the GWT Debugging Plugin, that happens to work exactly like compiled GWT code. (mostly). So while your local version has "?gwt.codesvr=127.0.0.1:9997" or the like, your mobile phone version cannot do the same, and cannot thus communicate with the debugger.
The best that I've been able to do is to use logging extensively. If you're using an iOS device and change the settings are your safari, it can output logs for you from mobile safari. Also, if you're using the Android debugger with a WebView app, you can attach a listener for log messages and then ferry them on to the ADB and view those in Eclipse. Definitely not as good as a debugger, but that's the best I've come up with so far, and if anyone has a better solution I would love to know it :)
Hope that helps!
Related
Case:
I use Flutter to create an app, and the app will call Restful Api to backend server to get data.
However, the backend server only open to a selected host and port for security reason.
The app works well if it is under that network, but cannot works properly because of fail to get data if out of that network.
As a result, I would like to setup a proxy for the wi-fi I'm using, and run the app as normal.
Unfortunately, the flutter app still not working in both Android and IOS platform.
Question:
How to use proxy in Wi-fi setting for the app in Flutter app?
You may try using this package to apply the system's global proxy settings: https://pub.dev/packages/native_flutter_proxy
Dart's networking tools don't pick up these settings on their own.
With device manual proxy to my Charles IP address, not seeing any traffic or prompt to allow traffic in Charles Proxy. S10 device appears to load all traffic when navigating to various URLs.
Even charlesproxy.com/ssl loads website but doesn't initiate a certificate to download.
All other android devices tested on same setup works fine. Issue seems specific to Samsung S10
So what seemed to have worked for me just now, with my mac (I assume it would be something similar for Windows) I just opened a regular browser, went to chls.pro/ssl and download the certificate file.
From there I sent it to my S10+ and opened it, which then installed it properly.
If you're trying to hook up to Android devices then beware that Google introduced security measures to not allow proxy monitoring in I believe Android 6 or 7. If the other devices you had worked fine on Android then it's probably because you were using an earlier version of Android, or, you had a debug build that allowed for proxy monitoring. I know there's a SO post somewhere that talks about this "pinning" and I know our company does this as well with debug apk's. If neither of those solutions work then it's probably a matter of getting the Charles certificate installed correctly on that phone but without more information it is hard to diagnose. Hope this helps you
I am struggling to make HTTP native or HttpClient get to work for my app.
If I run ionic serve -c I get HttpClient working good on my browser at localhost:8100 and in Ionic Dev App. If I build for Android though, HttpClient fails thus I decided to give HTTP Native a try.
Then I don't understand how I could get some console log if that native plugin is not supported from Ionic Dev App (here says), neither I can see on my browser cause of Cordova is not present.
Is there a way to log on a device to debug HTTP Native?
You should debug your application connect your phone to your laptop and
Open your Google Chrome Browser
Go to Inspect (Ctrl + Shift +I)
Go To More Tools enter image description here
Open Remote devices and inspect your device
For more information click here
Thanks
You wont see native http calls log to the browser since they are called native from the device and never are called from the browser, but if you are debugging while connected to xcode, the xcode debugging output should give some information about your native HTTP calls success and failure.
Following #vd_virani answer, here is a quick link to inspect a device from Chrome
chrome://inspect/#devices
Plug your device via USB, then copy & paste this link in your Chrome address bar like a website.
Is it possible (e.g. when developing) to send a pwa to the phone someway e..g. via usb cable without the network and serving it in https?
The use case is development, when maybe a wifi network is not available or unpractical to set up.
If your APP is fully PWA compliant, the app added to home will be an installed APK, which you can extract using file explorer(I used ES File explorer) and put it in other devices using USB connection and adb install myapp.apk for installation.
After you load the apk, it would anyways make calls to your web-server which I'm not sure how it make sense to achieve without network connection though. I couldn't think of any reason to develop a mobile application as PWA without network. You can even have a pass though internet(sharing your desktops internet via USB) by connecting via USB if wifi is not available. But developing PWA with absolute no network mode is not practical.
Update: While you can generate the APK and side load it via USB in the above mentioned way, transferring the cached assets(HTML/CSS/JS/images) might be tricky. You may have to wrap your app as a plain cordova application or Ionic kind of PWA app which uses Cordova to wrap and build with your assets. This way, your APK will be having everything it needs to run for calculator kind of use case.
i am building my first phonegap app and when i open the app i instantly redirecting (window.location) the user to my server where my web app is hosted. Is it possible to load the phonegap plugins from there? Because the "deviceready" event is not firing and i cannot call any plugin functions.
I can confirm that loading remotely does appear to allow access to native components (when scripts are properly loaded) and that cordova.jsdoes not appear to need to be loaded by the local index.html bootstrap.
Short answer: Yes
Some 'gotcha's'
You will have to supply correct cordova.js version for the platform browsing to your site.
you can look here for more info https://github.com/apache/cordova-js. This project hosts the core js elements, and builds the platform specific cordova.js lib
Any plugin api's your app wants to interact with must be pre-installed into the Native App
any plugin with native code will have to be added to the project and deployed to device bundled inside the app. There is no way to lazyload native code. The js portions of the plugin could be hosted on your server, however.
More information, some apps that do this
The PhoneGap Developer App uses a similar technique to what is describe above and what you want. The only difference is that it is meant as a dev tool, and the server is a local dev machine.
The Cordova App Harness also uses this technique of pre-bundling an app package with plugins, to be consumed by remotely hosted resources
You cannot, deviceready only functioning if the app run on mobile phone environment only. If web based or dekstop application, it won't trigger.
No , dont do that . loading remote website will not able to intract with your plugins . and the app will get rejected on istore too