问题
I'm new in android. I'm learning about javamail to create app that can send email notification. I follow this tutorial https://www.simplifiedcoding.net/android-email-app-using-javamail-api-in-android-studio/
It's working well in emulator android. I can receive email. Then I tried to install my app in my android device with Wifi connection, it's working well. But when I use Data Mobile Connection (not Wifi) email not sent. Can you tell me why?
Thanks for advance.
回答1:
solution from @Agung from the comments
add this code
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
in AndroidManifest.xml file...
来源:https://stackoverflow.com/questions/40657836/javamail-send-email-work-with-wifi-connection-but-not-with-data-mobile