python-for-android send an email - android

I am trying to create an app for Android using python-for-android. I want my app to send me an xls file by email. to do so I am using smtplib:
smtplib.SMTP('smtp.gmail.com', 587)
s.ehlo()
s.starttls()
s.login('myadress#gmail.com', 'mypassword')
s.sendmail('myadress#gmail.com', 'to#gmail.com', message)
s.close()
when I run my app from my android phone I have this error message:
Error in starttls, No SSL support include in this python, I have try with or without starttls and ehlo but no joy. I have try to import ssl.py manually but I come across more problem...
How can I set up a SSL interpreter on the android phone? or is there another solution to send an email?
I am using:
Android 4.1.2
Python 2.7
Android SDK 22.2.1
API 18

I don't believe Android below JellyBean supports SSL. I tried to use an app that required SSL an it refused to connect.

Related

Can't access HTTPS from my Android Emulator

I'm behind a corporate proxy and everything that access the internet needs a special configuration regarding Proxy. I'm on a CentOS 7, using CNTLMD to handle proxy tunneling, developing for mobile with React Native. And I'm using the Android Emulator provided by Android Studio.
I first noticed that my emulator can't access any HTTPS protocol when I tried to open Google in the Browser. Internally google redirects to HTTPS and I always get that "Connection Refused" error. Later (this week), trying to use Axios and Fetch to make HTTP/HTTPS requests, this has become a serious problem, since the APIs I'm trying to connect to are under the HTTPS protocol.
A friend of mine who is working in the same project but using Mac has no problems with HTTPS. I have also tried to start the emulator with the following commands:
emulator -avd myemulator -http-proxy http://127.0.0.1:3128
And
emulator -avd Marshmallow86 -http-proxy http://<network username>:<network password>#<ip>:<port>
And they do nothing.
I tried setting up HTTP and HTTPS proxy on Android Studio but this don't seem to be the way (and also didn't work).
#edit
I set the http_proxy on my host and started the emulator without parameters. Didn't work as well.
What am I missing?
I haven't used the software above that isn't android avd or androidstudio,
but it looks like a proxy or CA certificate problem.
Since the difference seems to be by OS, I would guess CA certificate first.
This android page has advice on using openssl from the command line to
explore that and consider importing certificates.
https://developer.android.com/training/articles/security-config.html
This android page has current suggestions for proxy configurations:
https://developer.android.com/studio/run/emulator-networking.html
Note, that the above instructions are updated for new features.
In the past I needed a proxy to a non-ssl appengine development server
which is slightly different from your problem but here's what I used:
For an SSL proxy, used the apache web server, and configured it to use SSL
by installing a self-signed certificate, then added a ProxyPass and ProxyPassReverse
in httpd.conf and a ProxyPass in the httpd-ssl.conf.
ProxyPass / http://127.0.0.1:8080/
Apache as an SSL proxy receives connections to https://127.0.0.1:443 and
passes them to http://127.0.0.1:8080
Then in the application, code that will be running in the emulator
can use address
10.0.2.2 to use android subnet routing table to connect to the dev. OS localhost.

intel webrtc 2.1.1 server connection issue

I have an android app which makes peer-2-peer video and audio calls. It was using webrtc version 2.0, i was supposed to port it to version 2.1.1.
So i did replace the dependencies with the newer version. I had some errors but i fixed it - like some functions names changed and stuff like that - then the app is compiling and running good.
the issue here when i try to connect to intel server. The server receives the request along with name of the peer and authenticate it but never send the response no matter how long i wait. no failure or success message.
This worked for me after several tries
when using intel webrtc server version 2.0 you use this url format to connect "http://0.0.0.0:8095/webrtc" => "http://ip:port/webrtc"
but when using version 2.1.1 you should use this format "http://0.0.0.0:8095" => "http://ip:port"
simply remove the "/webrtc" part

Cannot call local web api from cordova android app

I am currently developing a cordova 4.3 android app in Visual Studio 2015 RC. It's an AngularJS app and I use $resource to send requests to an ASP.NET Web Api application running on a different port on the same computer. Debugging the app in Ripple works fine if I disable the Cross Domain Proxy but when I try to debug in the Visual Studio Android Emulator or on my Android device I get a not very helpful "Failed to load resource" as soon as try to reach the web api. The url looks correct and I suspect the problem has to do with either CORS or my HTTPS certificate or both? What I have tried so far is:
Set <uses-permission android:name="android.permission.INTERNET" /> and android:debuggable="true" in the manifest file.
Tried chrome://inspect/#devices to get more info about the problem but got the error message "Cannot load DevTools frontend from an untrusted origin".
I am able to connect my android phone chrome web browser to the localhost web api using the very helpful tool sharpproxy [https://www.codefromjames.com/wordpress/?p=97] but this approach unfortunately does not work with the app's webview.
The ajax request does work when I point the app to my azure hosted live web api endpoint where I have a valid https certificate but that is not very convenient to use while developing the app.
Made sure the config.xml-file contains <access origin="*" />
My web api is configured with app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll)
I am completely new to cordova/hybrid app development and am surely missing some obvious thing? Any help or suggestion would be very appreciated!!
After having all sort of problems with Visual Studio 2015 I uninstalled it went back to Visual Studio 2013 Update 4 and now I can connect my android device to a local running web api using sharp proxy I mentioned and linked to above.
So to be clear:
Use Visual Studio 2013 Update 4 to run your web api on for example the url https://localhost:44358/.
Start sharp proxy with external port 5000 and internal 44358.
Make sure your android device is connected to the same wifi and instruct your app to use https://your-ip-address:5000 for all service calls.

Cannot access to app engine local dev server

I'm devellopping an android app for my school project using android studio, I create a google app engine endpoint to acces a datastore, I follow those two tutorial:
http://rominirani.com/2014/08/26/gradle-tutorial-part-9-cloud-endpoints-persistence-android-studio/
https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/HelloEndpoints
So i create a new Module, put my google app id into the appengine-web.xml file, when I run it I get te message:
INFOS: The admin console is running at http://localhost:8080/_ah/admin
nov. 25, 2014 3:46:33 PM com.google.appengine.tools.development.DevAppServerImpl doStart
INFOS: Dev App Server is now running
But here is my localhost
I also try to change the port number in my gradle file by writing:
appengine {
httpPort = 8080
But I obtain another error:
Do anyone have an idea why my dev server isn't accessible ?
You seem to try with port number 8888 (look at your error message), where as your server is running at 8080 port number
If you want to change the port number, there is an .iml file inside the project, edit HTTP_PORT under configurations{}
I found out the error was prompt only with gogle chrome (maybe because i'm running it without admin privileges) but it's works great in safari.

Google App Engine conneced Android App Failure

I trying to deploy an android application connected to GAE. I run the online tutorial on google, I used the right configuration (as they write on the tutorial) but I can't communicate the Android Virtual Device with the web application running locally. The Web application shows me a "Server Error 500" and the android application on AVD shows me a "Failure:Connect to /192.168.56.1:8888 timed out" error.
I m running Eclipse Indigo and the virtual android device is with Google API Level 10.
Thank you.
Appengine dev server by default only accepts connections on localhost address (localhost and 127.0.0.1).
To make it accept connections on all ports add -bindAddress 0.0.0.0 to dev server parameters in Eclipse.

Categories

Resources