Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Apress committed Oct 16, 2016
0 parents commit c6b8bdc
Show file tree
Hide file tree
Showing 55 changed files with 2,441 additions and 0 deletions.
Binary file added 9781430235699.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,27 @@
Freeware License, some rights reserved

Copyright (c) 2011 Paul Ferrill

Permission is hereby granted, free of charge, to anyone obtaining a copy
of this software and associated documentation files (the "Software"),
to work with the Software within the limits of freeware distribution and fair use.
This includes the rights to use, copy, and modify the Software for personal use.
Users are also allowed and encouraged to submit corrections and modifications
to the Software for the benefit of other users.

It is not allowed to reuse, modify, or redistribute the Software for
commercial use in any way, or for a user�s educational materials such as books
or blog articles without prior permission from the copyright holder.

The above copyright notice and this permission notice need to be included
in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Binary file added Pro Android Python with SL4A/Appendix A.pdf
Binary file not shown.
20 changes: 20 additions & 0 deletions Pro Android Python with SL4A/Contacts.html
@@ -0,0 +1,20 @@
<html>
<head>
</head>
<body>
<h1>Contacts</h1>
<ul id="contacts"></ul>
<script type="text/javascript">
var droid = new Android();
var contacts = droid.contactsGet(['display_name']);
var container = document.getElementById('contacts');
for (var i=0;i<=contacts.result.length;i++){
var data = contacts.result[i];
contact = '<li>';
contact = contact + data[0];
contact = contact + '</li>';
container.innerHTML = container.innerHTML + contact;
}
</script>
</body>
</html>
25 changes: 25 additions & 0 deletions Pro Android Python with SL4A/Contacts2.html
@@ -0,0 +1,25 @@
<html>
<head>
</head>
<body>
<h1>Contacts</h1>
<table id="contacts"></table>
<script type="text/javascript">
var droid = new Android();
function call(number){
droid.phoneDialNumber(number);
}
var contacts = droid.contactsGet(['display_name', 'primary_phone']);
var container = document.getElementById('contacts');
for (var i=0;i<=contacts.result.length;i++){
var data = contacts.result[i];
contact = '<tr>';
contact += '<th>' + data[0] + '</th>';
contact += '<td><a href="#" onclick="call(' + data[1] +
');return false;">' + data[1] + '</a></td>';
contact += '</tr>';
container.innerHTML = container.innerHTML + contact;
}
</script>
</body>
</html>
67 changes: 67 additions & 0 deletions Pro Android Python with SL4A/HTMLsettings.html
@@ -0,0 +1,67 @@
<html>
<head>
<style>
#body {width:100%;}
.container {text-align:center;margin:auto;}
.container div {text-align:left;width:75%;}
h1 {text-align:center;margin:auto;}
hr {width:75%;margin:0px auto;}
label {display:block;float:left;width:60%;}
.buttons div {text-align:center;margin:auto;}
</style>
<script type="text/javascript">
var droid = new Android();

function post_data(){
var values = [
['airplane', document.getElementById('airplane_mode').value],
['wifi', document.getElementById('wifi_on').value],
['screen', document.getElementById('screen').value],
];

var q = '?';
for (i=0;i<values.length;i++){
var k = values[i][0];
var v = values[i][1];
if (q != '?'){
q = q + '&';
}
q = q + k + '=' + v;
}

droid.postEvent('save', q);
}
</script>
</head>

<body>
<div id="body">
<h1>My Settings</h1>
<form onsubmit="post_data();return false;">
<div class="container">
<div>
<label for="airplane_mode">Airplane Mode</label>
<input id="airplane_mode" name="radio" type="radio" />
</div>
<div>
<label for="wifi_on">WiFi On</label>
<input id="wifi_on" name="radio" type="radio" />
</div>
</div>
<div class="container">
<div>
<label for="screen">Screen On</label>
<input id="screen" type="checkbox" />
</div>
</div>
<div class="container buttons">
<div>
<input size="5" id="save" name="save" type="submit" value="Save Settings" />
<input size="5" id="cancel" name="cancel" type="button" value="Cancel" />
</div>
</div>
</form>
</div>
</body>

</html>
12 changes: 12 additions & 0 deletions Pro Android Python with SL4A/HTMLsettings.py
@@ -0,0 +1,12 @@
import android
import urlparse

droid = android.Android()
droid.webViewShow('file:///sdcard/sl4a/scripts/settings.html')
while True:
result = droid.waitForEvent('save').result
data = urlparse.parse_qs(result['data'][1:])

droid.toggleAirplaneMode('airplane' in data)
droid.toggleWifiState('wifi' in data)
droid.setScreenBrightness('screen' in data and 255 or 0)
182 changes: 182 additions & 0 deletions Pro Android Python with SL4A/SMS Sender/css/zest.css
@@ -0,0 +1,182 @@
body {
width:100%;
padding: 0;
font-size: 14px;
background: black;
color:white;
font-family: Arial;
}
button{
color:white;
background: transparent;
border: solid 1px #2986a5;
}
.nodisplay {
display:none;
}
.col { float: left; }
.width-100 { width:100%; }
.width-50 { width:50%; }
.width-33{ width:33%; }
.width-25{ width:25%; }
h1 {
font-size: 16px;
border-bottom: dotted 1px #2986a5;
}
div.delimiter{
border-bottom:solid 1px black;
}
.valid{
color: green;
}
.invalid{
color:red;
}
div#menu {
background-image: url("../images/tab-bg.png");
background-repeat: repeat-x;
color: white;
font-weight: bold;
height: 96px;
}
div#menu div.current {
background-image: url("../images/tab-bg-current.png");
background-repeat: repeat-x;
}
div.icon {
height: 67px;
width: 100%;
background-repeat: no-repeat;
background-position: top center;
}

div#bFile div.icon {
background-image: url("../images/file-tab.png");
}
div#bSetup div.icon {
background-image: url("../images/setup-tab.png");
}
div#bText div.icon {
background-image: url("../images/text-tab.png");
}
div#bMerge div.icon {
background-image: url("../images/merge-tab.png");
}

div#bFile.current div.icon {
background-image: url("../images/file-tab-current.png");
}

div#bSetup.current div.icon {
background-image: url("../images/setup-tab-current.png");
}

div#bText.current div.icon {
background-image: url("../images/text-tab-current.png");
}
div#bMerge.current div.icon {
background-image: url("../images/merge-tab-current.png");
}

div.tabs {
text-align: center;
height: 100%;
background: transparent;
vertical-align: middle;
}

#csvfile {
font-style: italic;
}

#content p {
padding: 0px 1em;
}

#content table{
border-collapse: collapse;
}

#content table tr th,
#content table tr td {
border: solid 1px white;
}

#content table tr th {
background: #2986a5;
}

#content table tr td {
padding: 2px;
vertical-align: top;
}

#filebrowser {
width: 95%;
position: absolute;
top: 10px;
background: black;
border: solid 1px #2986a5;
padding-left: 5px;
}

#closeButton {
width: 12px;
height: 12px;
float: right;
font-weight: bold;
border: solid 1px #2986a5;
margin: 5px 5px 0px 0px;
text-align: center;
}

dt.folder {
background-image: url("../images/folder.png");
background-repeat: no-repeat;
}

dd dl {
margin-left: 10px;
}

dt {
margin-top: 10px;
font-size: 1em;
padding-left: 16px;
}

dt.current {
background: #2986a5;
font-weight:bold;
}

dd {
margin: 0px;
}

dl {
margin-bottom: 10px;
}

dt.file {
background-image: url("../images/txt.png");
background-repeat: no-repeat;
}

li {
color: white;
background-repeat: no-repeat;
background-position: top left;
}

ul li {
padding: 0px;
}

li.empty {
font-style: italic;
}

input {
margin-left: 10px;
}
15 changes: 15 additions & 0 deletions Pro Android Python with SL4A/SMS Sender/etc/SMSSender.conf
@@ -0,0 +1,15 @@
[locale]
prefix = +60

[merger]
informeveryratio = 10
informevery = 0

[application]
showonlycsvfiles = 0
showonlytextfiles = 1
showhiddendirectories = 0

[package]
version = 1.01

0 comments on commit c6b8bdc

Please sign in to comment.