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.
Related
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.
I am looking for a way to read the system logs of a connected device via a web application. Basically, I want the user to be able to connect their iphone, android, tablet etc and be able to see what is occurring on their device at the system/consoleLog level. Similar to adb logcat. This would be a via a web application and not on software installed locally. Is this feasible using react/nodejs? What technologies should I consider using?
There're several components you need for achieving this.
Backend
File Monitoring (Native Node.js fs.watch)
Real-time update (Socket.io)
Frontend
Any framework you're comfortable with, I'm using React.js with socket.io client
What you are trying to do is possible, but in a very limited sense.
Your users will be required to manually upload their log files to your web application.
You can "ask" them to do this by using the FileReader api in javascript. Here is a demo page.
As you can see you must manually select a file to be uploaded and give the website. To programmatically set the path of a log file and try to call it without the user noticing is not possible.
The reason for this is anything you make that is served via a web application will run in the sandbox of the users browser.
For obvious security reasons a browser won't let random websites read/write to local files of a persons phone without explicit permission.
Node.js won't help you here because in order to use the functions Node.js has such as accessing local system files the app would have to be installed locally and not running in a "browsers sandbox".
I hope this helps. If you want more examples of the filereader api let me know and I can write something up for you.
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.
i want to do a academic web-android project that named tour-trips planer. but web service part is not working in it. i want MySQL database to access my android app. how to work it without hosting? and i'm totally a beginner..
you need to your android application and web service in the same network
you can do this using one of these methods
using app to share network connectify
see this How can I access my localhost from my Android device?
and this How can I access my localhost from my Android device?
i hope this helps you
android is able to locate devices and then communicate and update these device. That is the basis behind what i want to achieve. I have created a Content Management System which is a webpage that requires login details. This CMS will contain a record of all my android devices, the users of these devices and all the applications available for these devices. The CMS was constructed using html and it also uses javascript, php and mysql. each android device will have one of my applications installed on it and will be a wifi only enabled device(so that is how it will communicate with the world).
the scenario is, a device stored on my cms will be used by a user in london and they will be able to access the internet via wifi.I want to send a notification to the device using the cms and my location is . I am logged on to my cms in Scotland.
1, What sort of code or software or technique can i implement into my cms(html code, php code, javascript code) and my android devices and or android applications(java code) that will allow me to send a notification from my cms webpage to my application?
2, how can i make sure it is sent to the right device and the right application on that devices? (i.e if i want to contact someone who has a mobile phone i use their phone number, in this case device does not have a sim card and can only connect to wifi.)
please provide me with a clear answer with links on how to achieve this and excuse my ignorance if the answer is straight forward i am new to this.
again just to make it clear i want to send notifications from my cms webpage to a specific application that i have made in android using eclipse and java on a specific android device whos only connection to the internet is via wifi.
thank you
I think Google Cloud Messaging is appropriate for your problem.
Here is the link: http://developer.android.com/google/gcm/index.html