android application to send email runs on wifi but not on WAP
I have this application that accesses the internet to send an email in a background service. I added references and libraries for javax.mail
and it is working fine using the WiFi.
in my service i have a function that tests internet connection. when using wap it shows that internet connection is available but when it goes through the sendEmail
function, it doesn't really send the email although it did work when i tried it on WiFi.
Trying to troubleshoot it, i did another application that makes a HTTP get request but th开发者_JAVA百科e same thing happened. the test internet function returned an available internet connection on wap but didn't get the HTTP request. it worked on WiFi.
i also tried to use the ConnectivityManager
and set the default connection to TYPE_MOBILE
, but it always gives me an error which is that the application needs the permission to CHANGE_SECURE_SETTINGS
which i already added to the AndroidManifest
.
how can i make my application run on WAP? should i be using WAP push messages, which honestly i have no idea about and didn't find any documentations about.
Well, making some more research and contacting my provider, i found out that WAP is used only for browsing. applications usually can't use WAP.
Instead, they can use the GPRS. At least this is the case in lebanon, I'm not sure about other countries and other providers.
The application seems to work fine on GPRS.
Hope I've helped :D
精彩评论