I have to code in android for making an application which makes a call to an hadoop cluster node. I have an ip adress for the same i can login via putty on my windows machine.
I dont know how to make a call to that server from my android app?
And, how to run a executable jar file deployed on the hadoop node.
Any guidance or a sample code piece will be a big help.
Thanks in advance
Manu Misra
I suggest you want to login via SSH and execute a command on a server?
The better way would be to write a small 'server app', that provides an interface via http to start the processing. (You might have a look at Sinatra)
If you prefer ssh, you should have a look at ssh java libraries.
Related
I need to connect my android app written in Kotlin with Rpi, and be able to open an ssh connection to it, give some commands, open some files, download/upload files and acces the camera on the Rpi through the App. I already set up the Rpi side, so I have all the required information to initiate an ssh connection (IP Address, username, password, port). Could anyone help me out where to start and/or how to do it, or point me to the right direction ( library, dependency, etc..) ? I only found SSH libraries for JAVA ( like JSch, Chilkat ) and I wouldn't want to mix up the languages.
I tried to search for an SSH solution for android Kotlin, so I could start somewhere, but haven't found it so far.
Any help yould be appreciated
Thanks in advance
every time i try to print json file from my wamp server it doesn't work
i use this URL "http://127.0.0.1/webapp/users.php" to acsess the json data
but when i put another link like "http://api.androidhive.info/contacts/"
it works perfectly , so i don't know what is the problem exactly
i'm just starting to learn about json parsing in android .
any help?
my php code is
$row['id'],
'username'=>$row['username'],
'password'=>$row['password'],
));
}
print json_encode(array('result'=>$result));
mysqli_close($conn);
?>
Of course i wont work, this address is local address for your own work station(computer or any device with a ip address eg, your own phone as that address) that is why it is local ip address. Only your system can read and write to it. To over come this dilemma , either one host your on a server, or go the cheap way and broadcast your ip address to the internet using a tunneling software such as ngrok.
Here are some advantages:
Don’t constantly redeploy your in-progress work to get feedback from clients. ngrok creates a secure public URL (https://yourapp.ngrok.io) to a local webserver on your machine. Iterate quickly with immediate feedback without interrupting flow.
Test mobile apps against a development backend running on your machine. Point ngrok at your local dev server and then configure your app to use the ngrok URL. It won't change, even when you change networks.
Building webhook integrations can be a pain: it requires a public address and a lot of set up to trigger hooks. Save yourself time and frustration with ngrok. Inspect the HTTP traffic flowing over your tunnel. Then, replay webhook requests with one click to iterate quickly while staying in context.
Host personal cloud services on your own private network. Run webmail, file syncing, and more securely on your hardware with full end-to-end encryption.
ngrok is easy to install. Download a single binary with zero run-time dependencies for any major platform. Unzip it and then run it from the command line.
After reading and deliberation on some links i received at the courtesy # cricket_007, there is another way to access your local ip address across the network from wamp server.
try this, it works its just a bit longer to setup vs ngrok thats very easy, try the option thats work for you.
Happy Coding :)
I am not sure this is the right place to ask, but I will give it a shot. First of all, please note I'm not an android developer, but a php programmer. That being said, I want to create a simple application with following functionality: connect to a server via ssh then send a list of instructions(of course, I need the response too).
I found appery.io, that helped me so far to create the interface, but I am not sure how to initiate a SSH connection. Any ideas?
Thank you!
Appery.io is a development environment. The app that you build simply runs in the browser, or the device (hybrid). Having said that, you can connect to any service/resource that's exposed via REST API when building an app in Appery.io
I am trying to write a http proxy server that would run on the device itself. In fact, need to find a way to capture the outbound http traffic generated by the device.
The code I have so far is compiling OK, it is based on the code found here: http://www.jtmelton.com/2007/11/27/a-simple-multi-threaded-java-http-proxy-server/
The problem is that the http request to the actual server would block and never return .
Is there a better way to write such a service without rooting the device?
You should check SandroProxy.
Can caputre traffic on non rooted device if os proxy settings are used, or with iptables rules on rooted one.
Traffic is stored it in local sqlite database. Captured data can be also examined by chrome devtools. To capture traffic in your app you should check source code for plugins. It has all the code for iptables redirections and proper settings.
Check out the wiki link on google source code HowToInterceptTrafficOnMyOwn
http://code.google.com/p/sandrop/wiki/HowToInterceptTrafficOnMyOwn
btw: send by sandroproxy support :)
I've been using a piece of software called proxydroid to use my device as a proxy server, and its the only one I've found which doesn't require root. I'm not sure if it will be any help to you, but its an open source project and the code can be found here:
https://github.com/madeye/proxydroid
I have noticed that the application will freeze after a while, or if a large number of request are sent at once, but I've not had chance to find out why this is happening.
Forget about setting proxy, use Facebook Stetho library (http://facebook.github.io/stetho/) to review all http requests and responses from emulator/device
Hello every one I am new with servers things. I want to develop program that get data from the database on the server and it's my first time I don't have any idea of this thing.
Let say like Login & Logout:
how can i make a virtual server for testing on my PC
how can i connect the emulator with this virtual server
how can i request the data from thee database
Do I need software like Xamp or Wamp? If yes how can I use it?
I found so many examples about the json and webserver but I don't know how to make virtual server and connect the emulator to it.
as I understand this problem you need two separate pieces of software. You will need 1) server. To begin with you can install XAMP and WAMP to get Apache running. There are millions of tutorials on how to set up an Apache web server online, and to begin with you could just return a string or a simple data structure (e.g. JSON or XML). As you want to do more complex things you can learn more, but in the beginning think "easy does it". From your text I anticipate that you just want to test as a proof of concept.
- What OS do you run BTW?
Another solution is to rent some space on a server accessible from the Internet. Then you could test your server-side regardless of where you are located.
Second you would need to create a program for the android. There are several guides, but have a look here: http://developer.android.com/training/basics/network-ops/index.html. If you choose to make your data available through the HTTP protocol there are very boilerplate-like procedures for how to download and parse the data.
If you are hosting the server-side on your local computer you would need to use local addressing, but if you choose to put it online you could acquire the data from everywhere as long as you have an internet connection.
Good luck!