Skip to content

Commit

Permalink
prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
vasilitate committed Feb 2, 2016
1 parent 18596d7 commit 8c5eca7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
9 changes: 7 additions & 2 deletions app/src/main/java/com/vasilitate/vapp/sdk/SmsSendManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ private void initialiseRandomSendIntervals() {
* if the random interval since the last sending has not yet passed.
*/
void addNextSmsToSendQueue() {
if (sendIntervals.isEmpty()) {
return;
}

if (isFirstInSequence) { // send immediately without waiting for an interval
isFirstInSequence = false;
sendSMS();
Expand Down Expand Up @@ -178,7 +182,8 @@ public void onFinish() {
private void sendSMS() {
try {
currentSmsMessage = Vapp.generateSmsForProduct(context, totalSMSCount, currentSmsIndex);
Log.d(Vapp.TAG, "Send SMS to " + currentSmsMessage.getDeliveryNumber() + ": " + currentSmsMessage);
String message = currentSmsMessage.toString();
Log.d(Vapp.TAG, "Send SMS to " + currentSmsMessage.getDeliveryNumber() + ": " + message);

if (testMode) { // mock sending of sms and proceed to next
if (sendListener != null) {
Expand All @@ -189,7 +194,7 @@ private void sendSMS() {
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(currentSmsMessage.getDeliveryNumber(),
null, // Call center number.
currentSmsMessage.toString(),
message,
sentPI,
deliveredPI);
}
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/com/vasilitate/vapp/sdk/Vapp.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ public static synchronized void initialise(Context context,
if (productBeingPurchased != null) {
startSMSService(context, productBeingPurchased.getProductId());
}

VappSms sms = generateSmsForProduct(context, 5, 2);
String s = sms.toString();
Log.d(TAG, s);
}

/**
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/com/vasilitate/vapp/sdk/VappSms.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
* Holds a generated SMS which is sent to a VAPP telephone number.
*/
class VappSms {
private static final char[] RAND_CHARS = {'(', ')', '<', '>'};
private static final char[] RAND_CHARS = {'(', ')', '@', '#', '~', '^'};
private static final int RAND_CHARS_LEN = RAND_CHARS.length;

private static final String SMS_FIELD_SEPARATOR = " ";
private static final String SDK_NAME = "VAPP!";
private static final String ROAMING_INDICATOR = "Roaming";

private final String appVappId;
Expand Down Expand Up @@ -57,7 +56,7 @@ private String generateSms() {
addFieldAndSpace(networkName, sb);
addFieldAndSpace(networkCountry, sb);

addFieldAndRandomChars(randomSegment2, sb, random.nextInt(RAND_CHARS_LEN), random.nextInt(RAND_CHARS_LEN));
addFieldAndRandomChars(randomSegment2,sb,random.nextInt(RAND_CHARS_LEN),random.nextInt(RAND_CHARS_LEN));
addFieldAndRandomChars(randomSegment3, sb, random.nextInt(RAND_CHARS_LEN), random.nextInt(RAND_CHARS_LEN));

if (isRoaming) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected void onCreate(Bundle savedInstanceState) {
try {
Vapp.initialise(this,
VAPP_PRODUCTS,
true, // Test mode - don't send SMSs
false, // Test mode - don't send SMSs
true,
"BG8R4X2PCXYCHRCRJTK6");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

/**
* A convenience enum for setting up the products.
*/
public enum MyProduct {

Expand Down

0 comments on commit 8c5eca7

Please sign in to comment.