Manage Android Device through web browser from a laptop using WiFI
Asked Answered
U

1

8

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.

Unquestioned answered 11/8, 2012 at 13:46 Comment(0)
F
1

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.

Fisherman answered 14/8, 2012 at 7:47 Comment(1)
Perfect after a long time of testing servlets with various API levels and painful configuration settings.Unquestioned

© 2022 - 2024 — McMap. All rights reserved.