Need B4A wrapper for Eink SDK

JohnC

Expert
Licensed User
Longtime User
I am in a need for help converting a java sdk into a lib that I can use with B4A.

The java source code I was provided is suppose to provide a way to send images/text to an eink display.

An eink display is a display that does not need any power to display an image/text on it. It only requires power to "change" the image/text on the display. eink displays are not designed to display images that change rapidly - they are only meant to display an image/text that only changes once or twice a minute or longer.

Not knowing java very well, it is hard to understand what the below sdk source code does or how I could use it with B4A.

From what I can tell/guess, it looks like this SDK talks to an eink controller (see image below) through a USB port on the android device:

einkcontroller.png


(the white connector on top I believe is a micro-usb that connects to the android device's USB port, and the brown-transparent cable on the bottom is the connection to the eink display)

So, please reply to me directly with any questions (that I hope I can answer) and a price to make a lib that will allow me to send images or text to an eink display.

Below is the SDK source that was provided to me:

http://www.max-soft.com/eink-sdk.rar

And below is an expanded view of the SDK's archive directory:

eink-zip-dir.png
 

Attachments

  • eink-zip-dir.png
    eink-zip-dir.png
    18.6 KB · Views: 173
Last edited:

agraham

Expert
Licensed User
Longtime User
As far as I can see most of that code is a demo using OpenCV to display an image. The driver for the display does not seem to be present in that code but is obtained as a service and used in line 21 below.
Java:
IT8951Manager manager = (IT8951Manager) getSystemService("it8951");

...

    public  void DisplayImage(final int draw_id){
        new Thread(new Runnable() {
            @Override
            public void run() {
                byte [] data;

                Bitmap bitmap=BitmapFactory.decodeResource(getBaseContext().getResources(), draw_id);
                Bitmap target_bitmap = scaleBitmap(bitmap,mWidth,mHeight);
                Log.e(TAG,"开始转换");
                if(mWidth==2880){
                    data = getGrayImage42(target_bitmap);
                }else {
                    data = getGrayImage(target_bitmap);
                }
                Log.e(TAG,"结束转换 data len ="+data.length);
                try {
                    int status =  manager.DisplayImageAPI(data,mWidth,mHeight);
                    Log.e(TAG,"display image status="+status);
                }catch (Exception e){

                }
                isDisplaying=false;
            }
        }).start();
    }
That so called SDK seems to be no more than a simple demonstration program - in as simple as OpenCv can be!

Your download link seems to be broken - I got it to work using a text copy and paste into a browser address field.
 

JohnC

Expert
Licensed User
Longtime User
As far as I can see most of that code is a demo using OpenCV to display an image. The driver for the display does not seem to be present in that code but is obtained as a service and used in line 21 below.
So, I need to re-contact the vendor and get the source for that android service that handles the DisplayImageAPI?
 

JohnC

Expert
Licensed User
Longtime User
Yes, I agree. Thank you - I will send them an email now.
 

JordiCP

Expert
Licensed User
Longtime User

JohnC

Expert
Licensed User
Longtime User
Your download link seems to be broken - I got it to work using a text copy and paste into a browser address field.
Link fixed - thanks!
 

JohnC

Expert
Licensed User
Longtime User
agraham, from their below response, it looks like you are right and the service is embedded in a custom android version on the below android motherboard.

This is a picture of the eink display's android motherboard connected to that Eink controller that I originally posted:

eink-android-controller-25.png


And here is their response:

Dear Mr John,

As today's confirmed with our engineer, that this API is only for let it display's programming code.

Because for this mainboard liken Andorid board, most is open access API for the programming, but not offer the Android board's underlying driving source code as you know, because this is belongs to these Android board supplier's property.

Afterall the basic and main aim is helping customers to let the e-ink display its content directly, no need to do any other programming any more. As other customer is also done like this, which with such API.

Meanwhile most APK or software is already with the data or command processing,which with capacity for processing, you can see whether is okay for you. Or you can tell me which kind of software it is, then i can see whether have any other solution way.


Besides for this e-ink screen's Android board, here is with two USB port which can let you directly display your content while you insert U-disk device etc. That is number 12 and number 13 port.(which is marked in red triangle)

Eink-android-75.png


So, is there a way I can declare the manager object/service in B4a so I can then call the API?
 
Last edited:

OliverA

Expert
Licensed User
Longtime User
It looks like there is a WiFi card. Maybe it has an http server that you can talk to to upload the images to display? Or FTP, or ....
 

JohnC

Expert
Licensed User
Longtime User
That wifi card (and I think a 4g modem) is so the android board can access the internet - no hotspot.
 

OliverA

Expert
Licensed User
Longtime User
Can you configure it (the Android part of the display) to pull images from a certain IP address? I’m just guessing here...
 

JohnC

Expert
Licensed User
Longtime User
My partner (who lives in a different state) received the display from china and is in the process of shipping it to me.

I'm assuming I'll eventually be able to write an app to pull images from a certain ip address, but I guess I'm not on the same page as you as to how to get it to the display?
 

JohnC

Expert
Licensed User
Longtime User
What would really be sweet is if JordiCP was right and the Eink controller is simply emulates a mass storage device and all I have to do is copy an image to that storage device and it will appear on the eink display - then that would be cool (and easy)!
 

OliverA

Expert
Licensed User
Longtime User
Yeah, probably talking past each other. Is the goal to install an app on the custom board? Or how are you trying to get to the display?
 

JohnC

Expert
Licensed User
Longtime User
Yeah, probably talking past each other. Is the goal to install an app on the custom board? Or how are you trying to get to the display?
Yes, I will write an app (and install it on that android motherboard) that will obtain info from the internet and display it on the eink display.

The whole problem is to how to send the image to the display from the app running on the android board.
 

OliverA

Expert
Licensed User
Longtime User
If you can install an app on the board than it should actually be relative simple. Use JavaObject to call getSytemService with the value “it8951”. Then run the method DisplayImageAPI against the returned JavaObject and pass it a bitmap.
 

JohnC

Expert
Licensed User
Longtime User
I'll give that a shot when I get the display!

I'm hoping I can easily hook a monitor to the "HDMI" connector and see the android homescreen, then it should be easy to install an app.
 

OliverA

Expert
Licensed User
Longtime User
Looking at the cade posted by @agraham , you'll need to convert the bitmap with getGrayImage42 or getGrayImage before it can be displayed. Need to figure out where those methods come from
 
Top