intel webrtc 2.1.1 server connection issue - android

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

Related

Android & React Native: emulator won't send out http request after https enabled

After enabled https on back end nodejs server, the http request URL was changed from http to https in React Native 0.66 app. Now in Android emulator (API 27), the app does not send out any http request to back end server at all. android:usesCleartextTraffic="true" was added to AndroidManifest.xml but it didn't help (removing it has no impact either). It must be the issue about late android API which requires https in production. But I don't quite understand why https didn't work in Android emulator.
The development platform is macOS Big Sur for both IOS and Android which open their own emulators respectively. The IOS version of the app works fine after https was enabled. But android version of the app does not.

Publish Cordova app for Android 9 (Android API 28) get internet connection error

I develop cordova cross platform app using HTML5 & Javascript. But recently I encountered some problems with android.
Previously I was using Cordova 7 where android version was 6.3
Which supports android API 16 to 26. But as per new google rule, from August 2019, All app must be targeted Android API 28 which is Android 8 & Android 9.
Cordova's latest version is Cordova 9 which supports Android 8. Cordova did not release any version which supports Android 9.
So to develop App targeting API 28, I've to use Android 8. But I'm facing some problems with the app. Previously my app was working fine. When I develop app with Android 8 with Cordova 9, it is working fine with all phones which are Android 8 and below but showing error in Android 9. Specially with AJAX requests.
I'm sending AJAX requests to a server with http (not https). In some blog I see it might cause error. But I don't see any way to fix and currently I've no option to use https.
Another way is to set <preference name="android-targetSdkVersion" value="26" /> which works fine in all android version (6~9) but when I upload with this config in Google Play store, it shows warning to update to target API to 28.
So for now what should I do?
Thanks in advance.
N.B:
I found a way to use http but did not understand it at all. If anyone can explain I'll be glad. Link given below:
https://developer.android.com/training/articles/security-config
Ajax error in Cordova App after upgrade phone to Android 9 Pie API 28 Revision 6
All you have to do is include on AndroidManifest.xml the following key-pair-value on the application tag:
android:usesCleartextTraffic="true"
On API 28 this attribute is set false for default(for security reasons), in previous Android API it was true.
After a long searching I found out that "By Default", Android 9 do not allow to send request to http. It only allows to send requests to https urls. So all I had to do is to upgrade my server from http to https. No worry, its not that hard. If you use plesk for your server management, its like 2 clicks to install "Lets Encrypt" SSL certificate for FREE forever with auto renewal. It also shows Greenbar in Mozilla Firefox too. However if you use other than Plesk, then go to Lets Encrypt website and generate one and install it to your server. Thats all.
You still can make requests to http urls in Android 9 but still its a bit too complex for me to understand so I say pass. Also upgrading from http to https is giving me more security :)
The responses provided by Razin Abid and Stefano Boeri are both excelent answers, but for someone looking how to enable not secure http coonections in Android 9, plese check this answer: How to allow all Network connection types HTTP and HTTPS in Android (9) Pie?.
Please note that if you are working with Cordova, it is not a good idea to modify the AndroidManifest.xml (Android platform) file directly, but edit config.xml (project configuration file) instead.
You will have 2 tools to achieve it: config-file and edit-config, described with details in the Cordova Docs.

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.

python-for-android send an email

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.

Changing the Android version from 2.2 to 2.1

I devloped an android app on 2.2. I used the Soap webservices in my app through https.
I used ssl certification to access those services. It works fine in version 2.2, but now my client want it on 2.1. So I changed the version and min sdk levels but when I run the app in 2.1 it gives me SSl socket exception. Now in my root folder of project it is showing 2.1 version. Could any one help me out?
There is a change in android OS 2.1 to 2.2 that has to do with SSL certificates. But cannot find the url right now.
In order to avoid that you could catch the exception and on SSLException you could reconnect the server with a non-secure connection. Keeping a sharedpreference in case of exception for future use of non-secure connections will avoid double connections all the time.
It not so elegant or secure way but it works for me.

Categories

Resources