B4J Question console application - image download and save

vcelak

Member
Licensed User
Longtime User
I have one question - I would like to add to my server side of attendance system software function, which will download and save image from IP camera as blob to mysql db when user action is done on remote terminal. I'm able to do it with gui application, but in concole one, which runs as service is it not possible by httputils.

Any suggestions quys? :)
 

vcelak

Member
Licensed User
Longtime User
You will need to use jHttpUtils2 source code instead of the library: http://www.b4x.com/android/forum/threads/jhttputils2-source-code.39415/#post-234176

The library depends on jFX which is not available in a console app. The source code uses conditional compilation to remove this dependency.

Hi Erel,

I have tried it, but the main problem is that I'm downloading jpeg file from the camera which is binary and there is no way for getbitmap.

Download link looks like: "http://192.168.0.68/GetImage.cgi?CH=1&hBase64=YWRtaW46YWRtaW4"

Any suggestion? Or simple example?
 
Upvote 0

vcelak

Member
Licensed User
Longtime User
You don't need to convert the bytes to an image. Just take the bytes and put them in the database:
B4X:
Dim blob() As Byte = Bit.InputStreamToBytes(Job.GetInputStream)
'store the blob in the database

Yes, you are right. I will try it.

Thank you for help.
 
Upvote 0

vcelak

Member
Licensed User
Longtime User
You don't need to convert the bytes to an image. Just take the bytes and put them in the database:
B4X:
Dim blob() As Byte = Bit.InputStreamToBytes(Job.GetInputStream)
'store the blob in the database

Hi Erel,

one more question: Is there any way how to possibly manipulate images in console app? Like resize, embed some text, crop... without fx?

Thank you
 
Upvote 0
Top