Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7833445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:42:55+00:00 2026-06-02T12:42:55+00:00

Here is the idea: The user types in a command which it has to

  • 0

Here is the idea:

enter image description here

The user types in a command which it has to be send to an android device.

Then the android device runs the command and returns the result to the php page which displays the result in the page!

I have tried with sockets but with no luck(i wanted to keep a connection alive until the closure of the page).

I know how to run commands in my android device:

Runtime.getRuntime().exec( command,args);

And I also know how to send data to the php server:

HttpPost httppost = new HttpPost("http://192.168.10.21/epl371/index.php?"); 

etc...

The problem is that I want to send data to the android device first via the text box after pressing the submit button.

Is there a way to do this? Is HttpPost a wrong way to do this?

I have tried so many things like:

URL url = new URL(SERVER_URL);
URLConnection connection = url.openConnection();

etc..
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T12:42:56+00:00Added an answer on June 2, 2026 at 12:42 pm

    Thanks for the clarification!

    Since the server most probably has the more permanent IP address, it might be a good idea to write your android application the following way:

    1. When it starts, it sends (via HttpRequest(), maybe) it’s current IP address. This way server knows where to send commands.

    2. While running, application listens on particular IP port for the commands and sends back the replies, you may find details here.

    3. When stopped, application sends to the server the ‘stopped’ status, so your server knows your phone is gone.

    Your server part, besides your form, might require additional handlers for android start/stop requests (see above) and some logic about where to save IP address between page reloads.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's an idea. I'm trying to create file from PHP script. File may be
I am attempting to determine prior art for the following idea: 1) user types
I'm designing an application that has two [three including administrators] user types: Buyers and
I have a class called myClass in /myDir/myClass.php. When user types url: http://mysite.com/myDir/myClass.php, I
The idea here is to get better programmers right out of college. I think
My Question is similar to the idea here: Replacing a component class in delphi
I'm just looking a big picture idea here; I can google specifics once provided
This is a weird one, but hopefully someone can give me an idea here.
Here is the idea I would like to develop. I need to have an
Help, here is the idea: External.dll IMyClass NewCreated = (IMyClass)Activator.CreateInstance(Namespace.MyClass).UnWrap(); ----------------------------------------- Asp.Net WebSite App_Code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.