question

SergiMauriAlso-8672 avatar image
0 Votes"
SergiMauriAlso-8672 asked Daryl-7656 answered

Acceso directo a base de datos SQL desde APK de Xamarin

Buenos días,
Tengo un aplicación realizada con Xamarin en la cual, desde el dispositivo mobil, accedo directamente a una base de datos SQL server ubicada en un DataCenter. No he desarrollado una API para el acceso a la base de datos, puesto que en este caso no me interesa y no es posible. Se trata de una aplicación muy sencilla.
En el dispositivo mobil tengo configurado un túnel VPN conectado con el servidor SQL server del DataCenter.
La aplicación funciona perfectamente en modo debug desde el dispositivo mobil, pero cuanto cambio a modo release no conecta con la base de datos.
Ahora mismo tengo desplegada la aplicación en modo debug en varios dispositivos, y funciona correctamente, pero lo optimo es implementarla en modo release mediante la APK para que sea mas eficiente.
Pueden por favor ayudarme a encontrar una solución al respecto.
Que es lo que impide el acceso a la base de datos en modo release? No me indica ningún error, simplemente no autentica y no conecta.
Esperando su ayuda al respecto, gracias y un saludo.

sql-server-generaldotnet-xamarin
· 9
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This is an English spoken forum, so please post your question in English.

1 Vote 1 ·

Good Morning,
I have an application made with Xamarin in which, from the mobile device, I directly access a SQL server database located in a DataCenter. I have not developed an API for access to the database, since in this case I am not interested and it is not possible. It is a very simple application.
In the mobile device I have configured a VPN tunnel connected to the SQL server of the DataCenter.
The application works perfectly in debug mode from the mobile device, but when I change to release mode it does not connect to the database.
Right now I have deployed the application in debug mode on several devices, and it works correctly, but the best thing is to implement it in release mode through the APK to make it more efficient.
Can you please help me find a solution about it.
What prevents access to the database in release mode? It does not indicate any error, it just does not authenticate and does not connect.
Waiting for your help in this regard, thanks and best regards.

0 Votes 0 ·

When you generate the apk. please set Linker to None, then re-generate apk to make a test.

57530-image.png


0 Votes 0 ·
image.png (42.2 KiB)

Thanks for your help
I have set Linker to None, then I have re-generated apk and it still cannot connect.

0 Votes 0 ·

Please search your log in logcat If you faced the exception like`System.NotSupportedException CodePage 1254 not supported`, try to add the internationalization assemblies. like this thread https://forums.xamarin.com/discussion/comment/100/#Comment_100

0 Votes 0 ·
Show more comments

0 Answers