Android Question Reading pictures from the network

By-Cod3rs

Member
Licensed User
I want to show a photo shared on the network in the imageview1 .

Note: I viewing the current picture between two computers (two windows) .

Can you share a sample code?
 

DonManfred

Expert
Licensed User
Longtime User
Use okhttputils2 to download the image and show it in a ImageView.
Can you share a sample code?
You did tried to use the Forumsearch (it is working)? ;-)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I want to take pictures from a computer on the remote server.
You you have a server app running on that pc which is able to do a screencapture?

It is not possible from B4A to get a Screenshot from a PC without a servercomponent.

Edit to add: Create a Server app with b4j and let it running on the PC. Connect to this server app from b4a.
The server app needs to create a Screenshot and give the result back to the requesting b4a app.

or sample code?

I never wrote such a solution. sorry

Edit to add: i don´t know if a java app can do a screencapture from the entire PC tough... Probably better to find a windows app which does a Screencapture and call this app from B4J
 
Last edited:
Upvote 0

By-Cod3rs

Member
Licensed User
You you have a server app running on that pc which is able to do a screencapture?

It is not possible from B4A to get a Screenshot from a PC without a servercomponent.

Edit to add: Create a Server app with b4j and let it running on the PC. Connect to this server app from b4a.
The server app needs to create a Screenshot and give the result back to the requesting b4a app.



I never wrote such a solution. sorry

Edit to add: i don´t know if a java app can do a screencapture from the entire PC tough... Probably better to find a windows app which does a Screencapture and call this app from B4J

2.png


B4X:
Sub Process_Globals

    Dim SMB1 As SMB
  
End Sub

Sub Globals
    Private Button1 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Anasayfa_Formu")
  
    If FirstTime Then
        SMB1.Initialize("SMB1")
  
    End If
  
    
    SMB1.ListFiles("smb://192.168.1.10/Resimler/", "")

End Sub

Sub Activity_Resume
  
End Sub

Sub Activity_Pause (UserClosed As Boolean)
  
End Sub

Sub SMB1_ListCompleted(Url As String, Success As Boolean, Entries() As SMBFile)
    If Not(Success) Then
        Log(LastException)
    Else
        For i = 0 To Entries.Length - 1
            Log("*****************")
            Log(Entries(i).Name)
            Log(Entries(i).Directory)
            Log(DateTime.Date(Entries(i).LastModified))
            Log(Entries(i).Parent)
            Log(Entries(i).Size)
        Next
    End If
End Sub

I'm getting an error connecting.
But I can access this file on another computer.
I get a connection error when I install it on the phone.
I would really appreciate if you help.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

By-Cod3rs

Member
Licensed User
this may help to find out:


Thank you for the response.
We solved the problem.
Windows needs to be activated in SMB1.

ab.png

ab1.png


B4X:
Sub Process_Globals

    Dim SMB1 As SMB
    
End Sub

Sub Globals
    Private Button1 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Anasayfa_Formu")
    
    If FirstTime Then
        SMB1.Initialize("SMB1")
    
    End If
    
    SMB1.ListFiles("smb://192.168.1.31/Users/dogan/Pictures/", "")

End Sub

Sub Activity_Resume
    
End Sub

Sub Activity_Pause (UserClosed As Boolean)
    
End Sub

Sub SMB1_ListCompleted(Url As String, Success As Boolean, Entries() As SMBFile)
    If Not(Success) Then
        Log(LastException)
    Else
        For i = 0 To Entries.Length - 1
            Log("*****************")
            Log(Entries(i).Name)
            Log(Entries(i).Directory)
            Log(DateTime.Date(Entries(i).LastModified))
            Log(Entries(i).Parent)
            Log(Entries(i).Size)
        Next
    End If
End Sub

Thanks.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
That's what I am looking for. A sample code using SMB2 to download a file from a Windows shared folder.
Download the example from the librarythread.

For any further Question/Issue: Start a new Thread. It is a mistake to post to old Threads.
 
Upvote 0
Top