Java send and receive SMS. Free SMS gateway?
FYI Simplewire is now OpenMarket.com/MXTelecom.com
There are a couple of free SMS gateways but they all attach a SMS ad in your message to pay for the cost. ZeepMobile is the one I hear about the most. As for paying there are a couple of solution but this all depends on your needs.
Two way communication would require the end user to subscribe to your service. There are a few ways to approach this:
Short Code: you could get your own (www.openmarket.com) or share with others (www.clickatell.com) You could use a new service www.twilio.com looks to be good but haven't tested it yet.
If one way communication is all you need you could so something like email to gateway sms but then you would need to know the carrier the end user is on.
Fowiz offers free Android based solution to send/receive text messages from applications. You need to install their Android App on your device to enable this service and the messages are sent/received on your phone. You can setup CallbackUrl to receive instant notification on the incoming messages. Fowiz also supports short codes, campaign management, voting etc.
Sample code to send message via Fowiz:
String myPasscode = 'your passcode';
String myUsername = 'your fowiz username';
String toPhoneNumber = 'recipient phone number';
String myMessage = 'your message';
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet(HTTP_API + "?username="+myUsername
"&phonenumber="+toPhoneNumber
+"&message="+myMessage+"&passcode="+myPasscode);
HttpResponse response = client.execute(request);
BufferedReader rd = new BufferedReader
(new InputStreamReader(response.getEntity().getContent()));
String line = "";
StringBuffer response = new StringBuffer();
while ((line = rd.readLine()) != null) {
response.append(line);
}
System.out.println(response.toString());
Source: http://cloud.fowiz.com/2help.html