Recent

Author Topic: Laz4Android Firebird  (Read 11786 times)

SteenJorgensen

  • Jr. Member
  • **
  • Posts: 68
Laz4Android Firebird
« on: November 12, 2013, 03:58:49 pm »
I have build a app. in Laz4android and this works fine. Now i must have a connection to my Firebird SQl  server, and this give me trouble.
When i try to connect to the sql-server with "IBConnection1.Connected := True" the app. crash.

Have any one done this before? Or even better if there is a persoen out there who have a litle slip of code?

Thanks
Steen
----------------------------------------
Lazarus version 2.0.12 64-bit
FPC 3.2.0

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Laz4Android Firebird
« Reply #1 on: November 12, 2013, 05:48:44 pm »
To do this, your app must open a socket connection. Did you write the permission in AndroidManifest.xml?

SteenJorgensen

  • Jr. Member
  • **
  • Posts: 68
Re: Laz4Android Firebird
« Reply #2 on: November 13, 2013, 10:08:02 am »
My Manifest.xml allow internet with:
    <uses-permission android:name="android.permission.INTERNET" />
I think this is ok?.

When i try to connection := true i get:
InOutError with the tekst "Can not load default Firebird client (libfbclient.so.2.5) or (......"

I can see that i must have the fb-client (as i windows), but can't find this client on internet. and where am i going to put this?

As you can see i a novice in this Android  :o
----------------------------------------
Lazarus version 2.0.12 64-bit
FPC 3.2.0

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Laz4Android Firebird
« Reply #3 on: November 16, 2013, 02:08:15 pm »
Quote
I think this is ok?
Yes, your problem is not there.
Quote
I can see that i must have the fb-client (as i windows), but can't find this client on internet. and where am i going to put this?
Guess you have to build one from source yourself, as Firebird doesn't provide official binaries. I'm not sure whether they support Android or not anyway. You'll have to put the libraries in the same directory as your app .so.

LA.Center

  • Full Member
  • ***
  • Posts: 244
    • LA.Center
Re: Laz4Android Firebird
« Reply #4 on: November 16, 2013, 05:15:08 pm »
You would have to build Firebird client for your Android device. Instead I would suggest that you create a middle-bridge for your Android.

Android -> XML/HTTP Server -> Firebird Server
Firebird Server -> XML/HTTP Server -> Android

SteenJorgensen

  • Jr. Member
  • **
  • Posts: 68
Re: Laz4Android Firebird
« Reply #5 on: November 18, 2013, 12:26:56 pm »

uhhhhhh  :o

There most be someone who have this libfbclient.so file i can use?
----------------------------------------
Lazarus version 2.0.12 64-bit
FPC 3.2.0

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Laz4Android Firebird
« Reply #6 on: November 18, 2013, 01:37:53 pm »
Perhaps. AFAIU porting efforts to Android may have started; I've never heard that they were finished.

Let us know when you found it so we can update the wiki page http://wiki.lazarus.freepascal.org/Firebird_in_action#Overview

I would go with PlusPlus' advice (or use JSON instead of XML but it's much the same thing); you can use e.g. fcl-web or brook framework server-side. It's better not to expose database ports directly to the internet anyway, especially because of Firebird's 8 character password limit and default plain text protocol.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

LA.Center

  • Full Member
  • ***
  • Posts: 244
    • LA.Center
Re: Laz4Android Firebird
« Reply #7 on: November 18, 2013, 06:44:01 pm »
absolutely correct BigChimp, firebird should be behind the DMZ, firebird in that sense has not the most secure login structure.

I have used this model myself, and once you have the middle bridge running you can connect anything that supports http protocol, including legacy mobile devices.

Just as a info:

I have actually only two commands.
1. SQL_QUERY that returns a xml data packet
2. SQL_EXECUTE which is for sql statement that don't return a dataset

Plus a very simple error checking. which returns SQL_OK or SQL_ERROR and the message.

works perfect, and the main advantage is you don't have to distribute any client software.

SteenJorgensen

  • Jr. Member
  • **
  • Posts: 68
Re: Laz4Android Firebird
« Reply #8 on: November 19, 2013, 07:26:48 am »
Hi, and thanks for answer.

I can see the idea of ​​using a bridge. Mostly due to the safety!

But i am not quite sure about how this code should be built up. Do you have a bite of code for examble?
----------------------------------------
Lazarus version 2.0.12 64-bit
FPC 3.2.0

mariuz

  • New Member
  • *
  • Posts: 41
    • http://flamerobin.org
Re: Laz4Android Firebird
« Reply #9 on: March 20, 2014, 07:01:17 pm »
Quote
I think this is ok?
Yes, your problem is not there.
Quote
I can see that i must have the fb-client (as i windows), but can't find this client on internet. and where am i going to put this?
Guess you have to build one from source yourself, as Firebird doesn't provide official binaries. I'm not sure whether they support Android or not anyway. You'll have to put the libraries in the same directory as your app .so.

You can download now Firebird Client 3.0 Alpha 2 for Android and include it in your project
http://www.firebirdnews.org/?p=9283
I need some testers   8)
« Last Edit: March 20, 2014, 07:03:04 pm by mariuz »

looksmallthinkbig

  • Newbie
  • Posts: 3
Re: Laz4Android Firebird
« Reply #10 on: July 24, 2014, 11:23:46 pm »
Hey mariuz, I'd love to test your software! It's actually exactly in line with what I've recently been trying to do. My only question is, your source code doesn't seem to be on that site anymore. Is there anywhere else I might be able to find it?

mariuz

  • New Member
  • *
  • Posts: 41
    • http://flamerobin.org
Re: Laz4Android Firebird
« Reply #11 on: August 05, 2014, 09:56:29 am »
I have moved my server to a better location , now is up and can be tested

 

TinyPortal © 2005-2018