Using SQLite with iPad, i. e. iOS

Hi All

According to forum entries using the SQLite database on OS X seems to work because there exists an JDBC driver. I am wondering if anyone is already using the SQLite database on an iPad, i. e. iOS, with a Servoy application? What kind of JDBC driver would be needed on iOS for SQLite together with a Servoy web app? Experience or trials welcome.

Regards,

are you planning to run the server portion of servoy on the iPad??
That doesn’t sound logical to me, but for the rest if you just use the iPad as a browser for the WebClient that it has no connections to database if that is SQLLite or anything else.

Johann, this project would require to run only locally on an iPad, but needs a database, and SQLite seems to be a bit of a standard for mobile devices beside SQL Anywhere UltraLite for iOS (which, I believe, uses a daemon process?).

That means the answer is yes, I would like to run the server portion of Servoy on the iPad, whereas the server portion would “only” mean access to the SQLite database. Is this possible with Servoy?

Regards,

jcompagner:
are you planning to run the server portion of servoy on the iPad??
That doesn’t sound logical to me, but for the rest if you just use the iPad as a browser for the WebClient that it has no connections to database if that is SQLLite or anything else.

i don’t think that will work, the server portion of servoy needs a java install, i don’t think you have that on an iPad.

There is no Java JVM on iOS. Apple doesn’t allow it.
So if you have a requirement to access local databases you need to write an iOS app (in Obj-C) and communicate to Servoy using REST or via the webclient.

The iPad has no Java as far as I know. But as SQLite is a set of C-Libraries, database server means in this case a reference to the database file, and Java can only be a wrapper doing just that. As SQL Anywhere Ultralite for iPhone has no Java as well, it must be similar to SQLite connection, i. e. it has nothing to do with Java.

Regards,

jcompagner:
i don’t think that will work, the server portion of servoy needs a java install, i don’t think you have that on an iPad.

Robert

I am planning to write a Servoy web client for iPad as we did for iPhone, but I need a local database. SQLite is a set of C classes, as far as I understand, so the “server” connection is actually a C call. That has anyway nothing to do with Java, so it should somehow be possible to make a SQLite “connection” from a Servoy app, don’t you think so? If it’s not at all possible, it would mean it’s not possible to build Servoy apps needing a local database as SQLite or SQL Anywhere UltraLite.
What does it have to do with REST?

Regards,

ROCLASI:
There is no Java JVM on iOS. Apple doesn’t allow it.
So if you have a requirement to access local databases you need to write an iOS app (in Obj-C) and communicate to Servoy using REST or via the webclient.

and what is the app that calls that c code?

where does that run? what does it exactly run?

If it is a servoy webclient, that wants to connect to a servoy server, where does that run?

I thought may be you have an idea how this could work :wink: One should know how it’s principally done, but I have no experience with SQLite - so someone can chime in?

jcompagner:
and what is the app that calls that c code?

where does that run? what does it exactly run?

If it is a servoy webclient, that wants to connect to a servoy server, where does that run?

but this just will not work…

Again what app calls SQLLite code? what should make that connection? Talking about the Servoy app. Where does your Servoy runs in?
That servoy code must be run in a client of Servoy and that client is java. So java has to be run.

or are we talking here about a complete different kind of app for the iPad where no Servoy code is really run or executed just data is read in from an real Servoy Server?

I guess for that you need to ask around outside of Servoy.

jcompagner:
but this just will not work…

Again what app calls SQLLite code? what should make that connection? Talking about the Servoy app. Where does your Servoy runs in?
That servoy code must be run in a client of Servoy and that client is java. So java has to be run.

What about web client, no Java needed, otherwise, how would our iPhone app run 8)

jcompagner:
or are we talking here about a complete different kind of app for the iPad where no Servoy code is really run or executed just data is read in from an real Servoy Server?

I guess for that you need to ask around outside of Servoy.

The queston is just how to connect to a database which has no db daemon running, is it?

The queston is just how to connect to a database which has no db daemon running, is it?

SQLite has no deamon running no.
It is opened by the app using it.

The only way I see this happening (unless I am mistaken) is that you write an app to open SQLite and provide web services using the database.
But, when you are going to do that you can just as well create the whole application in Objective C.

Hi Robert,

Robert Huber:
What does it have to do with REST?

Servoy client doesn’t run on iOS. You can only open a webbrowser and connect to Servoy webclient. So that means the Server is running the client and you only get HTML, CSS and Javascript inside your browser.
To allow webapplications (like Servoy webclient) to have access to any local API like a SQLite database would mean that iOS WebKit has some JS API for this. Otherwise this is aproach a non-starter.
Another way is to create your own iOS app using the many frameworks out there (PhoneGap,Appcelerator, etc) which will give you a native app that does have access to all the native API’s including a SQLite database. But now you have the choice to still use Servoy webclient and show it in a Webkit pane (essentially a browser inside the app) and provide some access between the app and the solution yourself or to talk to Servoy Server using REST and take care of the displaying of data yourself instead of Servoy webclient.

I think those are your options if you want to access local API’s on iOS.

Hi Robert

ROCLASI:
Servoy client doesn’t run on iOS. You can only open a webbrowser and connect to Servoy webclient. So that means the Server is running the client and you only get HTML, CSS and Javascript inside your browser.

Yes, now there is (only ;-) a way needed to have the repository with the solution running in SQLite and the app also using (another) SQLite connection.

ROCLASI:
To allow webapplications (like Servoy webclient) to have access to any local API like a SQLite database would mean that iOS WebKit has some JS API for this. Otherwise this is aproach a non-starter.

Do you know IF the WebKit has a JS API for this? With HTML5 there is always talk about offline, so there is at least a chance for that going to happen, I assume.

ROCLASI:
Another way is to create your own iOS app using the many frameworks out there (PhoneGap,Appcelerator, etc) which will give you a native app that does have access to all the native API’s including a SQLite database. But now you have the choice to still use Servoy webclient and show it in a Webkit pane (essentially a browser inside the app) and provide some access between the app and the solution yourself or to talk to Servoy Server using REST and take care of the displaying of data yourself instead of Servoy webclient.

I think those are your options if you want to access local API’s on iOS.

Did you already try something like your proposal running a Servoy solution in a WeKit pane, inside PhoneGap, for example?

Regards,

Of course I still would like to use Servoy, I mean, needing an app to open SQLite should not automatically require to use Objective-C - at last - I would like to use my Servoy know-how :D

IT2Be:

The queston is just how to connect to a database which has no db daemon running, is it?

SQLite has no deamon running no.
It is opened by the app using it.

The only way I see this happening (unless I am mistaken) is that you write an app to open SQLite and provide web services using the database.
But, when you are going to do that you can just as well create the whole application in Objective C.

Robert Huber:
Do you know IF the WebKit has a JS API for this? With HTML5 there is always talk about offline, so there is at least a chance for that going to happen, I assume.

I know webkit has some access to local API’s but I am not sure of that also includes any SQLite db’s. I kinda doubt it.

Robert Huber:
Did you already try something like your proposal running a Servoy solution in a WeKit pane, inside PhoneGap, for example?

I haven’t (yet) but I know Scott Buttler (iTech Professionals) and Harjo Kompagnie (DirectICT) have.

I:
I know webkit has some access to local API’s but I am not sure of that also includes any SQLite db’s. I kinda doubt it.

Actually you can.

Hi Robert

Looks very promising! The question remains, if, beside opening a database, SQLite can be integrated in Servoy in the same way as the other supported databases are? Have you got any idea?
This would open the development of offline apps not only for iPad and iPhone, but also for other mobile devices like Android, I assume.
I am awaiting what Johan is saying to this new findings.

Regards,

ROCLASI:

I:
I know webkit has some access to local API’s but I am not sure of that also includes any SQLite db’s. I kinda doubt it.

Actually you can.

it is not the “same way” what you want.

Because what you want is that the webclient itself in the browser talks to the database, Servoy clients don’t do that, only the server talks to the db.

If you really want to have something running on the iPad without a connection to a remote server, then you can’t use Servoy.