How to connect from android to sql server using MonoDroid - android

I'm using MonoDroid for android development (meaning using visual studio 2010 and c#)
and trying to connect to sql server. can i use java.sql or system.data in my code and deploy it?
or if anyone has a better solution? (and please not the solution - "use eclipse")

Mono for Android provides System.Data.dll and the System.Data.SqlClient namespace, so you can use your existing System.Data code to connect to Microsoft SQL Server via Mono for Android.
However, you do need to enable TDS support within SQL Server, mixed-mode authentication, and other things. See also Mono's SQLClient documentation and (only indirectly related) my instructions to configure SQL Server for use by Mono with the NerdDinner sample.

Another option is to build a web service, create a reference from your mono project to the web service and use that web service to pass data objects to and from your application. This way you can use the normal .NET environment for getting the data and reuse that web service for other projects like an iOS version of your application without having to rewrite the data calls.
http://docs.xamarin.com/guides/cross-platform/application_fundamentals/web_services

Natively Android supports java.sql package, to connect with sql server , mysql or oracle, you required JDBC Type-3/4 driver. as per my knowledge currently available drivers are not compatible with Android. If you found any compatible driver then it is not advisable to use it because JDBC driver are optimized to work in LAN, Not WAN (Internet). the possible option is to create web service which act as bridge between Android and Database
Andorid <====> Web Service <====> Database

Related

How to create Android Web UI - remote app management

I have an application that runs on Android phone. I would like to add web ui like let's say torrent applications. I would like to manage my application from browser using my laptop, or another phone located on a different side of the planet ;)
What is the easiest way to run a web server inside app, and host a management web app? Is it possible to run nodejs/php server inside application and communicate with hosted web app?
Should be possible, because ttorrent and x-plore have such feature.
Thanks for any clues and advices.
I did several in-app web server projects. nanohttpd and golang are used in my projects.
Nanohttpd is wrote in pure Android SDK compatible Java. You can call any Android SDK API, with no need of RPC or language binding. But nanohttpd has little supports to develop web API. It's not a good choice if you have lots of APIs between javascript and the in-app server, but good if you need invoke Android SDK APIs in the in-app server.
golang supports Android(ARM Linux) well. The good parts are:
static link. you just need coding and build, everything will in one shared library file, you can ease use the library in your Android project
powerful APIs in standard library to develop a web server and web client. Great performance because of golang's async I/O and thread model
gomobile provide a tool to generate RPC wrapper for golang-java inter-operation. golang-c(jni)-java wrapper will also work but I not found a tool to generate the binding, writing bindings is boring.

connecting to Android studio with a noSQL db like crouchDB

Has anyone here ever used a db like crouchDB to connect to an android application?
How do you connect to crouchDB using Android Studio?
I looked it up on google, but there was nothing there about this topic.
I am not familiar with couchDB but as far as I know, you need to connect to a server which connects to a database in order to fetch data for android application. PHP is the most popular server side language and I learnt node.js for android application. For node js, I found this example that teaches you how to connect nodejs to couchDB may help you. Also, you may try different framework with nodejs to facilitate your work, such as loopback. Loopback contains a connector to connect to couchDB but there would be quite a lot to learn since you have to learn loopback and nodejs but loopback automatically provides rest api and android sdk for you to output data effectively. For PHP, you may google one of many tutorial websites that fit your need. I personally never used couchDB before and I learnt how to connect android application to database from this tutorial.

How to connect My Android app with Firebird database via JDBC(jaybird)

I want to connect My Android app to Firebird database using JDBC or Jaybird.I am able to connect it with in JAVA but in android i can't able. so please give me suggestion or idea about it.
Is there any additional Api add into Android App?
Thanks In Adavanced.
In general, you should not use JDBC drivers from Android. Using JDBC from an Android device will be slow and insecure. If you want to connect an Android application to a database, you should write a rest service (eg in Java) that talks to your database, and make your Android application talk to that rest service. It will usually perform better, and is easier to secure than direct database access.
There is a separate port for android of the Jaybird JDBC driver. You can find it on http://sourceforge.net/projects/androidjaybird/ However, this port hasn't been updated for a few years and it seems to have been abandoned.

Connecting Android directly to sql server over local host without using web serices

i want to develop a android application that can work only on the android emulator of my desktop , i have no idea of web service ,is there any way i can connect android directly to database just like we connect in ASp.net?
Android includes a full implementation of sqlite. Vogella has a nice tutorial: http://www.vogella.com/articles/AndroidSQLite/article.html
If you're truly wanting to accomplish this as a locally hosted web service you're going to have to include apache (or similar) in some way. Infinitely harder than just creating a local database.
How about running Android in a virtual machine on a server:
http://androvm.org/blog/
(uses VirtualBox which can run on Windows.)
Then connect via local host to SQL server running on same Windows server.
edit: Running Android in virtual box is like running it on an emulator, but much faster and greater functionality, e.g. the ability to communicate with the host machine via a variety of techniques including via virtual network adapter.
Be clear on what exactly you need?
For stand alone android application you can use SQlite database provided by android
SQllite tutorial
If you are looking to create a webservice... you can try the below link
WebService example

How to connect oracle in a android project

im developing a app in android 2.3, i need to connect to oracle server to fetch data for my app, can anyone tell me wat are the lib files to add and where. Please help
Please be sensible. Write a Web service front end for your database, one that protects your database server from rogue activity. Then, use that Web service for your mobile apps.
Another solution you should consider is mobile server, a product from Oracle designed specifically for syncing data between Oracle DB and mobile devices.
It includes a fully configurable synchronization engine that can either run stand alone, or be controlled from inside your app via APIs. It supports SSL so you can have safe, secure access to your data from Android and other mobile devices.
You can read about it here:
http://bit.ly/fmiAre
Also you can download it from the download tab on the same link and try it out yourself.
Good luck with your project,
Eric, Oracle PM

Categories

Resources