MIP via Java

Hello all,

I need to integrate Milestone in a java application, I do the connection phase at the Mobile Server but the login step doesn’t work.

I looked for information/examples but I did not find them.

Someone can give me information?

Thanks for your attention.

Best Regards

Morena Ruggiero

Hi,

If you are doing an Android integration you can use the MIP SDK Mobile that provides some libraries for easy integration. It can be found here:

Otherwise you may look at these samples that are part of the Milestone MIP SDK and are javascript samples based on Mobile Server protocol

Sample 1

http://doc.developer.milestonesys.com/html/index.html?base=samples/mobileserversample.html&tree=tree_3.html

Sample 2

http://doc.developer.milestonesys.com/html/index.html?base=samples/mobileplaybacksample.html&tree=tree_3.html

In an installed MIP SDK you find-

[C:\Program](file:C:/Program) Files\Milestone\MIPSDK\ProtocolSamples\MobileServerSample\DemoApp

[C:\Program](file:C:/Program) Files\Milestone\MIPSDK\ProtocolSamples\MobilePlaybackSample\DemoApp2

If you need any further assistance please let us know,

Kind Regards,

Svetlana

Hi Morena,

What exactly is failing at “the login step” ?

You can check the error code and try to understand what is the reason.

Does DH Key exchange pass well ?

KR

Petar

btw. I suppose you are using Java server side, otherwise we do have very nice Android SDK.

Thank you for your answer,

I’m not doing an Android integration but in .aar I found usefull information.

Another question: I’m trying to export an avi recording from XProtect Essential + with MIP SDK for Java. I have used StartExport and GetExport.

Last method doesn’t give me:

<Export StartTime=“1524564889000”

EndTime=“1524564949000”

ExportId=“74c4e03c-0397-4e5c-ba5e-8d62ee388e87”

Name=“FLEXIDOME IP 4000i IR (172.16.212.70) - Camera 1-2018.04.24-12.14.49-01m00s.avi”

FileName=“FLEXIDOME IP 4000i IR (172.16.212.70) - Camera 1-2018.04.24-12.14.49-01m00s.avi”

CameraId=“6bddae62-fdcf-4a60-ab56-3ae4c7d6be44”

CameraName=“FLEXIDOME IP 4000i IR (172.16.212.70) - Camera 1”

Type=“Avi”

State=“0”

User=“utente01”

FullUserName=“utente01”

UserSid=“S-1-9-2374562217-103393211-1616324164-2593933761-2350999220-1-3046871505-3281771331-2248166984-533079171”

InitType=“Manual”

QueuedTime=“1524565669563”

CompletedTime=“-62135596800000” Size=“0”

ThumbLink=“XProtectMobile/Export/utente01/74c4e03c-0397-4e5c-ba5e-8d62ee388e87/FLEXIDOME IP 4000i IR (172.16.212.70) - Camera 1-2018.04.24-12.14.49-01m00s.avi.thumbnail.jpeg”

KeepOriginals=“false”

InvestigationId=“00000000-0000-0000-0000-000000000000”

ReExportFromId=“00000000-0000-0000-0000-000000000000”

ServerId=“6dee735f-e42c-489e-af7f-2cd91f6260be”>

6bddae62-fdcf-4a60-ab56-3ae4c7d6be44

OK

In Milestone documentation’s the response is

<Export CameraId=“25c9a2d9-d044-4d1e-bb74-eb7e0ae9eb05”

CameraName=“Axis Q7404 Video Server (10.4.13.6) - Camera 1”

CompletedTime=“1352971268945”

EndTime=“1352971229000”

ExportId=“b146c13f-496f-40d9-a2c9-798f38f59673”

Link=“XProtectMobile/Export/virtualtest/b146c13f-496f-40d9-a2c9-798f38f59673/Axis Q7404 Video Server (10.4.13.6) - Camera 1.Avi”

Name=“Axis Q7404 Video Server (10.4.13.6) - Camera 1.Avi”

QueuedTime=“1352971258577”

Size=“292015643”

StartTime=“1352970989000”

State=“101”

ThumbLink=“XProtectMobile/Export/virtualtest/b146c13f-496f-40d9-a2c9-798f38f59673/Axis Q7404 Video Server (10.4.13.6) - Camera 1.Avi.thumbnail.jpeg”

Type=“Avi”

User=“VirtualTest”/>

On my response I don’t see Link Value, where I’m wrong?

Regards

Morena

Hi Morena,

You are right, sometimes command GetExport returns no information for the Link.

This happens when the export is still in progress.

When it completes (no matter with success or failure) “Link” attribute will be available in the XML with correct value (path for download).

You could check for the export state with the “State” attribute (of the same command response).

0 - Means queued for preparation

1 - 100 - how much is made from the export in percentage

101 - ready for download

< 0 - Error happened.

You received State=“0”

In the SDK example State="101.

Thank you,

but GetExport returns me always State=“0”…it seems that the the export doesn’t start, have you ideas about what the problem might be?

Hi Morena,

No on “prima vista”.

Avi exports usually take long time to be prepared as they are doing video trans-coding. This time also depends on the codec used.

How long is the selected time interval for export ?

I’m trying to export 1 minute

Hm,

Doesn’t make sense,

should complete for a reasonable small time.

You are calling GetExport many times on regular interval, right ?

(For example on every 5 seconds)

Yes, I’m calling getExport every 5 seconds

Exports are processed in Queue so if one of them hangs could result in blocking all others in the queue.

(I haven’t seen such situation in real life, but is possible in theory).

What could be tried is:

  1. Stop Mobile server.
  2. Manually delete all the content from the Exports folder (trough windows explorer).
  3. Start again Mobile server.
  4. Create another export (call StartExport command).

If there is problematic export in the queue, this should remove it entirely.

Thanks, I’ll try to follow these suggestions.

Now GetExport work fine.

Thanks Petar.