This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android | |
import time | |
droid = android.Android() | |
droid.toggleBluetoothState(True) | |
droid.dialogCreateAlert('Be a server?') | |
droid.dialogSetPositiveButtonText('Yes') | |
droid.dialogSetNegativeButtonText('No') | |
droid.dialogShow() | |
result = droid.dialogGetResponse() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from android import Android | |
import time,sys | |
# Prepare the python for android API | |
droid = Android() | |
# Instruct Py4A which HTML file to use for the webview (we’ll explore this later) | |
droid.webViewShow('file:///sdcard/sl4a/scripts/daveTest/index.html') | |
# SL4A uses the concept of events, like javascript does. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
<link rel="stylesheet" href="file:///sdcard/sl4a/scripts/daveTest/css/bootstrap.min.css" /> | |
<script src="file:///sdcard/sl4a/scripts/daveTest/js/bootstrap.min.js"></script> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidhelper | |
from kivy.app import App | |
from kivy.uix.button import Button | |
class TestApp(App): | |
def buttonPress(self,instance): | |
droid = androidhelper.Android() | |
line = droid.dialogGetInput() | |
s = 'Hello %s' % line.result | |
droid.makeToast(s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bluetooth import * | |
import sys | |
from subprocess import call | |
if sys.version < '3': | |
input = raw_input | |
addr = None | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
# Meant for use with the Raspberry Pi and an Adafruit monochrome OLED display! | |
# This was coded by David Vassallo, modified from code by The Raspberry Pi Guy | |
# Imports all of the necessary modules | |
import gaugette.ssd1306 | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import render_template | |
from flask import redirect, url_for | |
import dhtreader | |
import cPickle as pickle | |
from subprocess import call | |
app = Flask(__name__) | |
@app.route('/toggle') | |
def toggle(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import call | |
import time, datetime | |
import smtplib, ftplib | |
import RPi.GPIO as io | |
import multiprocessing | |
io.setmode(io.BCM) | |
pir_pin = 24 | |
GMAIL_USERNAME = "YOUR_EMAIL_ADDRESS_HERE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir /tmp/mjpg | |
raspistill -tl 500 -t 0 -vf -w 640 -h 480 -o /tmp/mjpg/test.jpg -n -q 50 & > /dev/null 2>&1 | |
LD_LIBRARY_PATH=/usr/local/lib mjpg_streamer -i "input_file.so -f /tmp/mjpg -n test.jpg" -o "output_http.so -w /usr/local/www" -b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uploadButton.setOnClickListener(new Button.OnClickListener() { | |
public void onClick(View v) | |
{ | |
final ProgressDialog progressDialog = new ProgressDialog(getActivity()); | |
//perform upload action | |
Thread thread = new Thread() | |
{ | |
@Override | |
public void run() { | |
getActivity().runOnUiThread(new Runnable() { |
OlderNewer