from flask import Flask, jsonify, render_template_string import subprocess import json app = Flask(__name__) @app.route('/') def index(): return render_template_string('''
SMS Campaign Manager โข Android Interface
{json.dumps(battery_data, indent=2)}
"""
except Exception as e:
return f"{str(e)}"
@app.route('/notification')
def notification():
try:
subprocess.run(['termux-notification', '--title', 'Flask Test', '--content', 'Hello from SMS Campaign Manager!'], capture_output=True, text=True)
return f"""
Check your Android notifications.
""" except Exception as e: return f"{str(e)}"
if __name__ == '__main__':
print("๐ Starting SMS Campaign Manager on Termux...")
print("๐ฑ Device IP: 10.0.0.193")
print("๐ Access from Ubuntu: http://10.0.0.193:5000")
app.run(host='0.0.0.0', port=5000, debug=True)