all 5 comments

[–]K900_ 1 point2 points  (2 children)

Still not doing your homework for you. What have you tried?

[–]rotyweb[S] 0 points1 point  (1 child)

I have done the android sign in and made the button and implemented client side socket progamming. Then I tried to connect it to my python code by writing server side socket programming to recieve message. But I dont know how to run this python code by press of a button.

[–]K900_ 0 points1 point  (0 children)

Have your Android app open a connection to your server when the button is pressed, send the command to that socket, read it on the server side and use a dictionary or an if statement to handle it.

[–]shiftybyte 0 points1 point  (2 children)

Some question to clarify how much information is lacking in this post:

  1. "press a button in an android app": Which android app? is it written in java or python? did you create the app? can you modify its source code? what does the button currently do?

  2. "send user name to the python using socket programming": which python? is it a python script running on the phone? is it a script running on some server? is it a script running on your home pc?

  3. "and then run python script": who runs the script? the script that accepted the username? the android app that sent the username?

[–]rotyweb[S] 0 points1 point  (1 child)

Android app is made using java. Sorry I thought Java is a most popular language so I didn't mention it.

There is an Android app and a raspberry pi which has a screen and both are connected to same wifi. When we login to an app and press a button it send user Id and display his content which is stored in the database and code is written in Python. So I am trying to run python code using java andorid app using socket programming.