Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: felixb/websms-connector-sms77
base: c737a86e44
...
head fork: felixb/websms-connector-sms77
compare: e4fca79e0e
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/de/ub0r/android/websms/connector/sms77/ConnectorSms77.java
View
14 src/de/ub0r/android/websms/connector/sms77/ConnectorSms77.java
@@ -24,18 +24,21 @@
import java.util.ArrayList;
import org.apache.http.HttpResponse;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.message.BasicNameValuePair;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
+import de.ub0r.android.websms.connector.common.BasicSMSLengthCalculator;
import de.ub0r.android.websms.connector.common.Connector;
import de.ub0r.android.websms.connector.common.ConnectorCommand;
import de.ub0r.android.websms.connector.common.ConnectorSpec;
import de.ub0r.android.websms.connector.common.ConnectorSpec.SubConnectorSpec;
import de.ub0r.android.websms.connector.common.Log;
import de.ub0r.android.websms.connector.common.Utils;
+import de.ub0r.android.websms.connector.common.Utils.HttpOptions;
import de.ub0r.android.websms.connector.common.WebSMSException;
/**
@@ -96,6 +99,8 @@ public final ConnectorSpec initSpec(final Context context) {
ConnectorSpec c = new ConnectorSpec(name);
c.setAuthor(context.getString(R.string.connector_sms77_author));
c.setBalance(null);
+ c.setSMSLengthCalculator(new BasicSMSLengthCalculator(new int[] { 160,
+ 153 }));
// FIXME: c.setLimitLength(MAX_CUSTOM_SENDER_LENGTH);
c.setCapabilities(ConnectorSpec.CAPABILITIES_UPDATE
| ConnectorSpec.CAPABILITIES_SEND
@@ -247,8 +252,13 @@ private void sendData(final Context context, // .
d = null;
}
Log.d(TAG, "HTTP REQUEST: " + url);
- HttpResponse response = Utils.getHttpClient(url, null, d, null,
- null, "ISO-8859-15", CERT_FINGERPRINT);
+ HttpOptions httpOpts = new HttpOptions("ISO-8859-15");
+ httpOpts.url = url;
+ if (d != null) {
+ httpOpts.postData = new UrlEncodedFormEntity(d, "ISO-8859-15");
+ }
+ httpOpts.knownFingerprints = CERT_FINGERPRINT;
+ HttpResponse response = Utils.getHttpClient(httpOpts);
int resp = response.getStatusLine().getStatusCode();
if (resp != HttpURLConnection.HTTP_OK) {
throw new WebSMSException(context, R.string.error_http, " "

No commit comments for this range

Something went wrong with that request. Please try again.