Java API For Kannel SMS - WAP Gateway V 1.0
Java API For Kannel SMS - WAP Gateway V 1.0
Java API for Kannel SMS/WAP gateway v 1.0.2 released | Java Code Geeks
Hom e
JCG
W4G
Softw are
Resources
Tutorials
Exam ples
Jobs
Advertising
About JCGs
RSS
Follow us
Become a fan
Java
Android
JVM Languages
Communications
Software Development
Agile
DevOps
Communications
Career
Misc
Meta JCG
Hello all, we released version 1.0.2 of Java API for Kannel SMS/WAP gateway. The latest version introduces prioritized WAP Push functionality and bulk WAP Push messaging. You can download the new version here An example use of the API is shown below :
0 5 0 6 0 7 0 8 0 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 4 0 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 5 0 5 1 5 2
0 1 p u b l i cs t a t i cv o i dm a i n ( S t r i n g [ ]a r g s ){ 0 2 0 3 S M S M a n a g e rs m s M a n a g e r=S M S M a n a g e r . g e t I n s t a n c e ( ) ; 0 4 / /W ec a nc h a n g et h ep r e f e t c hs i z eo ft h eb a c k g r o u n dw o r k e rt h r e a d s m s M a n a g e r . s e t M e s s a g e s P r e f e t c h S i z e ( 3 0 ) ; / /W ec a nc h a n g et h es e n dm e s s a g er a t e s m s M a n a g e r . s e t M e s s a g e s S e n d R a t e ( 6 5 ) ; t r y{ / /S e n dS M St oas i n g l ed e s t i n a t i o n s m s M a n a g e r . s e n d S M S ( " l o c a l h o s t " ," 1 3 0 1 3 " ," f o o " ," b a r " ," s e n d e r _ m o b i l e _ n u m b e r " , " r e c e i v e r _ m o b i l e _ n u m b e r " ," t h e _ m e s s a g e " ) ; / /S e n dS M St oas i n g l ed e s t i n a t i o nw i t has p e c i f i cp r i o r i t ya n ds e n dr a t e s m s M a n a g e r . s e n d S M S ( " l o c a l h o s t " ," 1 3 0 1 3 " ," f o o " ," b a r " ," s e n d e r _ m o b i l e _ n u m b e r " , " r e c e i v e r _ m o b i l e _ n u m b e r " ," t h e _ m e s s a g e " ,S M S M a n a g e r . M E S S A G E _ P R I O R I T Y _ 3 ) ; / /S e n dS M St om u l t i p l er e c i p i e n t s L i s t < S t r i n g >r e c i p i e n t s G r o u p A=n e wA r r a y L i s t < S t r i n g > ( ) ; r e c i p i e n t s G r o u p A . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 1 " ) ; r e c i p i e n t s G r o u p A . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 2 " ) ; r e c i p i e n t s G r o u p A . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 3 " ) ; r e c i p i e n t s G r o u p A . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 4 " ) ; r e c i p i e n t s G r o u p A . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 5 " ) ; s m s M a n a g e r . s e n d S M S ( " l o c a l h o s t " ," 1 3 0 1 3 " ," f o o " ," b a r " ," s e n d e r _ m o b i l e _ n u m b e r " ,r e c i p i e n t s G r o u p A , " t h e _ m e s s a g e " ) ; / /S e n dS M St om u l t i p l er e c i p i e n t sw i t has p e c i f i cp r i o r i t ya n ds e n dr a t e L i s t < S t r i n g >r e c i p i e n t s G r o u p B=n e wA r r a y L i s t < S t r i n g > ( ) ; r e c i p i e n t s G r o u p B . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 1 " ) ; r e c i p i e n t s G r o u p B . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 2 " ) ; r e c i p i e n t s G r o u p B . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 3 " ) ; r e c i p i e n t s G r o u p B . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 4 " ) ; r e c i p i e n t s G r o u p B . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 5 " ) ; s m s M a n a g e r . s e n d B u l k S M S ( " l o c a l h o s t " ," 1 3 0 1 3 " ," f o o " ," b a r " ," s e n d e r _ m o b i l e _ n u m b e r " , r e c i p i e n t s G r o u p B ," t h e _ m e s s a g e " ,S M S M a n a g e r . M E S S A G E _ P R I O R I T Y _ 7 ) ; / /S e n daW A PP u s hr e q u e s tt oas i n g l em o b i l er e c i p i e n t s m s M a n a g e r . s e n d W A P P u s h ( " l o c a l h o s t " ," 8 1 8 1 " ," r e c e i v e r _ m o b i l e _ n u m b e r " , S M S M a n a g e r . W A P _ P U S H _ R E C E I V E R _ T Y P E _ M O B I L E ," t h e _ m e s s a g e " ," h t t p : / / l o c a l h o s t " ,3 ) ; / /S e n daW A PP u s hr e q u e s tt oas i n g l ed e s t i n a t i o nw i t has p e c i f i cp r i o r i t ya n ds e n dr a t e s m s M a n a g e r . s e n d W A P P u s h ( " l o c a l h o s t " ," 8 1 8 1 " ," r e c e i v e r _ m o b i l e _ n u m b e r " , S M S M a n a g e r . W A P _ P U S H _ R E C E I V E R _ T Y P E _ M O B I L E ," t h e _ m e s s a g e " ," h t t p : / / l o c a l h o s t " ,3 , S M S M a n a g e r . M E S S A G E _ P R I O R I T Y _ 8 ) ; / /S e n dW A PP u s hr e q u e s tt om u l t i p l er e c i p i e n t sw i t has p e c i f i cp r i o r i t ya n ds e n dr a t e L i s t < S t r i n g >r e c i p i e n t s G r o u p C=n e wA r r a y L i s t < S t r i n g > ( ) ; r e c i p i e n t s G r o u p C . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 1 " ) ; r e c i p i e n t s G r o u p C . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 2 " ) ; r e c i p i e n t s G r o u p C . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 3 " ) ; r e c i p i e n t s G r o u p C . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 4 " ) ; r e c i p i e n t s G r o u p C . a d d ( " r e c e i v e r _ m o b i l e _ n u m b e r _ 5 " ) ; s m s M a n a g e r . s e n d B u l k W A P P u s h ( " l o c a l h o s t " ," 8 1 8 1 " ,r e c i p i e n t s G r o u p C , S M S M a n a g e r . W A P _ P U S H _ R E C E I V E R _ T Y P E _ M O B I L E ," t h e _ m e s s a g e " ," h t t p : / / l o c a l h o s t " ,3 , S M S M a n a g e r . M E S S A G E _ P R I O R I T Y _ 8 ) ; }c a t c h( E x c e p t i o ne x ){
Carrer Opportunities
Java Developer Ten Mile Square Washington, DC ( FULL-TIME ) 2013 Java Developer CARFAX FULL-TIME ) January 27, 2013 Java Developer Elite Associates
Join Us
Do you have a blog with unique and content? Then, check out our program. You can also be a Code Geeks
Tags
JavaFX
JavaOne
Performance an
www.javacodegeeks.com/2010/05/java-api-for-kannel-smswap-gateway-v_24.html
1/4
05/02/13
Java API for Kannel SMS/WAP gateway v 1.0.2 released | Java Code Geeks
5 2 }c a t c h( E x c e p t i o ne x ){ 5 3 e x . p r i n t S t a c k T r a c e ( ) ; 5 4 } 5 5 5 6 / /S t o p st h eb a c k g r o u n dw o r k e r . 5 7 / /s m s M a n a g e r . s t o p S M S M a n a g e r W o r k e r ( ) ; 5 8 5 9 } Best Regards Justin Related articles : Kannel encoding clarifications Java API for Kannel SMS/WAP gateway Java API for Kannel SMS/WAP gateway v 1.0.1 released
Spring
Testing
2 2
1 1
www.javacodegeeks.com/2010/05/java-api-for-kannel-smswap-gateway-v_24.html
2/4
05/02/13
ALSO ON JAVA CODE GEEKS
Java API for Kannel SMS/WAP gateway v 1.0.2 released | Java Code Geeks
RECOMMENDED CONTENT What's this?
40 Java Collections Interview Questions and Answers 4 comments One jar to rule them all Scala: Collections 1
5 comments
Tacos, Tragedy, Testosterone: Watch Episode 1 of Comedy Central's New Show Comedy Central 8 Ways To Lose Money On Bonds
Investopedia
2 comments 1 comment
Kim Kardashian's Stunning Mini-Dress From the Red Carpet Style Bistro That '70s Show' Star Lisa Robin Kelly Arrested AGAIN & the Mugshots Keep Getting Worse CafeMom
4 comments
Leave a message...
Discussion
Ju s ti n C a te r
2 years ago
Hello Sndor, Yes it will support receiving SMS in the upcoming version, so stay tuned! BRs
0
Reply
Share
S n d o r N o rb e rt
2 years ago
Reply
Share
Ju s ti n C a te r
2 years ago
Hello Josue, Either a SMSPushRequestException or a WAPPushRequestException will be thrown to your client if Kannel returns an invalid response code (other than 0 for SMS and 1001 for WAP Push). Both Exceptions contain the code of Kannel response. As far as the delivery report, this version does not implement delivery report handling. Nevertheless we plan to add it in the near future, so stay tuned! BRs
0
Reply
Share
jos ue
2 years ago
Excellent post, I have a question ..... maybe I could help -> How could I know if the message was sent to Kannel was successful -> How could I know if the message was sent from Kannel to the carrier received a satisfactory result Thank you very much for your help.
0
Reply
Share
C o m m e n t fe e d
Su b s cri b e vi a e m a i l
Knowledge Base
Partners
Hall Of Fame
JCGs (Java Code Geeks) is an independent online community fo Examples Resources Software Java Code Geeks .NET Code Geeks
The Code Geeks Network
Android Full Application Tutorial series GWT 2 Spring 3 JPA 2 Hibernate 3.5 Tutorial Android Game Development Tutorials Android Google Maps Tutorial Android Location Based Services Application GPS location Funny Source Code Comments Java Best Practices Vector vs ArrayList vs HashSet Android JSON Parsing with Gson Tutorial
creating the ultimate Java to Java developers resource center; ta junior developers alike. JCGs serve the Java, SOA, Agile and Te announcements, code snippets and open source projects.
License
This work by Java Code Geeks is licensed under a Creative Com Attribution-ShareAlike 3.0 Unported License. License
www.javacodegeeks.com/2010/05/java-api-for-kannel-smswap-gateway-v_24.html
3/4
05/02/13
Java API for Kannel SMS/WAP gateway v 1.0.2 released | Java Code Geeks
Android JSON Parsing with Gson Tutorial
2010-2012 Java Code Geeks. Licenced under a Creative Commons Attribution-ShareAlike 3.0 Unported License. All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective ow ners. Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries. Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
www.javacodegeeks.com/2010/05/java-api-for-kannel-smswap-gateway-v_24.html
4/4