How is it answered here, it is possible to use an online database, in your case Mysql, as long as you have a:
Webservice
You must make the request in the bank and return a response to be processed, usually a JSON, which can be sent, for example, with php, as follows:
<?php
echo json_encode($minha_info);
?>
This will return a JSON
for the customer.
Client
It is possible to use the package JSON from Java itself, as in this example and retrieve the information on the client. The following example will use the reading of a twitter feed:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String readTwitterFeed = readTwitterFeed();
try {
JSONArray jsonArray = new JSONArray(readTwitterFeed);
Log.i(ParseJSON.class.getName(), "Number of entries " + jsonArray.length());
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
Log.i(ParseJSON.class.getName(), jsonObject.getString("text"));
}
} catch (Exception e) {
e.printStackTrace();
}
}
public String readTwitterFeed() {
StringBuilder builder = new StringBuilder();
HttpClient client = new DefaultHttpClient();
HttpGet httpGet = new HttpGet("http://twitter.com/statuses/user_timeline/vogella.json"); //Aqui ele pega o json do tutorial, nessa linha que o seu cliente vai declarar o webservice que enviará o json
try {
HttpResponse response = client.execute(httpGet);
StatusLine statusLine = response.getStatusLine();
int statusCode = statusLine.getStatusCode();
if (statusCode == 200) {
HttpEntity entity = response.getEntity();
InputStream content = entity.getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(content));
String line;
while ((line = reader.readLine()) != null) {
builder.append(line);
}
} else {
Log.e(ParseJSON.class.toString(), "Failed to download file");
}
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return builder.toString();
}
Sqlite is what Android uses on the device. Outside the device you use what you want.
– Oralista de Sistemas
Who and why are you voting to close this question? It fits perfectly into the scope of the site.
– André Leria
This question is being discussed at the goal: http://meta.pt.stackoverflow.com/questions/971/comparando-a-experi%C3%Aancia-do-so-com-o-sopt
– Jorge B.
Take great care with external database access directly from Android apps. This leaves a very large security gap between your app and your database. Any kind of access to "external database" (let’s call it that), should be done via Webservices. Take a look at this article http://www.androidpro.com.br/usando-banco-dataos-externo-android/.
– Fillipe Cordeiro