Get wifi Details via the browser - android

I am trying to implement a WiFi related application that will be used on mobile phones.
I can do these easily on android using the WiFiManager class where I can get the list of the WiFi Networks available around the phone, or even with the WifiInfo class.
However, I want to make this app more general rather and run in from a browser rather natively via android.
My question is, can I do such things using a client side scripting language that can run inside a browser that can be used literally on any phone that has a browser?

You will not find a way of directly accessing available networks inside a browser. This is because of security reasons. The JavaScript sandbox makes sure no such information is exposed to possible malicious websites.
You could rather make some ajax request to a native app and pull needed data from there.

Related

Not able to access local network websites using Android’s browsers

I’m running an Ubuntu web server on my local network, hosting websites that can be accessed anywhere on the network using https, such as https://ubuntu-server/website01/index.php
However, I cannot access such websites on the browsers of my Android phone that is connected via Wi-Fi.  I have tried using the IP address instead of the domain name, ect.  The phone is able to connect to external websites.  Surprisingly I have not found information about this that has worked.  Also the local sites are able to be accessed by default on iOS but not Android.
Is it some sort of a firewall issue in the Android phone?  If so, where I do set that using the default software?
I see a lot of options for adding third party firewall software to Android, would I need to go that route instead?  I would like to know how to do it by default anyway if possible, however.
Thanks for your help.

Is it possible to modify the data received by a mobile device, using an app on the Mac or PC?

I used Charles Proxy before, which can modify the data received by a browser, so it is really convenient that we can test our bug fixes without modifying the production server, either for the webpage content or for the AJAX data.
Is it possible to do something similar for a mobile phone app, either for iPhone and Android phones? I can let the Mac (or probably a PC too) act as a Wifi station (access point) and let the mobile phone connect to it, and is there an app that can act like Charles Proxy (perhaps Fiddler?) that can examine and modify data?
#nopole If you are using Charles, I suppose you can use Breakpoint feature to intercept and edit HTTP requests/responses coming from/to your mobile devices. It works for both browsers and mobile devices. Or else you can try using Proxyman. It's a native macOS app and quite similar to Charles/ Fiddler. You can read an example of how to use the Breakpoint to manipulate data here. Hope it helps! :)

Allow to open website on webview only

I want to ask about the security of web application.
I'm developing on web site for an inventory management system by web service.
And wrapping as android application with the webview.
But my client ask the website can be opened in android application only.
I think it is possible with agent header when web server response to request.
But it just a makeshift.
So is there any way to check the website is opened in browser not authorized application?
I used spring boot for web server.
This is not possible. Once you expose an endpoint publicly, you can always try to connect to it with whatever software supporting the protocol (or an analyzer which will reverse-engineer the protocol).
This said, you can make it difficult by obfuscation.
One solution is to use information provided by the client (browser in your case). This is usually the agent header (as you mention) but can also be some fingerprinting. You could for instance detect the size of the screen and make some decisions from there on.
Another solution is to use some secrets (better call them "secrets") to show the backend application (or API) that some specific code is calling. I can imagine that you could bundle the HTML/JS/CSS code in your application, together with a key so only the application owners will be able to send a recognizable traffic (recognized by the backednd).
All of this is more or less difficult to crack but with some layers you will get rid of at least some population which would like to access the site via other means than an app.

Access Java Web application running on a server by Android device thru wifi

I have searched for a solution to this but could not find one. If this is already answered, sorry, please direct me to that.
My problem is this. I have java web application running on a local intranet (Tomcat 7, Java 6, MySQL). All desktops within the intranet are connected thru LAN and access the application using the specific server IP, something like 198.162.2.10.
Now, I want to access this thru my android mobile phone as well. The entire building is Wifi enabled and I'm able to access this web application, if I know the IP and enter it in the mobile browser. But, I would like to make this mobile access automatic and wrap it in an app which on click access this automatically, even when the IP changes. We have dynamic IPs.
You can use WebView component to display a web page within your application.
As alternative you can use HttpURLConnection co perform Http request and posts to your web application.
Regarding the dynamic IP you can configure a Local dns server or assign a static IP to the server.
Anyway the application need a fixed address to connect to the web application, unless you want to insert the address manually each time.

Manage Android Device through web browser from a laptop using WiFI

Requirement: I want to control my android phone through my laptop using WI-Fi. For this I need to run a web server and a "customized" web app that runs on the android phone over a particular port and the wifi adapter's ip address. For example , I can connect to the web application running on my phone through the browser in my laptop using : http://(ip address of the phone):port
Things I have tried: I evaluated a few webservers for android that lets me run java based servlets like (ijetty). There are others like TWJS , KWS , PAW etc. So far, I am able to run them on the phone and access the web server through my laptop.
My Question: Of all the resources and materials pertaining to developing apps for Android , I'm having a real hard time finding any useful and clear information on what web technology should I create a web application that can use the android APIs and effectively communicate with the phone just as any native Android application.
i-Jetty claims to support Web Applications that can use the android apis , but lacks any sincere documentation on how to build to such web application/servlets that uses Android APIs.
While,my requirement is similar to what to an existing application for Android does namely AirDroid, it is not open source and neither it discusses anything related to its implementation architecture. So, I am open to any suggestions that can help me create a web application for the managing the android phone wirelessly.
Giving a look at the i-jetty example application you can see that it's possible to retrieve the Context and ContentResolver objects:
android.content.ContentResolver resolver = (android.content.ContentResolver)config.getServletContext().getAttribute("org.mortbay.ijetty.contentResolver");;
android.content.Context androidContext = (android.content.Context)config.getServletContext().getAttribute("org.mortbay.ijetty.context");
through which you can access system services, read and write preferences, execute queries to retrieve contacts etc. as if it was a normal android application.

Categories

Resources