So, the scenario is i have a MYSQL database stored on local system on SQL server 2008 which is turned ON 24/7 and is connected to internet. there is no API, no web services.
Now, i want to develop a android application which can fetch data from that server. and that app should be able to get the data no matter from where the app is getting accessed.
i somewhere read that it is possible by connecting via IP address but could't find proper reference for it and i never done it before.
i can connect android app if the database is stored on cloud but this one is on local system.
so tell me the possible ways to connect android app with local database. i've already spent plenty of time in searching the solution but nothing is helpful.
Related
So far I think it's a security thing that you're not allowed reading/writing to an Android SQLite database outside of the containing app's process.
But are there advanced techniques or tools that can be used to achieve this?
For instance, I want to make a web interface with a textbox where the Android app would connect to and then I can run SQL queries via said interface to read the database or to insert records into it.
I'm writing this question because I'm really stumped. Usually my search gives opposite results which is accessing a remote database with an Android app.
You will have to develop an API backend. The mobile app ( client ) will communicate with the API and do the desired operation based on the response.
It's not possible to directly connect to the app sqlite database. You can send web request and get the info you want, handle it in your app to store it in the sqlite database
You will have to add security measures, so everyone can't access your API.
So far I think it's a security thing that you're not allowed reading/writing to an Android SQLite database.
Apps can read and write to their SQLite databases. Otherwise, the database would not exist.
I want to make a web interface with a textbox where the Android app would connect to and then I can run SQL queries via said interface to read the database or to insert records into it.
You are certainly welcome to embed a Web server into your app. For example, Stetho does this to integrate with Chrome Dev Tools, offering your SQL interface among other things.
However:
Doing this for anything other than a debug build of your app is very risky, as securing a Web server is difficult enough when it is on a traditional server environment, let alone an Android device
The Web server is only accessible by whatever can reach the device via an IP address, which means it's usually only useful on WiFi (where it could be reached by other devices on the same WiFi LAN segment)
I want to connect my android application with a SQL database which is stored in an another computer. I want to use that computer as a server. I think there is a method to connect with that server computer using it's IP address. I use android studio when developing the android application.
Can anyone help me to fix this problem?
I would not recommend you to connect directly to the database from the application, if you plan to publish the app. You open a port to the database server to everyone and store the password to the database in the user device. Anyone who wants to retrieve data from your SQL Server just needs to open the application in a hex editor or decompile it in order to retrieve the password.
Always use an API through a webserver that gets you desired information.
You could use the Firebase Realtime Database to sync specific data, if you do not trust Google then build your own API.
https://firebase.google.com/docs/database/
I am in need of some help here.
I want to make an Android application that eventually syncs to a web server in order to get information (i.e. user can write a note through the website, and it automatically syncs to the phone).
I am aware that I would need some web servers and hosting, and don't know too much about that so I will look into it later.
MY question, however, is how I can simulate this over a local network?
As in, if I create a basic webpage that has a two text boxes (one for name, one for content) and a 'submit' button, if I run it via localhost WHAT methods can I use to get this information to sync to my handset?
If anyone could be kind enough to give me a laymens terms breakdown it would be seriously appreciated, I feel so lost!
You have some alternatives to achieve what you want, here is a traditional one:
Start with installing XAMPP and run a local server
Write your web pages, store the data in mysql
Write PHP code to extract the data from mysql
Use Android HttpClient to call your PHP
There are other alternatives:
Use the same method but instead of PHP write HTML5 and you have a mobile WEB application
Check out the GCM Demo Application
Check out Google App Engine
Check out Amazon Web Services
There are others
Enjoy :)
Yaron
When you use localhost (meaning you install a server package such as Apache / IIS / XAMPP / WAMP in your computer), your machine becomes a server. So, you can access the localhost from any device which is in the same network.
Say you have a computer connected to a WiFi router. If you setup the server i.e. the localhost in that computer and a laptop and a mobile phone is connected to the same WiFi router, the phone and laptop will be able to get service from the computer.
To access data stored in the MySQL server from the other devices (e.g. the phone), you have to write proper service. Else, you can write a mobile web app in the server that accesses the MySQL data and just access it from the device.
I am new in android development. Currently, I facing problem to choose a proper database software that can keep the information of a user registration details for a taxi service mobile apps.
This app require user to login and the details for both the driver and passenger will be kept in the same database. There will be a admin control the system via the web portal for this app. I am not sure whether SQLite will be the suitable database or is there any other suitable database for my project where the database can be accessed by both android phone and the web portal?
Thank you in advance.
IMO you're looking at this the wrong way.
If everything is going to be stored on a server then access data from the phone via a service.
You can keep device-local data using the normal SQLite DB. On the server side I'd probably use something else, like MySql, Postgresql, etc.
so I am writing an android app that will be used at a point of sale in some shops for survey questions. I have a java jsf web app using jpa with a mysql database that I want to sync with, preferably both ways but only a couple of tables. The android app will have only a few tables and will not replicate my server database completely. Unfortunately the android apps will in some places have only intermittent internet access that will drop in and out. I am currently looking at different options to use to store my data on android. I have looked at:
writing my own sync between the database on my server and SQLite on android but there has to be an easier option
storing my data on app engine and syncing with app engine as per the example in the android developers guide however I am not sure how my limited internet connectivity will work
using couchdb but I dont really want to go down this route as I already have the server side set up
does anyone have any ideas?
can I store data locally using android then sync with app engine when I have a connection?
Thanks