MMS sending connectivity issues when wifi is active (Android) -


i'm working on android application send mms internally without using native messaging app. i've been using code native app found @ https://android.googlesource.com guide , have managed create working prototype. however, i'm having slight issue when trying make http_post when phone connected wifi.

in code snippet below request mms network feature , wait android.net.conn.connectivity_change intent indicating connection active. request networkinfo type_mobile , check connected. hit issue. if wifi connected, when call info.isconnected() returns false , mms httppost cannot made post must made through 3g/gprs connection.

connectivitymanager.startusingnetworkfeature(connectivitymanager.type_mobile, "enablemms"); //wait android.net.conn.connectivity_change intent networkinfo info = connmgr.getnetworkinfo(connectivitymanager.type_mobile); if (!info.isconnected())      return; 

the way can work disconnecting wifi @ point info.isconnected() returns true , can go on make httppost successfully. don't think correct way of performing function native app doesn't seem this. can see, native messaging app's transactionservice.java uses internal, deprecated class, networkconnectivitylistener, manage connection can't see in code modifies wifi connection.

has had similar issue or know of correct way work around it? noticed in connectivitymanager documentation there's connection type type_mobile_mms haven't tried it's supported devices running 2.2 , above , want able support devices running 1.6.

any appreciated.

i found out issue had using android.net.connectivitymanager.type_mobile connection type on devices running 2.0 , above. these need use type_mobile_mms , 1.6 devices use type_mobile. there no need disconnect wifi.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -