Android Tutorial Connect Android to MySQL Database Tutorial

Status
Not open for further replies.
A new more powerful framework is now available: jRDC2.

This tutorial explains the basic concepts required for creating a connection between Android device and a remote server. In this case it is a MySQL database.
A tutorial for connecting to SQL Server is available here.

Android cannot connect directly to the database server (search for JdbcSQL). Therefore we need to create a simple web service that will pass the requests to the database and will return the response.

For this example I've created a new database that lists the countries population. The data was derived from a UN database.

The database includes a single table named "countries" with three columns:
mysql_1.png

PHP Script

The web service is made of a single PHP script running on the same server.
You have several options for the web service implementation. You can create several prepared statements which will be filled with parameters passed in the request.
Or you can take the complete query from the request and pass it to the database server.
There are high security risks with issuing queries received from an unknown user. If your service is public then you will probably want to choose the first option.
You should also make sure to correctly escape the parameters. See this php method: PHP: mysql_real_escape_string - Manual

In our example I've chosen the second option which takes the query and passes it to the database directly.
I've restricted the database user to SELECT queries (in MySQL configuration).

The PHP code:
PHP:
<?php

$databasehost = "localhost";
$databasename = "xxxx";
$databaseusername ="xxxx";
$databasepassword = "xxxx";

$con = mysqli_connect($databasehost,$databaseusername,$databasepassword, $databasename) or die(mysqli_error($con));
mysqli_set_charset ($con , "utf8");
$query = file_get_contents("php://input");
$sth = mysqli_query($con, $query);

if (mysqli_errno($con)) {
   header("HTTP/1.1 500 Internal Server Error");
   echo $query.'\n';
   echo mysqli_error($con);
}
else
{
   $rows = array();
   while($r = mysqli_fetch_assoc($sth)) {
     $rows[] = $r;
   }
   $res = json_encode($rows);
    echo $res;
    mysqli_free_result($sth);
}
mysqli_close($con);
?>
The script takes the query from the POST data and submits it to the database.
The result is then written in JSON format.

B4A code

Our application displays a list of countries. When the user presses on a country, its population is retrieved from the database and displayed.

upload_2016-8-3_13-4-25.png



The code sends the query and then when the result arrives the JSON is parsed and displayed.
Note that in this case the JSON object is made of an array of one or more maps.

Edit: Code updated to use OkHttpUtils2.
 

Attachments

  • MySQL.zip
    8 KB · Views: 17,494
Last edited:

JUAN CARLOSORDOÑEZ

Member
Licensed User
Longtime User
Please help me on this: The server (192.168.1.103) answers:

LogCat connected to: B4A-Bridge: Sony C5302-355810056046306
--------- Beginning of / dev / log / main
Service ** (service1) Create **
Service ** (service1) Start **
Connected to B4A-Bridge (Wifi)
Streams_terminated
Connected to B4A-Bridge (Wifi)
Installing file.
Activity ** (main) Pause, UserClosed = false **
PackageAdded: package: anywheresoftware.b4a.samples.mysql
Activity ** (main) Create, isFirst = true **
Activity ** (main) Resume **
Service ** (httputils2service) Create **
Service ** (httputils2service) Start **
Log Message longer than limit (4000). Message was truncated.
Response from server: <br />
<font size = "1"> <table class = 'Error xdebug-xe-deprecated' dir = 'ltr' border = "1" cellspacing = "0" cellpadding = "1">
<tr> <th align = 'left' bgcolor = '# f57900' colspan = "5"> <span style = 'background-color: # cc0000; color: # fce94f; font-size: (!) x-large '> </ span> Deprecated: mysql_connect (): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C: \ wamp \ www \ dialer .PHP on line <i> 6 </ i> </ th> </ tr>
<tr> <th align = 'left' bgcolor = '# e9b96e' colspan = "5 '> Call Stack </ th> </ tr>
<tr> <th align = "center" bgcolor = '# eeeeec'> # </ th> <th align = 'left' bgcolor = '# eeeeec'> Time </ th> <th align = 'left' bgcolor = '#eeeeec'> Memory </ th> <th align = 'left' bgcolor = '# eeeeec'> Function </ th> <th align = 'left' bgcolor = '# eeeeec'> Location </ th> </ tr>
<tr> <td bgcolor = '# eeeeec' align = 'center'> 1 </ td> <td bgcolor = '# eeeeec' align = 'center'> 0.0005 </ td> <td bgcolor = '# eeeeec' align = "right"> 241944 </ td> <td bgcolor = '# eeeeec'> {main} () </ td> <td title = 'C: \ wamp \ www \ dialer.PHP' bgcolor = '# eeeeec' > .. \ dialer.PHP <b>: </ b> 0 </ td> </ tr>
<tr> <td bgcolor = '# eeeeec' align = 'center'> 2 </ td> <td bgcolor = '# eeeeec' align = 'center'> 0.0005 </ td> <td bgcolor = '# eeeeec' align = "right"> 242712 </ td> <td bgcolor = '# eeeeec'> <a href='http://www.php.net/function.mysql-connect' target='_new'> mysql_connect </ a >
() </ Td> <td title = 'C: \ wamp \ www \ dialer.PHP' bgcolor = '# eeeeec'> .. \ dialer.PHP <b>: </ b> 6 </ td> </ tr>
</ table> </ font>
[{"Description": "AMERICAN BREAKFAST (Z)", "CODE": "000001"}, {"Description": "BREAKFAST WITH HARD MEAT (Z)", "CODE": "000002"}, {"DESCRIPTION ":" BREAKFAST PAN (Z) "," CODE ":" 000003 "}, {" Description ":" CONTINENTAL BREAKFAST (Z) "," CODE ":" 000004 "}, {" Description ":" EGGS SCRAMBLED WITH PAPA (Z) "," CODE ":" 000005 "}, {" Description ":" PANCAKES (Z) "," CODE ":" 000006 "}, {" Description ":" PAN + COFFEE (Z) "" CODE ":" 000007 "}, {" Description ":" HASH BROWNS - PAPA FR (Z) "," CODE. ":" 000008 "}, {" Description ":" HAMB 1 \ / 3 SINGLE (Z) "," CODE ":" 000009 "}, {" Description ":" WAFFLES "," CODE ":" 000010 "}, {" Description ":" SERVING FRUIT (Z) "," CODE ":" 000011 "}, {" Description ":" CHOCOLATE "," CODE ":" 000012 "}, {" Description ":" CAF ?, TE, (Z) "," CODE ":" 000013 "}, {" DESCRIPTION ""CHOCOLATE BREAD", "CODE": "000014"}, {"Description": "CAPPUCCINO (Z)", "CODE": "000015"}, {"Description": "CHOCOLATE BREAD AND CHEESE" "CODE": "000016"}, {"Description": "EGGS RANCHEROS Z", "CODE": "000017"}, {"Description": "NUT PIE", "CODE": "000018"}, {"Description": "BIG BREAST FINGERS", "CODE": "000019"}, {"Description": "BREAST SMALL FINGERS", "CODE": "000020"}, {"Description": "RIB SOUP RAS (Z ) "," CODE ":" 000021 "}, {" Description ":" HAMB.-CHICKEN 1 \ / 4-PAPA "," CODE ":" 000022 "}, {" Description ":" HAMB.MR-CHICKEN 1 \ / 3 PAPA "," CODE ":" 000023 "}, {" Description ":" PAPA JUMBO (Z) "," CODE ":" 000024 "}, {" Description ":" PAPA P \ / CARRIED (Z) "," CODE ":" 000025 "}, {" Description ":" HOT DOG (Z) "," CODE ":" 000026 "}, {" Description ":" omelette Z "," CODE ":" 000027 "}, {" Description ":" salchipapa BIG (Z) "," CODE ":" 000028 "}, {" Description ":" salchipapa SMALL A (Z) "," CODE? ":" 000029 "}, {"Description": "POTATO CHIPS PAQ.", "CODE": "000030"}, {"Description": "RED - HERBS (Z)", "CODE": "000031"}, {"Description": "MORA SHAKE BANANA (Z) "," CODE ":" 000032 "}, {" Description ":" STRAWBERRY SHAKE (Z) "," CODE ":" 000033 "}, {" Description ":" STRAWBERRY BANANA SMOOTHIE (Z) "," CODE ":" 000034 "}, {" Description ":" BURGER COMBO 1 \ / 3 CP (Z) "," CODE ":" 000035 "}, {" Description ":" CARROT JUICE (Z) "," CODE ":" 000036 "}, {" Description ":" TANGERINE JUICE (Z) "," CODE ":" 000037 "}, {" Description ":" ICE BAG SMALL (Z) ""CODE": "000038"}, {"Description": "BOTTLED WATER (Z)", "CODE": "000039"}, {"DESCRIPTION", "BANANA SPLIT (Z)", "CODE": "000041 "}, {" Description ":" BIG BAG OF ICE (Z) "," CODE ":" 000042 "}, {" Description ":" SOFT ICE CREAM CUP (Z) "," CODE ":" 000044 "} , {"Description": "SOFT WAFFLE CONE (Z)", "CODE": "000046"}, {"Description": "ICE CREAM (Z)", "CODE": "000047"}, {"DESCRIPTION "" MISTER S BANANA (Z) "," CODE? ":" 000048 "}, {" Description ":" PEACH SPLIT (Z) "," CODE ":" 000049 "}, {" Description ":" GAS SMALL A (Z) "," CODE? ":" 000050 "}, {" Description ":" GC 350
Log Message longer than limit (4000). Message was truncated.
Error occurred on line: 60 (main)
java.lang.RuntimeException: JSON Array expected.
at anywheresoftware.b4a.objects.collections.JSONParser.NextArray (JSONParser.java: 62)
at anywheresoftware.b4a.samples.mysql.main._jobdone (Main.java: 444)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
at anywheresoftware.b4a.shell.Shell.runMethod (Shell.java: 636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl (Shell.java: 305)
at anywheresoftware.b4a.shell.Shell.raiseEvent (Shell.java: 238)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
at anywheresoftware.b4a.ShellBA.raiseEvent2 (ShellBA.java: 121)
anywheresoftware.b4a.BA at $ 3.run (BA.java: 320)
at android.os.Handler.handleCallback (Handler.java: 730)
at android.os.Handler.dispatchMessage (Handler.java: 92)
at android.os.Looper.loop (Looper.java: 213)
at android.app.ActivityThread.main (ActivityThread.java: 5225)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
com.android.internal.os.ZygoteInit at $ MethodAndArgsCaller.run (ZygoteInit.java: 741)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 557)
at dalvik.system.NativeStart.main (Native Method)
Activity ** (main) Pause, UserClosed = true **
Activity ** (main) Resume **
Activity ** (main) Pause, UserClosed = false **
libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
sending message to waiting queue (CallSubDelayed - UpdateStatus)
running messages waiting (1)
Activity ** (main) Resume **
Service ** (service1) Destroy **
Service ** (service1) Create **
Service ** (service1) Start **
Service ** (service1) Destroy **
Activity ** (main) Pause, UserClosed = false **
Activity ** (main) Resume **
Activity ** (main) Pause, UserClosed = true **
Activity ** (main) Create, isFirst = true **
Activity ** (main) Resume **
Service ** (service1) Create **
Service ** (service1) Start **
Connected to B4A-Bridge (Wifi)
Installing file.
Activity ** (main) Pause, UserClosed = false **
PackageAdded: package: anywheresoftware.b4a.samples.mysql


Please help me on this: The server (192.168.1.103) answers:

LogCat connected to: B4A-Bridge: Sony C5302-355810056046306
--------- Beginning of / dev / log / main
Service ** (service1) Create **
Service ** (service1) Start **
Connected to B4A-Bridge (Wifi)
Streams_terminated
Connected to B4A-Bridge (Wifi)
Installing file.
Activity ** (main) Pause, UserClosed = false **
PackageAdded: package: anywheresoftware.b4a.samples.mysql
Activity ** (main) Create, isFirst = true **
Activity ** (main) Resume **
Service ** (httputils2service) Create **
Service ** (httputils2service) Start **
Log Message longer than limit (4000). Message was truncated.
Response from server: <br />
<font size = "1"> <table class = 'Error xdebug-xe-deprecated' dir = 'ltr' border = "1" cellspacing = "0" cellpadding = "1">
<tr> <th align = 'left' bgcolor = '# f57900' colspan = "5"> <span style = 'background-color: # cc0000; color: # fce94f; font-size: (!) x-large '> </ span> Deprecated: mysql_connect (): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C: \ wamp \ www \ dialer .PHP on line <i> 6 </ i> </ th> </ tr>
<tr> <th align = 'left' bgcolor = '# e9b96e' colspan = "5 '> Call Stack </ th> </ tr>
<tr> <th align = "center" bgcolor = '# eeeeec'> # </ th> <th align = 'left' bgcolor = '# eeeeec'> Time </ th> <th align = 'left' bgcolor = '#eeeeec'> Memory </ th> <th align = 'left' bgcolor = '# eeeeec'> Function </ th> <th align = 'left' bgcolor = '# eeeeec'> Location </ th> </ tr>
<tr> <td bgcolor = '# eeeeec' align = 'center'> 1 </ td> <td bgcolor = '# eeeeec' align = 'center'> 0.0005 </ td> <td bgcolor = '# eeeeec' align = "right"> 241944 </ td> <td bgcolor = '# eeeeec'> {main} () </ td> <td title = 'C: \ wamp \ www \ dialer.PHP' bgcolor = '# eeeeec' > .. \ dialer.PHP <b>: </ b> 0 </ td> </ tr>
<tr> <td bgcolor = '# eeeeec' align = 'center'> 2 </ td> <td bgcolor = '# eeeeec' align = 'center'> 0.0005 </ td> <td bgcolor = '# eeeeec' align = "right"> 242712 </ td> <td bgcolor = '# eeeeec'> <a href='http://www.php.net/function.mysql-connect' target='_new'> mysql_connect </ a >
() </ Td> <td title = 'C: \ wamp \ www \ dialer.PHP' bgcolor = '# eeeeec'> .. \ dialer.PHP <b>: </ b> 6 </ td> </ tr>
</ table> </ font>
[{"Description": "AMERICAN BREAKFAST (Z)", "CODE": "000001"}, {"Description": "BREAKFAST WITH HARD MEAT (Z)", "CODE": "000002"}, {"DESCRIPTION ":" BREAKFAST PAN (Z) "," CODE ":" 000003 "}, {" Description ":" CONTINENTAL BREAKFAST (Z) "," CODE ":" 000004 "}, {" Description ":" EGGS SCRAMBLED WITH PAPA (Z) "," CODE ":" 000005 "}, {" Description ":" PANCAKES (Z) "," CODE ":" 000006 "}, {" Description ":" PAN + COFFEE (Z) "" CODE ":" 000007 "}, {" Description ":" HASH BROWNS - PAPA FR (Z) "," CODE. ":" 000008 "}, {" Description ":" HAMB 1 \ / 3 SINGLE (Z) "," CODE ":" 000009 "}, {" Description ":" WAFFLES "," CODE ":" 000010 "}, {" Description ":" SERVING FRUIT (Z) "," CODE ":" 000011 "}, {" Description ":" CHOCOLATE "," CODE ":" 000012 "}, {" Description ":" CAF ?, TE, (Z) "," CODE ":" 000013 "}, {" DESCRIPTION ""CHOCOLATE BREAD", "CODE": "000014"}, {"Description": "CAPPUCCINO (Z)", "CODE": "000015"}, {"Description": "CHOCOLATE BREAD AND CHEESE" "CODE": "000016"}, {"Description": "EGGS RANCHEROS Z", "CODE": "000017"}, {"Description": "NUT PIE", "CODE": "000018"}, {"Description": "BIG BREAST FINGERS", "CODE": "000019"}, {"Description": "BREAST SMALL FINGERS", "CODE": "000020"}, {"Description": "RIB SOUP RAS (Z ) "," CODE ":" 000021 "}, {" Description ":" HAMB.-CHICKEN 1 \ / 4-PAPA "," CODE ":" 000022 "}, {" Description ":" HAMB.MR-CHICKEN 1 \ / 3 PAPA "," CODE ":" 000023 "}, {" Description ":" PAPA JUMBO (Z) "," CODE ":" 000024 "}, {" Description ":" PAPA P \ / CARRIED (Z) "," CODE ":" 000025 "}, {" Description ":" HOT DOG (Z) "," CODE ":" 000026 "}, {" Description ":" omelette Z "," CODE ":" 000027 "}, {" Description ":" salchipapa BIG (Z) "," CODE ":" 000028 "}, {" Description ":" salchipapa SMALL A (Z) "," CODE? ":" 000029 "}, {"Description": "POTATO CHIPS PAQ.", "CODE": "000030"}, {"Description": "RED - HERBS (Z)", "CODE": "000031"}, {"Description": "MORA SHAKE BANANA (Z) "," CODE ":" 000032 "}, {" Description ":" STRAWBERRY SHAKE (Z) "," CODE ":" 000033 "}, {" Description ":" STRAWBERRY BANANA SMOOTHIE (Z) "," CODE ":" 000034 "}, {" Description ":" BURGER COMBO 1 \ / 3 CP (Z) "," CODE ":" 000035 "}, {" Description ":" CARROT JUICE (Z) "," CODE ":" 000036 "}, {" Description ":" TANGERINE JUICE (Z) "," CODE ":" 000037 "}, {" Description ":" ICE BAG SMALL (Z) ""CODE": "000038"}, {"Description": "BOTTLED WATER (Z)", "CODE": "000039"}, {"DESCRIPTION", "BANANA SPLIT (Z)", "CODE": "000041 "}, {" Description ":" BIG BAG OF ICE (Z) "," CODE ":" 000042 "}, {" Description ":" SOFT ICE CREAM CUP (Z) "," CODE ":" 000044 "} , {"Description": "SOFT WAFFLE CONE (Z)", "CODE": "000046"}, {"Description": "ICE CREAM (Z)", "CODE": "000047"}, {"DESCRIPTION "" MISTER S BANANA (Z) "," CODE? ":" 000048 "}, {" Description ":" PEACH SPLIT (Z) "," CODE ":" 000049 "}, {" Description ":" GAS SMALL A (Z) "," CODE? ":" 000050 "}, {" Description ":" GC 350
Log Message longer than limit (4000). Message was truncated.
Error occurred on line: 60 (main)
java.lang.RuntimeException: JSON Array expected.
at anywheresoftware.b4a.objects.collections.JSONParser.NextArray (JSONParser.java: 62)
at anywheresoftware.b4a.samples.mysql.main._jobdone (Main.java: 444)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
at anywheresoftware.b4a.shell.Shell.runMethod (Shell.java: 636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl (Shell.java: 305)
at anywheresoftware.b4a.shell.Shell.raiseEvent (Shell.java: 238)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
at anywheresoftware.b4a.ShellBA.raiseEvent2 (ShellBA.java: 121)
anywheresoftware.b4a.BA at $ 3.run (BA.java: 320)
at android.os.Handler.handleCallback (Handler.java: 730)
at android.os.Handler.dispatchMessage (Handler.java: 92)
at android.os.Looper.loop (Looper.java: 213)
at android.app.ActivityThread.main (ActivityThread.java: 5225)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
com.android.internal.os.ZygoteInit at $ MethodAndArgsCaller.run (ZygoteInit.java: 741)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 557)
at dalvik.system.NativeStart.main (Native Method)
Activity ** (main) Pause, UserClosed = true **
Activity ** (main) Resume **
Activity ** (main) Pause, UserClosed = false **
libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
sending message to waiting queue (CallSubDelayed - UpdateStatus)
running messages waiting (1)
Activity ** (main) Resume **
Service ** (service1) Destroy **
Service ** (service1) Create **
Service ** (service1) Start **
Service ** (service1) Destroy **
Activity ** (main) Pause, UserClosed = false **
Activity ** (main) Resume **
Activity ** (main) Pause, UserClosed = true **
Activity ** (main) Create, isFirst = true **
Activity ** (main) Resume **
Service ** (service1) Create **
Service ** (service1) Start **
Connected to B4A-Bridge (Wifi)
Installing file.
Activity ** (main) Pause, UserClosed = false **
PackageAdded: package: anywheresoftware.b4a.samples.mysql



AND LEAVE THE APP

ARE 700 RECORDS. SO WILL THE ERROR?

THANK YOU VERY MUCH
 

JUAN CARLOSORDOÑEZ

Member
Licensed User
Longtime User
Please help me on this: The server (192.168.1.103) answers:

LogCat connected to: B4A-Bridge: Sony C5302-355810056046306
--------- Beginning of / dev / log / main
Service ** (service1) Create **
Service ** (service1) Start **
Connected to B4A-Bridge (Wifi)
Streams_terminated
Connected to B4A-Bridge (Wifi)
Installing file.
Activity ** (main) Pause, UserClosed = false **
PackageAdded: package: anywheresoftware.b4a.samples.mysql
Activity ** (main) Create, isFirst = true **
Activity ** (main) Resume **
Service ** (httputils2service) Create **
Service ** (httputils2service) Start **
Log Message longer than limit (4000). Message was truncated.
Response from server: <br />
<font size = "1"> <table class = 'Error xdebug-xe-deprecated' dir = 'ltr' border = "1" cellspacing = "0" cellpadding = "1">
<tr> <th align = 'left' bgcolor = '# f57900' colspan = "5"> <span style = 'background-color: # cc0000; color: # fce94f; font-size: (!) x-large '> </ span> Deprecated: mysql_connect (): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C: \ wamp \ www \ dialer .PHP on line <i> 6 </ i> </ th> </ tr>
<tr> <th align = 'left' bgcolor = '# e9b96e' colspan = "5 '> Call Stack </ th> </ tr>
<tr> <th align = "center" bgcolor = '# eeeeec'> # </ th> <th align = 'left' bgcolor = '# eeeeec'> Time </ th> <th align = 'left' bgcolor = '#eeeeec'> Memory </ th> <th align = 'left' bgcolor = '# eeeeec'> Function </ th> <th align = 'left' bgcolor = '# eeeeec'> Location </ th> </ tr>
<tr> <td bgcolor = '# eeeeec' align = 'center'> 1 </ td> <td bgcolor = '# eeeeec' align = 'center'> 0.0005 </ td> <td bgcolor = '# eeeeec' align = "right"> 241944 </ td> <td bgcolor = '# eeeeec'> {main} () </ td> <td title = 'C: \ wamp \ www \ dialer.PHP' bgcolor = '# eeeeec' > .. \ dialer.PHP <b>: </ b> 0 </ td> </ tr>
<tr> <td bgcolor = '# eeeeec' align = 'center'> 2 </ td> <td bgcolor = '# eeeeec' align = 'center'> 0.0005 </ td> <td bgcolor = '# eeeeec' align = "right"> 242712 </ td> <td bgcolor = '# eeeeec'> <a href='http://www.php.net/function.mysql-connect' target='_new'> mysql_connect </ a >
() </ Td> <td title = 'C: \ wamp \ www \ dialer.PHP' bgcolor = '# eeeeec'> .. \ dialer.PHP <b>: </ b> 6 </ td> </ tr>
</ table> </ font>
[{"Description": "AMERICAN BREAKFAST (Z)", "CODE": "000001"}, {"Description": "BREAKFAST WITH HARD MEAT (Z)", "CODE": "000002"}, {"DESCRIPTION ":" BREAKFAST PAN (Z) "," CODE ":" 000003 "}, {" Description ":" CONTINENTAL BREAKFAST (Z) "," CODE ":" 000004 "}, {" Description ":" EGGS SCRAMBLED WITH PAPA (Z) "," CODE ":" 000005 "}, {" Description ":" PANCAKES (Z) "," CODE ":" 000006 "}, {" Description ":" PAN + COFFEE (Z) "" CODE ":" 000007 "}, {" Description ":" HASH BROWNS - PAPA FR (Z) "," CODE. ":" 000008 "}, {" Description ":" HAMB 1 \ / 3 SINGLE (Z) "," CODE ":" 000009 "}, {" Description ":" WAFFLES "," CODE ":" 000010 "}, {" Description ":" SERVING FRUIT (Z) "," CODE ":" 000011 "}, {" Description ":" CHOCOLATE "," CODE ":" 000012 "}, {" Description ":" CAF ?, TE, (Z) "," CODE ":" 000013 "}, {" DESCRIPTION ""CHOCOLATE BREAD", "CODE": "000014"}, {"Description": "CAPPUCCINO (Z)", "CODE": "000015"}, {"Description": "CHOCOLATE BREAD AND CHEESE" "CODE": "000016"}, {"Description": "EGGS RANCHEROS Z", "CODE": "000017"}, {"Description": "NUT PIE", "CODE": "000018"}, {"Description": "BIG BREAST FINGERS", "CODE": "000019"}, {"Description": "BREAST SMALL FINGERS", "CODE": "000020"}, {"Description": "RIB SOUP RAS (Z ) "," CODE ":" 000021 "}, {" Description ":" HAMB.-CHICKEN 1 \ / 4-PAPA "," CODE ":" 000022 "}, {" Description ":" HAMB.MR-CHICKEN 1 \ / 3 PAPA "," CODE ":" 000023 "}, {" Description ":" PAPA JUMBO (Z) "," CODE ":" 000024 "}, {" Description ":" PAPA P \ / CARRIED (Z) "," CODE ":" 000025 "}, {" Description ":" HOT DOG (Z) "," CODE ":" 000026 "}, {" Description ":" omelette Z "," CODE ":" 000027 "}, {" Description ":" salchipapa BIG (Z) "," CODE ":" 000028 "}, {" Description ":" salchipapa SMALL A (Z) "," CODE? ":" 000029 "}, {"Description": "POTATO CHIPS PAQ.", "CODE": "000030"}, {"Description": "RED - HERBS (Z)", "CODE": "000031"}, {"Description": "MORA SHAKE BANANA (Z) "," CODE ":" 000032 "}, {" Description ":" STRAWBERRY SHAKE (Z) "," CODE ":" 000033 "}, {" Description ":" STRAWBERRY BANANA SMOOTHIE (Z) "," CODE ":" 000034 "}, {" Description ":" BURGER COMBO 1 \ / 3 CP (Z) "," CODE ":" 000035 "}, {" Description ":" CARROT JUICE (Z) "," CODE ":" 000036 "}, {" Description ":" TANGERINE JUICE (Z) "," CODE ":" 000037 "}, {" Description ":" ICE BAG SMALL (Z) ""CODE": "000038"}, {"Description": "BOTTLED WATER (Z)", "CODE": "000039"}, {"DESCRIPTION", "BANANA SPLIT (Z)", "CODE": "000041 "}, {" Description ":" BIG BAG OF ICE (Z) "," CODE ":" 000042 "}, {" Description ":" SOFT ICE CREAM CUP (Z) "," CODE ":" 000044 "} , {"Description": "SOFT WAFFLE CONE (Z)", "CODE": "000046"}, {"Description": "ICE CREAM (Z)", "CODE": "000047"}, {"DESCRIPTION "" MISTER S BANANA (Z) "," CODE? ":" 000048 "}, {" Description ":" PEACH SPLIT (Z) "," CODE ":" 000049 "}, {" Description ":" GAS SMALL A (Z) "," CODE? ":" 000050 "}, {" Description ":" GC 350
Log Message longer than limit (4000). Message was truncated.
Error occurred on line: 60 (main)
java.lang.RuntimeException: JSON Array expected.
at anywheresoftware.b4a.objects.collections.JSONParser.NextArray (JSONParser.java: 62)
at anywheresoftware.b4a.samples.mysql.main._jobdone (Main.java: 444)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
at anywheresoftware.b4a.shell.Shell.runMethod (Shell.java: 636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl (Shell.java: 305)
at anywheresoftware.b4a.shell.Shell.raiseEvent (Shell.java: 238)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
at anywheresoftware.b4a.ShellBA.raiseEvent2 (ShellBA.java: 121)
anywheresoftware.b4a.BA at $ 3.run (BA.java: 320)
at android.os.Handler.handleCallback (Handler.java: 730)
at android.os.Handler.dispatchMessage (Handler.java: 92)
at android.os.Looper.loop (Looper.java: 213)
at android.app.ActivityThread.main (ActivityThread.java: 5225)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
com.android.internal.os.ZygoteInit at $ MethodAndArgsCaller.run (ZygoteInit.java: 741)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 557)
at dalvik.system.NativeStart.main (Native Method)
Activity ** (main) Pause, UserClosed = true **
Activity ** (main) Resume **
Activity ** (main) Pause, UserClosed = false **
libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
sending message to waiting queue (CallSubDelayed - UpdateStatus)
running messages waiting (1)
Activity ** (main) Resume **
Service ** (service1) Destroy **
Service ** (service1) Create **
Service ** (service1) Start **
Service ** (service1) Destroy **
Activity ** (main) Pause, UserClosed = false **
Activity ** (main) Resume **
Activity ** (main) Pause, UserClosed = true **
Activity ** (main) Create, isFirst = true **
Activity ** (main) Resume **
Service ** (service1) Create **
Service ** (service1) Start **
Connected to B4A-Bridge (Wifi)
Installing file.
Activity ** (main) Pause, UserClosed = false **
PackageAdded: package: anywheresoftware.b4a.samples.mysql


Please help me on this: The server (192.168.1.103) answers:

LogCat connected to: B4A-Bridge: Sony C5302-355810056046306
--------- Beginning of / dev / log / main
Service ** (service1) Create **
Service ** (service1) Start **
Connected to B4A-Bridge (Wifi)
Streams_terminated
Connected to B4A-Bridge (Wifi)
Installing file.
Activity ** (main) Pause, UserClosed = false **
PackageAdded: package: anywheresoftware.b4a.samples.mysql
Activity ** (main) Create, isFirst = true **
Activity ** (main) Resume **
Service ** (httputils2service) Create **
Service ** (httputils2service) Start **
Log Message longer than limit (4000). Message was truncated.
Response from server: <br />
<font size = "1"> <table class = 'Error xdebug-xe-deprecated' dir = 'ltr' border = "1" cellspacing = "0" cellpadding = "1">
<tr> <th align = 'left' bgcolor = '# f57900' colspan = "5"> <span style = 'background-color: # cc0000; color: # fce94f; font-size: (!) x-large '> </ span> Deprecated: mysql_connect (): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C: \ wamp \ www \ dialer .PHP on line <i> 6 </ i> </ th> </ tr>
<tr> <th align = 'left' bgcolor = '# e9b96e' colspan = "5 '> Call Stack </ th> </ tr>
<tr> <th align = "center" bgcolor = '# eeeeec'> # </ th> <th align = 'left' bgcolor = '# eeeeec'> Time </ th> <th align = 'left' bgcolor = '#eeeeec'> Memory </ th> <th align = 'left' bgcolor = '# eeeeec'> Function </ th> <th align = 'left' bgcolor = '# eeeeec'> Location </ th> </ tr>
<tr> <td bgcolor = '# eeeeec' align = 'center'> 1 </ td> <td bgcolor = '# eeeeec' align = 'center'> 0.0005 </ td> <td bgcolor = '# eeeeec' align = "right"> 241944 </ td> <td bgcolor = '# eeeeec'> {main} () </ td> <td title = 'C: \ wamp \ www \ dialer.PHP' bgcolor = '# eeeeec' > .. \ dialer.PHP <b>: </ b> 0 </ td> </ tr>
<tr> <td bgcolor = '# eeeeec' align = 'center'> 2 </ td> <td bgcolor = '# eeeeec' align = 'center'> 0.0005 </ td> <td bgcolor = '# eeeeec' align = "right"> 242712 </ td> <td bgcolor = '# eeeeec'> <a href='http://www.php.net/function.mysql-connect' target='_new'> mysql_connect </ a >
() </ Td> <td title = 'C: \ wamp \ www \ dialer.PHP' bgcolor = '# eeeeec'> .. \ dialer.PHP <b>: </ b> 6 </ td> </ tr>
</ table> </ font>
[{"Description": "AMERICAN BREAKFAST (Z)", "CODE": "000001"}, {"Description": "BREAKFAST WITH HARD MEAT (Z)", "CODE": "000002"}, {"DESCRIPTION ":" BREAKFAST PAN (Z) "," CODE ":" 000003 "}, {" Description ":" CONTINENTAL BREAKFAST (Z) "," CODE ":" 000004 "}, {" Description ":" EGGS SCRAMBLED WITH PAPA (Z) "," CODE ":" 000005 "}, {" Description ":" PANCAKES (Z) "," CODE ":" 000006 "}, {" Description ":" PAN + COFFEE (Z) "" CODE ":" 000007 "}, {" Description ":" HASH BROWNS - PAPA FR (Z) "," CODE. ":" 000008 "}, {" Description ":" HAMB 1 \ / 3 SINGLE (Z) "," CODE ":" 000009 "}, {" Description ":" WAFFLES "," CODE ":" 000010 "}, {" Description ":" SERVING FRUIT (Z) "," CODE ":" 000011 "}, {" Description ":" CHOCOLATE "," CODE ":" 000012 "}, {" Description ":" CAF ?, TE, (Z) "," CODE ":" 000013 "}, {" DESCRIPTION ""CHOCOLATE BREAD", "CODE": "000014"}, {"Description": "CAPPUCCINO (Z)", "CODE": "000015"}, {"Description": "CHOCOLATE BREAD AND CHEESE" "CODE": "000016"}, {"Description": "EGGS RANCHEROS Z", "CODE": "000017"}, {"Description": "NUT PIE", "CODE": "000018"}, {"Description": "BIG BREAST FINGERS", "CODE": "000019"}, {"Description": "BREAST SMALL FINGERS", "CODE": "000020"}, {"Description": "RIB SOUP RAS (Z ) "," CODE ":" 000021 "}, {" Description ":" HAMB.-CHICKEN 1 \ / 4-PAPA "," CODE ":" 000022 "}, {" Description ":" HAMB.MR-CHICKEN 1 \ / 3 PAPA "," CODE ":" 000023 "}, {" Description ":" PAPA JUMBO (Z) "," CODE ":" 000024 "}, {" Description ":" PAPA P \ / CARRIED (Z) "," CODE ":" 000025 "}, {" Description ":" HOT DOG (Z) "," CODE ":" 000026 "}, {" Description ":" omelette Z "," CODE ":" 000027 "}, {" Description ":" salchipapa BIG (Z) "," CODE ":" 000028 "}, {" Description ":" salchipapa SMALL A (Z) "," CODE? ":" 000029 "}, {"Description": "POTATO CHIPS PAQ.", "CODE": "000030"}, {"Description": "RED - HERBS (Z)", "CODE": "000031"}, {"Description": "MORA SHAKE BANANA (Z) "," CODE ":" 000032 "}, {" Description ":" STRAWBERRY SHAKE (Z) "," CODE ":" 000033 "}, {" Description ":" STRAWBERRY BANANA SMOOTHIE (Z) "," CODE ":" 000034 "}, {" Description ":" BURGER COMBO 1 \ / 3 CP (Z) "," CODE ":" 000035 "}, {" Description ":" CARROT JUICE (Z) "," CODE ":" 000036 "}, {" Description ":" TANGERINE JUICE (Z) "," CODE ":" 000037 "}, {" Description ":" ICE BAG SMALL (Z) ""CODE": "000038"}, {"Description": "BOTTLED WATER (Z)", "CODE": "000039"}, {"DESCRIPTION", "BANANA SPLIT (Z)", "CODE": "000041 "}, {" Description ":" BIG BAG OF ICE (Z) "," CODE ":" 000042 "}, {" Description ":" SOFT ICE CREAM CUP (Z) "," CODE ":" 000044 "} , {"Description": "SOFT WAFFLE CONE (Z)", "CODE": "000046"}, {"Description": "ICE CREAM (Z)", "CODE": "000047"}, {"DESCRIPTION "" MISTER S BANANA (Z) "," CODE? ":" 000048 "}, {" Description ":" PEACH SPLIT (Z) "," CODE ":" 000049 "}, {" Description ":" GAS SMALL A (Z) "," CODE? ":" 000050 "}, {" Description ":" GC 350
Log Message longer than limit (4000). Message was truncated.
Error occurred on line: 60 (main)
java.lang.RuntimeException: JSON Array expected.
at anywheresoftware.b4a.objects.collections.JSONParser.NextArray (JSONParser.java: 62)
at anywheresoftware.b4a.samples.mysql.main._jobdone (Main.java: 444)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
at anywheresoftware.b4a.shell.Shell.runMethod (Shell.java: 636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl (Shell.java: 305)
at anywheresoftware.b4a.shell.Shell.raiseEvent (Shell.java: 238)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
at anywheresoftware.b4a.ShellBA.raiseEvent2 (ShellBA.java: 121)
anywheresoftware.b4a.BA at $ 3.run (BA.java: 320)
at android.os.Handler.handleCallback (Handler.java: 730)
at android.os.Handler.dispatchMessage (Handler.java: 92)
at android.os.Looper.loop (Looper.java: 213)
at android.app.ActivityThread.main (ActivityThread.java: 5225)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java: 525)
com.android.internal.os.ZygoteInit at $ MethodAndArgsCaller.run (ZygoteInit.java: 741)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 557)
at dalvik.system.NativeStart.main (Native Method)
Activity ** (main) Pause, UserClosed = true **
Activity ** (main) Resume **
Activity ** (main) Pause, UserClosed = false **
libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
sending message to waiting queue (CallSubDelayed - UpdateStatus)
running messages waiting (1)
Activity ** (main) Resume **
Service ** (service1) Destroy **
Service ** (service1) Create **
Service ** (service1) Start **
Service ** (service1) Destroy **
Activity ** (main) Pause, UserClosed = false **
Activity ** (main) Resume **
Activity ** (main) Pause, UserClosed = true **
Activity ** (main) Create, isFirst = true **
Activity ** (main) Resume **
Service ** (service1) Create **
Service ** (service1) Start **
Connected to B4A-Bridge (Wifi)
Installing file.
Activity ** (main) Pause, UserClosed = false **
PackageAdded: package: anywheresoftware.b4a.samples.mysql



AND LEAVE THE APP

ARE 700 RECORDS. SO WILL THE ERROR?

THANK YOU VERY MUCH
 

JUAN CARLOSORDOÑEZ

Member
Licensed User
Longtime User
The code is exactly equal to yor mysql.b4a example but changed to server 192.168.1.103 and other similar database. the line 60 mentioned is
COUNTRIES = parser.NextArray 'returns a list with maps
 

Douglas Farias

Expert
Licensed User
Longtime User
Hi, I have trouble connecting,
when I connect to your server http://www.b4x.com/android/countries.php, the application works perfectly.
But when I connect to my hosting http://www.desarrolloglobal.com.co/tmp/countries.php, an Error ocurred.
associate the image with the error log.
Thank you for your help.

it dont is a json response o_O
<html>
<head> etc is not json, to parse u need only the result on json

remove the html , head etc etc

u can use this
http://www.b4x.com:51042/json/index.html

to paste your response and press parse, with this u see if response is a json result
but first u need remove the header html contents
 

JAVIERGARCIA

Member
Licensed User
Longtime User
hi,
Erel,, you could send me the example database mysql access.
Connect Android to MySQL Database Tutorial

I have the problem that the program works correctly me, but when I create a database and just put it on my server, changing the line:
job.PostString ("http://www.b4x.com/android/countries.php" Query)

other point to my server, the program gives me the error:

java.lang.runtimeexcetion:
JSON Array excepté

and do not understand that if everything else is just like your example.
(I wanted to compare the bases, to see if something changes in my structure)
thank you very much
 

JAVIERGARCIA

Member
Licensed User
Longtime User
Hi Erel,
I don´t understand,, I have not changed anything. I put the log that you have seen on the message and not do anything more than this. I do not get it. You can enter the base and I did not. I can get into your base and not mine.
What could it be?

Thanks
 

JAVIERGARCIA

Member
Licensed User
Longtime User
Thank you for your attention;
that fixed the problem when I want to mount an external application.

Thanks again
 

Oldmanenzo

Member
Licensed User
Longtime User
I'm trying this function on my server to load data.
I have the impression that the function is executed in jobdone backgrond.
The example loads a table and shows the content after which you select by clicking a given field and shows the result.
I have the need to fill a spinner and select the first item code and load a variable to be used later to create the panel.
Unfortunately when I run the second query tells me that the index 0 is clearly wrong because the spinner has not been filled by the function. If I run just the upload function of the spinner the program works perfectly.
How can I fix this, or how do I know that the spinner was filled and then actually run the second query that uses spinner.selecteditem
Thanks and sorry for English
B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim Scroll As ScrollView
    Dim CmbRegione As Spinner
    Dim cd As ColorDrawable
    Dim PanelHeight As Int : PanelHeight=80dip
    Dim REGIONE  ="Regione", PROVINCIA ="Province", PNL ="Panel", COUNT="Conteggio" As String
    Dim prov() As String
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Activity.LoadLayout ("frmricercaview")
    Scroll.Initialize (100%x)
    Activity.AddView (Scroll, 0, 40dip, 100%x, 100%y)
    Scroll.Color =Colors.Black
    CmbRegione.Left =Activity.Width /2 - CmbRegione.Width /2
    CmbRegione.Prompt ="Regione"
    FetchCountriesRegione
    CmbRegione.SelectedIndex =0
    FetchProvince
    'CmbRegione_ItemClick(0, CmbRegione.GetItem (0))      
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub FetchCountriesRegione
'Utilizzato per riempire ilcombox delle regioni
    ProgressDialogShow("Sto caricando le informazioni")
    'Gets all the available countries
    ExecuteRemoteQuery("SELECT Regione FROM regioni ORDER BY Regione", REGIONE)
End Sub

Sub FetchProvince
'Utilizzato per riempire la variabile delle province secondo la regione selezionata
    ProgressDialogShow("Sto caricando le informazioni")
    'Gets all the available countries
    ExecuteRemoteQuery("SELECT Provincia FROM province WHERE (Regione ='" & CmbRegione.SelectedItem &"') ORDER BY Provincia", PROVINCIA)
  
End Sub

Sub ExecuteRemoteQuery(Query As String, JobName As String)
    Dim job As HttpJob
    job.Initialize(JobName, Me)
    job.PostString("http://www.caravan-forum.it/portolano/portolano.php", Query)
End Sub

Sub JobDone(Job As HttpJob)
    ProgressDialogHide
    If Job.Success Then
    Dim res As String
        res = Job.GetString
        Log("Response from server: " & res)
        Dim parser As JSONParser
        parser.Initialize(res)
        Select Job.JobName
            Case REGIONE
                Utility.ExecuteSpinner (parser, CmbRegione, "Regione")
            Case PROVINCIA
                Utility.ExecuteLoadProvince (parser, prov, "Provincia")
        End Select
    Else
        ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    Job.Release
End Sub

in Utility module. If i load only spinner the program work well

B4X:
Sub ExecuteSpinner(parser As JSONParser,  Spinner1 As Spinner, field As String)
    Spinner1.Clear
    If Spinner1.Prompt ="Province" OR Spinner1.Prompt  = "Tipo" Then
        Spinner1.Add ("Tutte")
    End If
    Dim COUNTRIES As List
    COUNTRIES = parser.NextArray 'returns a list with maps
    For i = 0 To COUNTRIES.Size - 1
        Dim m As Map
        Dim txt As String
        m = COUNTRIES.Get(i)
        txt=m.Get(field)
        Spinner1.Add (txt)
    Next
End Sub

Sub ExecuteLoadProvince (parser As JSONParser, value() As String, field As String) As String
    Dim COUNTRIES As List
    For n=0 To value.Length -1
        value(n)=""
    Next
    COUNTRIES = parser.NextArray 'returns a list with maps
    For i = 0 To COUNTRIES.Size - 1
        Dim m As Map
        m = COUNTRIES.Get(i)
        value=m.Get(field)
    Next
    Return value
End Sub
 
Last edited:

giacomo-italy

Member
Licensed User
Longtime User
thanks!!!




thanks EREl my program now load and download images to and from mysql
greetings from colombia
:sign0098:
I read hundreds of posts, many tutorials, I'm banging my head for several days ...
Could you kindly show the code on how to do load / save images in mysql via php
(as you said that you managed to do in this post?)
Thank you very much if you will help me.
 

fabio55

Member
Licensed User
Longtime User
A new more powerful framework is now available: Remote Database Connector.

This tutorial explains the basic concepts required for creating a connection between Android device and a remote server. In this case it is a MySQL database.
A tutorial for connecting to SQL Server is available here.

Android cannot connect directly to the database server. Therefore we need to create a simple web service that will pass the requests to the database and will return the response.

For this example I've created a new database that lists the countries population. The data was derived from a UN database.

The database includes a single table named "countries" with three columns:
mysql_1.png

PHP Script

The web service is made of a single PHP script running on the same server.
You have several options for the web service implementation. You can create several prepared statements which will be filled with parameters passed in the request.
Or you can take the complete query from the request and pass it to the database server.
There are high security risks with issuing queries received from an unknown user. If your service is public then you will probably want to choose the first option.
You should also make sure to correctly escape the parameters. See this php method: PHP: mysql_real_escape_string - Manual

In our example I've chosen the second option which takes the query and passes it to the database directly.
I've restricted the database user to SELECT queries (in MySQL configuration).

The PHP code:
PHP:
<?

$databasehost = "localhost";
$databasename = "xxxx";
$databaseusername ="xxxx";
$databasepassword = "xxxx";

$con = mysql_connect($databasehost,$databaseusername,$databasepassword) or die(mysql_error());
mysql_select_db($databasename) or die(mysql_error());
mysql_query("SET CHARACTER SET utf8");
$query = file_get_contents("php://input");
$sth = mysql_query($query);

if (mysql_errno()) {
    header("HTTP/1.1 500 Internal Server Error");
    echo $query.'\n';
    echo mysql_error();
}
else
{
    $rows = array();
    while($r = mysql_fetch_assoc($sth)) {
        $rows[] = $r;
    }
    print json_encode($rows);
}
?>
The script takes the query from the POST data and submits it to the database.
The result is then written in JSON format.

Basic4android code

Our application displays a list of countries. When the user presses on a country, its population is retrieved from the database and displayed.

SS-2013-01-29_16.42.32.png


The code sends the query and then when the result arrives the JSON is parsed and displayed.
Note that in this case the JSON object is made of an array of one or more maps.

Edit: Code updated to use HttpUtils2 instead of HttpClient.
WARNING: The php example should start (at least on my server) with "<?php" and not only with "<?"...
 

khosrwb

Active Member
Licensed User
Longtime User
This is a community forum. Please don't limit your questions to a single member.

You can just add it like any other field.

oh
excuse me:oops:
I don't repeat again:(

if it's possible please answer to my ask:D
how can I load a large text data by SQL Database ? ( for make ebook )
I know that , I can make ebook by webview , but this work make my app very large size
 
Status
Not open for further replies.
Top