Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new pull request #3

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
4130593
polling
niryariv Jan 15, 2011
aee1061
initial import of polling code
niryariv Jan 15, 2011
8e31033
new icon
niryariv Jan 15, 2011
ec1dc62
simplify polling UI to use fixed, 15 min intervals
niryariv Jan 15, 2011
2089450
cleanup home screen text
niryariv Jan 16, 2011
3ed1958
add a poll=true parameter
niryariv Jan 16, 2011
448eafe
Move post-parse sms sending to TargetUrlRequest
niryariv Jan 18, 2011
9473ab1
use POST in http requests; use different url for outgoing sms; poll f…
Sep 11, 2011
fc6cda4
do http requests in AsyncTask so they don't freeze the UI thread; imp…
Sep 12, 2011
8f15a8c
add menu with options to test server connection, or edit settings
Sep 12, 2011
d5b9734
fix null pointer exception; remove dependency on Base64 for android 1…
Sep 12, 2011
cb8d95e
PHP server library with example implementation; add 'check now' butto…
Sep 12, 2011
aff22e5
use string status codes instead of integers
Sep 13, 2011
0a0f50a
fix comments for php server example
Sep 13, 2011
da334a0
remove test action to simplify server implementation; add icons from …
Sep 13, 2011
307f354
add help screen
Sep 13, 2011
2911111
keep messages waiting to be sent in memory; if forwarding fails (in e…
Sep 13, 2011
d29e7b2
start alarm to poll for outgoing messages when phone boots; add optio…
Sep 13, 2011
e4cea3b
use alarm to schedule retries; fix bug where sms notfications were dr…
Sep 13, 2011
bead453
set phone number and api version as regular post fields instead of cu…
Sep 13, 2011
e535266
instead of deleting messages from inbox, prevent them from getting th…
Sep 13, 2011
e79fe7c
refactoring
Sep 13, 2011
61d24b2
add setting to enable/disable sms gateway
Sep 13, 2011
41141fa
add menu option to forward existing messages from inbox (delivered wh…
Sep 14, 2011
0071efd
improve ForwardInbox with help from http://www.marvinlabs.com/2010/10…
Sep 14, 2011
2f22c29
github generated gh-pages branch
youngj Sep 15, 2011
e78598c
refactor App to subclass Application; retain log messages in App clas…
Sep 15, 2011
46710c2
organize code into subpackages
Sep 16, 2011
60d4941
launching Main activity on boot is no longer necessary
Sep 16, 2011
d994b10
support for incoming MMS
Sep 18, 2011
72a893e
Merge branch 'gh-pages' of github.com:youngj/KalSMS
Sep 18, 2011
7bc88cf
updated readme
Sep 18, 2011
e834488
avoid exceeding Android limit of 100 outgoing SMS/app/hour; allow eff…
Sep 18, 2011
d720412
most README content moved to http://youngj.github.com/KalSMS/
Sep 19, 2011
430aeca
enable user to change wifi sleep policy on kalsms settings page for c…
Sep 19, 2011
3357de7
assume http:// scheme for server URLs
Sep 19, 2011
eb80837
add test mode to allow testing KalSMS on a phone that is also being u…
Sep 19, 2011
a793a5f
use http connection pooling to improve performance (especially over ssl)
Sep 20, 2011
9a574b3
add foreground service to keep App in memory (otherwise rate-limiting…
Sep 20, 2011
9440fdb
android's ForegroundService example code is surprisingly buggy
Sep 20, 2011
4b0010f
display version number
Sep 20, 2011
687400f
use kalsms version code in http requests
Sep 20, 2011
b6a372d
avoid forwarding sms from network; unregister mms observer when kalsm…
Sep 21, 2011
dbf3536
update url in readme
Sep 21, 2011
73bc3c9
MMS fixes: prevent httpclient from using transfer-encoding: chunked s…
Sep 22, 2011
7df89cd
rename to EnvayaSMS; add icon
Sep 22, 2011
1cf69e8
update links
Sep 23, 2011
6384942
handle sending and receiving multipart sms messages > 160 chars
Sep 24, 2011
986b50f
fix bug where outgoing sms would be cut off if they contain xml entities
Sep 25, 2011
bf14f23
fix encoding problem for post requests, make test a separate action
Sep 27, 2011
03d5f55
update php server library and example
Sep 27, 2011
faffc6c
don't request delivery reports but leave option open in future; fix b…
Sep 28, 2011
3108512
keep backlogged outgoing messages in priority queue; allow server to …
Sep 28, 2011
1081f57
automatic failover between wifi/mobile if server cannot be reached; s…
Sep 29, 2011
d7f803e
add PendingMessages activity for viewing/retrying/deleting pending me…
Oct 1, 2011
cf1deec
queue incoming messages like outgoing messages
Oct 1, 2011
dedfdb5
improve performance of displaying log in Main activity
Oct 1, 2011
79ec4c1
add note about local.properties and sdk.dir to README
Oct 4, 2011
af1f8af
add html page for simulating EnvayaSMS requests
Oct 9, 2011
f253f54
update license and readme files for request simulator
Oct 9, 2011
2889bf9
send new log messages to server on each HTTP request; notify server o…
Oct 10, 2011
f430ddb
set http user-agent header
Nov 13, 2011
22f8c26
add settings screen for ignored phone numbers; allow user to specify …
Nov 26, 2011
c18a28b
enable long polling - increase socket timeout, start only one PollerT…
Nov 30, 2011
6f19970
increment version to 2.0.4
Nov 30, 2011
d93ff76
update httpserver submodule to latest version
youngj Mar 15, 2012
f53ccc3
add support for incoming call notifications; fix intermittent NullPoi…
youngj Mar 16, 2012
239ee1f
version 3.0 - real-time AMQP connections; change server API format f…
youngj Apr 4, 2012
9d65fc1
remove stray references to telerivet
youngj Apr 4, 2012
69a05ac
remove code added for debugging
youngj Apr 4, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix bug where outgoing sms would be cut off if they contain xml entities
Jesse Young committed Sep 25, 2011
commit 986b50f0a812afbb8aa6938f34ec7a9ef32b9fe8
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.envaya.sms"
android:versionCode="7"
android:versionName="2.0-beta 5">
android:versionCode="8"
android:versionName="2.0-beta6">

<uses-sdk android:minSdkVersion="4" />

2 changes: 2 additions & 0 deletions res/layout/help.xml
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/help"
android:textSize="16sp"
android:autoLink="web"
android:textColor="#FFFFFF"
android:layout_margin="5px">
</TextView>
8 changes: 5 additions & 3 deletions src/org/envaya/sms/App.java
Original file line number Diff line number Diff line change
@@ -78,7 +78,9 @@ public final class App extends Application {
public static final String STATUS_EXTRA_NUM_PARTS = "num_parts";

public static final int MAX_DISPLAYED_LOG = 4000;
public static final int LOG_TIMESTAMP_INTERVAL = 60000;
public static final int LOG_TIMESTAMP_INTERVAL = 60000; // ms

public static final int HTTP_CONNECTION_TIMEOUT = 10000; // ms

// Each QueuedMessage is identified within our internal Map by its Uri.
// Currently QueuedMessage instances are only available within EnvayaSMS,
@@ -690,8 +692,8 @@ public boolean isTestPhoneNumber(String phoneNumber)
public HttpParams getDefaultHttpParams()
{
HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, 8000);
HttpConnectionParams.setSoTimeout(httpParams, 8000);
HttpConnectionParams.setConnectionTimeout(httpParams, HTTP_CONNECTION_TIMEOUT);
HttpConnectionParams.setSoTimeout(httpParams, HTTP_CONNECTION_TIMEOUT);
HttpProtocolParams.setContentCharset(httpParams, "UTF-8");
return httpParams;
}
3 changes: 0 additions & 3 deletions src/org/envaya/sms/receiver/SmsReceiver.java
Original file line number Diff line number Diff line change
@@ -6,14 +6,11 @@
import android.os.Bundle;
import android.telephony.SmsMessage;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.envaya.sms.App;
import org.envaya.sms.IncomingMessage;
import org.envaya.sms.IncomingSms;


public class SmsReceiver extends BroadcastReceiver {

private App app;
15 changes: 9 additions & 6 deletions src/org/envaya/sms/task/HttpTask.java
Original file line number Diff line number Diff line change
@@ -20,17 +20,13 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.FormBodyPart;
import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpProtocolParams;
import org.envaya.sms.App;
import org.envaya.sms.Base64Coder;
import org.envaya.sms.OutgoingMessage;
@@ -202,8 +198,15 @@ protected List<OutgoingMessage> parseResponseXML(HttpResponse response)

sms.setServerId(serverId.equals("") ? null : serverId);

Node firstChild = smsElement.getFirstChild();
sms.setMessageBody(firstChild != null ? firstChild.getNodeValue(): "");
StringBuilder messageBody = new StringBuilder();
NodeList childNodes = smsElement.getChildNodes();
int numChildren = childNodes.getLength();
for (int j = 0; j < numChildren; j++)
{
messageBody.append(childNodes.item(j).getNodeValue());
}

sms.setMessageBody(messageBody.toString());

messages.add(sms);
}
2 changes: 1 addition & 1 deletion src/org/envaya/sms/ui/Help.java
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ public void onCreate(Bundle icicle) {
+ "EnvayaSMS is a SMS gateway.<br /><br /> "
+ "It forwards all incoming SMS messages received by this phone to a server on the internet, "
+ "and also sends outgoing SMS messages from that server to other phones.<br /><br />"
+ "See http://sms.envaya.org/ for more information.<br /><br />"
+ "See sms.envaya.org for more information.<br /><br />"
+ "The Settings screen allows you configure EnvayaSMS to work with a particular server, "
+ "by entering the server URL, your phone number, "
+ "and the password assigned to your phone on the server.<br /><br />"