×

Discussion Board

Results 1 to 7 of 7

Hybrid View

  1. #1
    Registered User
    Join Date
    Jul 2008
    Location
    England
    Posts
    48

    SQLite and or other database.

    Greetings all.

    Been a while since I've posted in here, so I trust everyone is still all as crazy as they've ever been :-)

    As you may have deduced from the title of this post, I'm looking for a little guidence on Accessing SQLite on the NSeries Nokia handsets

    I know that SQLite is the chosen database layer for symbian and that it's accessible from C++ , however I currently have a project that is a port of an application already existing on windows mobile, that the owner now wants to port to the NSeries platform, unfortunately there is a requirement that it be done in J2ME

    From what I can see and what I've researched on the internet, there is no J2ME access to SQLite from a midlet. There are Java wrappers and at least one full fat pure Java SQLite implementation that I've come across, but none are suitable for use with J2ME due to some underlying classes the implementations require not being present in the CDLC spec.

    I've been toying with a number of ideas, and have also looked at a couple of alternitives other than SQLite that may do the job. One of my Ideas involves using a C++ DLL written for symbian, that I could then call from J2ME to make the required calls into SQLite, this would be a preferable solution if I can't get SQLite access as the device must carry a copy of this local database for offline use, and the DB has already been constructed for the windows mobile platform using SQLite.

    My Questions therfore are as follows:

    A) Is it in anyway possible to access the SQLite implementation that is part of symbian from within a J2ME midlet.

    B) If the answer to A is no, then is it possible to create a C++ DLL or other access layer that can then be called from the J2ME app and then pass those calls down to the lower levels.

    C) If B is possible, then does anyone have any pointers or know where I may find further information.

    D) If none of the above are useable, then what options are other developers using to access local SQL based databases that reside ON DEVICE, I'm highlighting this aspect particular beacuse everywhere else I've asked, the imediate response has been "Talk to a DB server", this unfortunately is not an option the SQL database MUST reside in the devices file system (Most likley on a memory card)

    My initial thoughts are implementing my own custom interface and then calling it using JNI, but this very much depends on weather or not Nokia have fianlly decided to allow us authors to access to the OS by opening up the JNI sublayer.

    I'm also not too bothered about portability at this stage, as the target for this version is squarely on the N series nokia, with th minimum spec device being the N95 (FP3)

    Cheers in advance

    Shawty

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: SQLite and or other database.

    Yes, option B is possible.

    For further pointer, post a message on Symbian forum asking how to craete a background runing on device server application access SQLlite DB and act a midile layer between your J2me midlet and SQLlite DB.

    Your J2me midlet will access this as a server runing on local host on a predefined port no, using GCF and work with SQLDB..


    thanks,
    ~Amitabh

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: SQLite and or other database.

    The best way is probably to write some C++ to wrap the SQLite libraries to make them into a server, then connect from the J2ME app to the "server" using a SocketConnection or HttpConnection.

    You might find this article helpful.

    Graham.

  4. #4
    Registered User
    Join Date
    Jul 2008
    Location
    England
    Posts
    48

    Thumbs up Re: SQLite and or other database.

    Hey Graham, good to see your still around :-) it's been about 2 years since I've posted anything on here.

    Thanks for the replys so far, I'll read the article suggested.

    This seems to be a fairly common thing that people want to do so once I figure out a way of doing it, then I think I might just stick a post on my blog about it ...

    Cheers

    Shawty

  5. #5
    Registered User
    Join Date
    Jul 2008
    Location
    England
    Posts
    48

    Re: SQLite and or other database.

    Hey guys, thanks for the Pointers.

    The Ideas gonna work, 2 more quick questions.

    I want to be able to test the daemon seperately from the midlet, any one know what the IP address is of the emulator so I can connect to it from the test PC using an app such as putty?

    I'll be creating my own protocol for the Localhost link, and while developing the protocol I'd like to be able to fire up the emulator with the server running, and then connect to the emulator to type the protocol commands in directly accross the soket connection.

    Does the emulator actually expose an external connection, or do i simply just connect to my PC's local host?

    I've never really used the emulator much as I've always had real devices to test on in the past, but unfortunately this time I only have the emu.

    Cheers

    Shawty

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: SQLite and or other database.

    IP address for the emulator will be same as that which assigned to your PC, if testing from same system use localhost - if testing from another system on Lan use the local IP of your PC.

    thanks,
    ~Amitabh

  7. #7
    Registered User
    Join Date
    Jul 2008
    Location
    England
    Posts
    48

    Re: SQLite and or other database.

    Hey Amitabh... Thanks, that totaly worked.

    If your Ever stuck for anything C# or .NET related esp on Windows mobile, pop across to Linked-In and look for the Lidnug Group, you'll find me in there most of the time :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •