Python Forum
How to best communicate with android phone from PC running Python script? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Networking (https://python-forum.io/forum-12.html)
+--- Thread: How to best communicate with android phone from PC running Python script? (/thread-12543.html)



How to best communicate with android phone from PC running Python script? - Sol33t303 - Aug-30-2018

I'm currently new to Python (have been learning it for a month or two now, with some previous experience with bash scripting), I want to create a script crawls a website and sends info about the website to my android phone. My PC is running Linux (which I'm pretty good with), I also own a raspberry PI so I could also use that. I want a way to send the information that's free and reliable when my Phone is not connected to my network. I have thought of a couple of ways to do this:

Over SMS: You can get something for the raspberry pi that allows you to use a sim card with it, meaning I could run the script on the raspberry pi and send the information over SMS. However this means I will have to pay for the credit required to send SMSs.

Over the internet: This is free, but this relies on my PC being connected to the internet. My phone won't always be connected to the internet making this way more unreliable.

Script being run locally on phone: This way the web scraper won't have to communicate over a network. However this requires me to learn about using Python on android phones and still doesn't remove the fact that my phone must be connected to the internet.

Is there any other way I could achieve this? Am I just stuck with one of these options or are there any others you can think of? The information is likely only going to be some text or at most a low-res image. The speed of the connection doesn't matter. If I must pay, I would prefer a one time cost vs a subscription. (BTW, I likely won't be able to reply to anybody until either tomorrow or the day after).


RE: How to best communicate with android phone from PC running Python script? - buran - Aug-30-2018

your phone can be connected to the "outside" world by some communication protocol e.g. mobile network, Internet, Bluetooth, NFC, USB/wire. The last 3 suggest short range, which leave you to choose between mobile network (sms) and Internet.
There are plenty of free options that can allow you to communicate with your phone via messengers or other apps/services (e.g. Pushbullet)

Eventually you can have your script running in the cloud (if you don't want or cannot have your PC constantly connected to Internet).

You can have a look at kivy to develop Android apps (i.e. running scripts locally on your phone). There are some other options for this, e.g. python-for-android