Android databases technology

Search This thread

JohnDeere1334

New member
Mar 11, 2014
1
0
I am app developer and i plan to do application, which uses online database (on server), and i would like to ask, what are the most common used technologies(i mean which SQL databases). Im in touch with MySQL but think it isnt the best solution available. So what is your favourite way to connect your app with database?

//Do you know any good literature with this topic?
 

sak-venom1997

Senior Member
Feb 4, 2013
928
415
Lucknow
I am app developer and i plan to do application, which uses online database (on server), and i would like to ask, what are the most common used technologies(i mean which SQL databases). Im in touch with MySQL but think it isnt the best solution available. So what is your favourite way to connect your app with database?

//Do you know any good literature with this topic?

I think you should use GoogleAppEngine it shall simpify things if you dont plan for BIG DATA

Sent from my GT-S5302 using Tapatalk 2
 
Dec 8, 2013
13
3
It depends on connections

I am app developer and i plan to do application, which uses online database (on server), and i would like to ask, what are the most common used technologies(i mean which SQL databases). Im in touch with MySQL but think it isnt the best solution available. So what is your favourite way to connect your app with database?

//Do you know any good literature with this topic?



Pool of connections are preferable when your app uses many connections . It's already realized in Java and you may easily use it.
 

Jonny

Retired Forum Moderator
Jul 22, 2011
9,293
9,616
http://xdaforums.com/showthread.php?t=2325799

Sent from my GT-S5570 using XDA Premium 4 mobile app

That is an extremely limited guide that means a working internet connection has to be present for the app to work on all launches of the app.

A more efficient way of doing it is to put the JSON output into a local SQLite database, therefore effectively mirroring the online one and then make the app read (and write if needed) information from the local database - if you need changes to be written to the local database you would then need to add a post method that parses the local DB to JSON and sends it to the server for the server to update its version of the DB.

This way takes a little more coding but means that you can use the app offline.

Sent from my HTCSensation using Tapatalk
 

arpitkh96

Senior Member
Feb 17, 2012
1,156
645
27
panipat
That is an extremely limited guide that means a working internet connection has to be present for the app to work on all launches of the app.

A more efficient way of doing it is to put the JSON output into a local SQLite database, therefore effectively mirroring the online one and then make the app read (and write if needed) information from the local database - if you need changes to be written to the local database you would then need to add a post method that parses the local DB to JSON and sends it to the server for the server to update its version of the DB.

This way takes a little more coding but means that you can use the app offline.

Sent from my HTCSensation using Tapatalk

Depends on the op.wouldnt it be better if app simply downloads the database and use it(if he is only reading it).

Sent from my GT-S5570 using XDA Premium 4 mobile app
 

Jonny

Retired Forum Moderator
Jul 22, 2011
9,293
9,616
Depends on the op.wouldnt it be better if app simply downloads the database and use it(if he is only reading it).

Sent from my GT-S5570 using XDA Premium 4 mobile app

If he could be sure his users would have a constant network connection then maybe, however, my method allows for offline viewing and more control over when the app connects to the internet if its tied into a refresh button for example.


Sent from my HTCSensation using Tapatalk
 

arpitkh96

Senior Member
Feb 17, 2012
1,156
645
27
panipat
If he could be sure his users would have a constant network connection then maybe, however, my method allows for offline viewing and more control over when the app connects to the internet if its tied into a refresh button for example.


Sent from my HTCSensation using Tapatalk

Little offtopic
Like if i want to open pdf from a file i use this
Code:
 public void openpdf(File f){
 
                if(f.exists()) {
Uri path =Uri.fromFile(f);
Intent intent =new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path,"application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {startActivity(intent);}
catch (ActivityNotFoundException e) {
    Toast.makeText(MainActivity.this,"No Application Available to View PDF",Toast.LENGTH_SHORT).show();
}}}
What should i use to open archive files(zip,rar) (from intent).i have tried general method of getting Mime type but that didnt worked

Sent from my GT-S5570 using XDA Premium 4 mobile app
 

Jonny

Retired Forum Moderator
Jul 22, 2011
9,293
9,616
Little offtopic
Like if i want to open pdf from a file i use this
Code:
 public void openpdf(File f){
 
                if(f.exists()) {
Uri path =Uri.fromFile(f);
Intent intent =new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path,"application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {startActivity(intent);}
catch (ActivityNotFoundException e) {
    Toast.makeText(MainActivity.this,"No Application Available to View PDF",Toast.LENGTH_SHORT).show();
}}}
What should i use to open archive files(zip,rar) (from intent).i have tried general method of getting Mime type but that didnt worked

Sent from my GT-S5570 using XDA Premium 4 mobile app
if you wanted to open it from within the application you could do something like:
Code:
ZipFile z = new ZipFile("/mtn/sdcard/download/teste.zip");

But if you wanted the intent to launch into a different app to handle the zip (eg Archidroid etc) then have you tried something like:
Code:
File file = new File("mnt/sdcard/download/test.zip");
            Intent i = new Intent();
            i.setAction(android.content.Intent.ACTION_VIEW);
            i.setDataAndType(Uri.fromFile(file), "application/zip");
            try {
                   startActivity(i);
            } catch (ActivityNotFoundException e) {
                  Toast.makeText(MainActivity.this,"No Application Available to View Zip files",Toast.LENGTH_SHORT).show();
            }
 
  • Like
Reactions: arpitkh96

arpitkh96

Senior Member
Feb 17, 2012
1,156
645
27
panipat
if you wanted to open it from within the application you could do something like:
Code:
ZipFile z = new ZipFile("/mtn/sdcard/download/teste.zip");

But if you wanted the intent to launch into a different app to handle the zip (eg Archidroid etc) then have you tried something like:
Code:
File file = new File("mnt/sdcard/download/test.zip");
            Intent i = new Intent();
            i.setAction(android.content.Intent.ACTION_VIEW);
            i.setDataAndType(Uri.fromFile(file), "application/zip");
            try {
                   startActivity(i);
            } catch (ActivityNotFoundException e) {
                  Toast.makeText(MainActivity.this,"No Application Available to View Zip files",Toast.LENGTH_SHORT).show();
            }

Thanks.
One more.l am asking about the method i suggested of downloading the database for readonly purpose.where should i upload the database so that server could handle multiple downloads etc.

Sent from my GT-S5570 using XDA Premium 4 mobile app
 

Jonny

Retired Forum Moderator
Jul 22, 2011
9,293
9,616
Thanks.
One more.l am asking about the method i suggested of downloading the database for readonly purpose.where should i upload the database so that server could handle multiple downloads etc.

Sent from my GT-S5570 using XDA Premium 4 mobile app

I'd have thought just having the database on the server and using the php script to output a JSON response then put the JSON response into a local SQLite database would do that.... I'm not entirely sure what you're asking though :confused:
 

arpitkh96

Senior Member
Feb 17, 2012
1,156
645
27
panipat
I'd have thought just having the database on the server and using the php script to output a JSON response then put the JSON response into a local SQLite database would do that.... I'm not entirely sure what you're asking though :confused:

Have you ever used Dictionary.com app.it has an option for offline mode in which it downloads the whole database into the internal memory to use it any time.i want to do that.I am asking where should i upload that database(server,website etc) so that i could download that easily in myapp

Sent from my GT-S5570 using XDA Premium 4 mobile app
 

Jonny

Retired Forum Moderator
Jul 22, 2011
9,293
9,616
Have you ever used Dictionary.com app.it has an option for offline mode in which it downloads the whole database into the internal memory to use it any time.i want to do that.I am asking where should i upload that database(server,website etc) so that i could download that easily in myapp

Sent from my GT-S5570 using XDA Premium 4 mobile app

Ah right I get it, you would need a server with sql support - or at least a hosting package that allows you to add your own database, then just use phpMyAdmin/MySQL to create the database.
 

arpitkh96

Senior Member
Feb 17, 2012
1,156
645
27
panipat
Ah right I get it, you would need a server with sql support - or at least a hosting package that allows you to add your own database, then just use phpMyAdmin/MySQL to create the database.

Thats ok.but which server or website can do this.

Sent from my GT-S5570 using XDA Premium 4 mobile app
 

Jonny

Retired Forum Moderator
Jul 22, 2011
9,293
9,616
Thats ok.but which server or website can do this.

Sent from my GT-S5570 using XDA Premium 4 mobile app

2 services I'm currently using are http://www.unlimitedwebhosting.co.uk/ & http://x10premium.com/ - you're probably ok with the low cost options that offer "unlimited" stuff (subject to interpretation and fair use etc) because the overhead on MySQL is not a lot so you probably won't use much bandwidth.

As a general guide pretty much anyone who offers cpanel or similar control software will have MySQL enabled - though be sure to check because hosts have been known to disable MySQL in cpanel before.
 
  • Like
Reactions: arpitkh96

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Little offtopic
    Like if i want to open pdf from a file i use this
    Code:
     public void openpdf(File f){
     
                    if(f.exists()) {
    Uri path =Uri.fromFile(f);
    Intent intent =new Intent(Intent.ACTION_VIEW);
    intent.setDataAndType(path,"application/pdf");
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    try {startActivity(intent);}
    catch (ActivityNotFoundException e) {
        Toast.makeText(MainActivity.this,"No Application Available to View PDF",Toast.LENGTH_SHORT).show();
    }}}
    What should i use to open archive files(zip,rar) (from intent).i have tried general method of getting Mime type but that didnt worked

    Sent from my GT-S5570 using XDA Premium 4 mobile app
    if you wanted to open it from within the application you could do something like:
    Code:
    ZipFile z = new ZipFile("/mtn/sdcard/download/teste.zip");

    But if you wanted the intent to launch into a different app to handle the zip (eg Archidroid etc) then have you tried something like:
    Code:
    File file = new File("mnt/sdcard/download/test.zip");
                Intent i = new Intent();
                i.setAction(android.content.Intent.ACTION_VIEW);
                i.setDataAndType(Uri.fromFile(file), "application/zip");
                try {
                       startActivity(i);
                } catch (ActivityNotFoundException e) {
                      Toast.makeText(MainActivity.this,"No Application Available to View Zip files",Toast.LENGTH_SHORT).show();
                }
    1
    Thats ok.but which server or website can do this.

    Sent from my GT-S5570 using XDA Premium 4 mobile app

    2 services I'm currently using are http://www.unlimitedwebhosting.co.uk/ & http://x10premium.com/ - you're probably ok with the low cost options that offer "unlimited" stuff (subject to interpretation and fair use etc) because the overhead on MySQL is not a lot so you probably won't use much bandwidth.

    As a general guide pretty much anyone who offers cpanel or similar control software will have MySQL enabled - though be sure to check because hosts have been known to disable MySQL in cpanel before.